Live Trading
This page covers live trading wiring and safety rules.
Required Conditions
FYERS_ENVIRONMENT=LIVEALLOW_LIVE_ORDERS=trueorallow_live_orders: trueinconfig/broker.yaml- Valid
state.yamlwith correctaccount_id
Recommended Startup
- Start logging.
- Start REST and reconcile state.
- Start Order WS after reconciliation.
- 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.