Skip to main content

Module execution

Module execution 

Source
Expand description

Framework-side execution: subscribes to the MarketDataBus and routes each event through the risk gates to the ExchangeClient.

§Pre-trade gate sequence

For every non-Hold decision the brain emits, the gates run in this exact order. Each one that blocks emits a structured tracing event and the order is not placed.

  1. SessionPnl::is_session_halted(symbol) — daily drawdown cap.
  2. CircuitBreaker::is_tripped(symbol) — rolling-window loss breaker.
  3. PositionSizer::contracts(price, contract_value)0 means the sized order would be too small to send.

The first three are risk-layer concerns and never raise an error that aborts the service. A Decision::Close for a flat position is also a silent skip (logged at debug level).

Structs§

ExecutionService
Per-brain execution loop with full risk gating + order placement.