Advance a market session
session_stepAdvance an open trading session by steps or days, optionally submit agent orders at the first step, and return fills, portfolios, prices, and changes.
Instructions
Advance an open session by a number of steps or days, optionally sending orders for one of its agents at the first step, and get back the fills, each agent's portfolio, the prices and what changed. This is the one session tool that trades. An order is a signed share count (positive buys), {"quantity": q, "limit_price": p} for a limit order, or "cancel"; a malformed order is refused before anything runs, and one the market refuses (the leverage cap, a book that cannot fill) is listed and the rest trade. At most 360 steps a call and 504 days a session; a step costs about a sixth of a day of evaluate_strategies for one entrant. Keeps a checkpoint at the step it ends on. Deterministic: the same calls from the same open give the same result.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Advance through this many market closes, the day in progress counting as the first. Give steps or days, not both. | |
| agent | No | The agent the orders are for, one opened with null. May be omitted when the session has exactly one such agent. | |
| steps | No | Decision points to advance, 1 or more. Give steps or days, not both; with neither, one step. | |
| orders | No | Orders sent at the first step this call runs, keyed by ticker: a signed share count for a market order (positive buys), {"quantity": q, "limit_price": p} for a limit order that waits in the book, or "cancel" to withdraw the agent's waiting orders on that ticker. | |
| session_id | Yes | A session id exactly as open_session or session_fork returned it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||