Execution

From signal to filled order.

The live engine is an event loop that fetches the latest bars, updates stops, and enters new positions when the aggregate score crosses threshold.

Order flow

  1. Fetch latest 200 bars.
  2. Compute features and classify regime.
  3. Update existing positions: hard stop, trailing stop, time stop.
  4. If flat and |score| > 0.55, size position via ATR risk unit and enter.
  5. Log fill and push to reporting.

Broker integration

The current data_feed.py includes an OANDA stub. To go live, set token and account_id in config.yaml and replace the stub with REST calls for pricing and orders.

Paper trading

python src/live_engine.py --config config.yaml