Skip to content

Live Trading

This page covers live trading wiring and safety rules.

Required Conditions

  • FYERS_ENVIRONMENT=LIVE
  • ALLOW_LIVE_ORDERS=true or allow_live_orders: true in config/broker.yaml
  • Valid state.yaml with correct account_id
  1. Start logging.
  2. Start REST and reconcile state.
  3. Start Order WS after reconciliation.
  4. Start Market WS and subscribe to symbols.

Example

broker.start()  # starts REST, reconciles, then starts Order WS
store.start(start_rest=False, start_market_ws=True, start_order_ws=False)
store.subscribe_market(["NSE:SBIN-EQ"])

What NOT To Do

  • Do not start live trading without a paper run.
  • Do not disable reconciliation without an ops plan.
  • Do not retry place_order on timeouts.

Scenario Example

Scenario: You want to go live after a backtest. - Run examples/backtest_to_live.py --go-live. - Ensure environment is LIVE and allow_live_orders is true. - Watch order WS updates for the first order before scaling up.