Skip to main content

Module execution

Module execution 

Source
Expand description

Provider-neutral order/fill simulator: orders, partial fills, pyramiding, costs, position state. Provider-neutral order/fill simulator: market/limit/stop/stop-limit/trailing orders, partial fills bounded by a per-bar participation cap, pyramiding (multiple same-direction fills accumulating one position), fees/spread/slippage, and explicit position state.

Intrabar fill logic is a documented approximation, not a claim of perfect intrabar path replay: a bar’s open/high/low/close order is assumed (configurable), and whichever of high/low is reached “first” under that assumption determines which side of a bar a resting order fills against. Real intrabar order is unknowable from OHLC alone.

Structs§

BracketLink
Identifies an order as part of a bracket (entry + stop-loss + take-profit) submitted via submit_bracket.
ExecutionCosts
Trading costs applied to every fill.
Fill
FillSimulator
FillSimulatorConfig
Order
Position

Enums§

BracketRole
An order’s role within a bracket.
IntrabarFillPolicy
How a bracket’s stop-loss and take-profit are ordered when a single bar’s OHLC range touches both. Real intrabar order is unknowable from OHLC alone; this makes the assumption explicit and deterministic instead of leaving it to fill-collection order.
OrderKind
OrderSide
OrderStatus

Functions§

submit_bracket
Submits a bracket: an entry order plus stop-loss and take-profit exits linked to it as one OCO (“one cancels other”) group. The exits are inactive until the entry actually fills, become active for at most the entry’s filled-but-not-yet-closed quantity (so a partial entry fill cannot be over-closed), and share one capacity budget so that whichever fills first — per FillSimulatorConfig::bracket_intrabar_policy when a single bar touches both — immediately caps the other within the same bar. Callers still get the three order IDs back and may cancel them individually (e.g. to tear down a bracket whose entry never filled).