EngineOrders & Positions

Orders & Positions

Trace execution from a strategy decision to requests, fills, position state, and trade records.

Execution turns a strategy decision into an outcome. Keep the intermediate stages visible: a signal can be blocked before submission, an accepted request can remain pending, and a close attempt can leave a position open.

These guides use the generic memory simulator for concrete examples and identify important broker differences. A shared method name does not guarantee identical behavior in every runtime.

From decision to position

From a strategy decision to execution stateA decision produces an execution request. Execution controls may reject it. An accepted order can remain pending until execution conditions are met. A fill updates positions and trade records. Each later decision must inspect the resulting state.DecisionRequestExecution controlsOrder accepted or pendingFillUpdated position and trade recordsSignal plus current execution stateInstrument · side · quantity · type · sourceWarmup · automation · L3 · runtime eligibilityMay fill immediately, remain pending, or later be cancelledSimulator rules or broker executionInspect again before the next actionA returned request result is not a fill confirmation.
Conceptual placement flow. Controls can stop a request; modification, cancellation, and closing follow their own method paths.

Name the state precisely

ItemMeaning
SignalThe strategy's desired action based on its inputs
RequestA call to an execution method
OrderAn instruction reported by the execution runtime
FillAn execution that changes exposure or records a trade
PositionCurrent reported exposure in an instrument
Trade recordA recorded execution outcome; not always a completed round trip

Read in order

  1. Getting started: follow one entry and one exit.
  2. Placing orders: request fields and return values.
  3. Order types: price conditions and runtime differences.
  4. Pending orders: avoid duplicate requests.
  5. Modifying and cancelling: act on existing orders.
  6. Positions: inspect exposure before deciding.
  7. Closing positions: reductions, closes, and reversal limits.
  8. Sizing: quantity and instrument units.
  9. Execution controls: automation and L3 checks.
  10. Simulation versus broker: execution ownership.
  11. Debugging: locate the first unexpected outcome.

On this page