Pre-trade checks: buying power, overselling and holding period
One command in the Execution pack, available in the CLI, as an MCP tool and as a JavaScript import: execution validate.
What it needs, and why
Every input is checked before anything is calculated. order is required; the rest refine the answer.
| Input | Required | The question it asks | Why it matters |
|---|---|---|---|
order | yes | What is the order: symbol, side, quantity and price? | Every check is against the order. |
settledCash | optional | How much settled cash is in the account? | Required to verify buying power on a buy. |
positions | optional | How many shares of the symbol are held? | Required to confirm a sell is not a short sale. |
Requests it answers
- “can they afford this trade”
- “is this sell allowed”
- “check this order before we place it”
An agent with this pack loaded picks the command from phrasing like that, asks for whatever input is missing, and reports the figures with the method that produced them.
Run it
node bin/wealth-skills.js execution validate --order '{"symbol":"VTI","action":"BUY","quantity":50,"price":275}' --settled-cash 25000
Limits it inherits from wealth-execution
- Checks fail closed: a buy needs a reference price and settled cash, and a sell needs the held position. Missing data is an error, not a pass.
- Interactive Brokers routes on the contract ID. Resolve the
conidwithGET /iserver/secdef/search?symbol=<ticker>and pass it explicitly; the builder refuses to guess. - FIX
MsgSeqNummust come from the live FIX session; the generator's counter is a placeholder.
The full pack, its other 4 commands and what it deliberately leaves alone are on the Execution page.