Placing orders
Construct explicit requests and interpret method results without assuming a confirmed fill.
Use the session's context.placeOrder(order, options) to request execution. Keep the complete configured instrument and label strategy requests with their actual source.
Request fields
The complete SJS example supplies these fields:
| Field | Example and purpose |
|---|---|
id | An identifier containing the signal timestamp, for tracing the attempt |
instrument | context.instrument, preserving the configured contract |
action | BUY or SELL |
quantity | Explicit quantity in the instrument's supported units |
type | A supported type such as MARKET |
limitPrice, stopPrice | Required price inputs for the corresponding order type |
Options such as source: "sjs" and metadata keep provenance and signal evidence with the request. Do not relabel strategy code as manual or L3 execution to avoid controls.
An order ID helps trace an attempt. It does not establish durable broker-wide idempotency. Validate finite, positive quantities and valid type-specific prices in strategy code; basic runtime checks are not a complete input-validation contract.
Shared simulated placement
The shared path stamps an omitted order date from the session clock, applies automation and L3 checks, checks placement eligibility and duplicate orders, and inserts an accepted order into session state. It immediately tries fulfillment before returning the order.
A duplicate check matches an existing order with the same instrument and action. It is not a general coordination mechanism across independent strategies or processes.
Read the result for the method you called
The crossover treats a placement or close result other than false, undefined, or null as accepted. This convention describes its request handling; it is not a universal result shape across all session methods.
A broker adapter may return an acknowledgment while later updates report execution. The shared simulator can return the submitted order after it has already filled, or while it remains pending. Inspect execution state in both cases.
If a call throws or its outcome is uncertain, inspect state before retrying. An exception or missing response does not itself prove that a broker received no instruction.
Continue with order types.