Book Guide¶
Explore strategy deployment, broker integration, and risk controls in the companion notebooks for Machine Learning for Trading, Third Edition. The examples below either use Live directly or explain related methods, with links to the corresponding library guides.
The Alpaca and IB notebooks use experimental feeds. Their broker adapters have a separate stable paper contract.
Run and control a Live strategy¶
- Unified framework demo calls Live and Backtest to compare lifecycle traces and portable strategy decisions. Follow Backtest to Live.
- IB paper trading demo calls Live with an IB paper broker and experimental IB feed. It requires TWS or IB Gateway. Follow Brokers.
- Alpaca paper trading demo calls Live with Alpaca paper execution and an experimental Alpaca feed. It requires credentials. Follow Brokers.
- Alpaca crypto live demo calls Live for a crypto venue workflow. Review its live order prerequisites before attempting it. Follow Brokers.
- Pipeline verification calls Live to compare research and deployment inputs and decisions. Follow Backtest to Live.
- Safety and risk demo calls Live to exercise
SafeBrokerand shadow risk behavior. Follow Risk Controls. - Runtime safety showcase calls Live to show stale-data rejection, persistent kill switch, reconciliation, and engine health. Follow the Operator Guide.
- Crypto funding deployment loop calls
AlpacaBrokeronly in its operator-authorized paper path. It uses OKX public data for a separate execution rehearsal. Follow Data Feeds.
The crypto funding loop trains on Binance-derived perpetual data, observes OKX funding and bars, and maps a subset to Alpaca USD spot crypto for paper execution. The venues and instruments differ; its paper orders do not reproduce a perpetual-futures backtest. The notebook needs its case-study artifacts and outbound data access, and paper submission needs credentials and explicit operator opt-in. The synthetic shadow quickstart is the local first run.
Learn the methods before deployment¶
- Framework parity is a related Backtest workflow that compares strategy behavior before a Live port. It does not import Live. Follow Backtest to Live.
- Safe model rollout teaches staged promotion and shadow evaluation manually. It does not import Live. Follow the Operator Guide.
- Circuit breakers teaches operational safety manually. It does not implement
SafeBroker. Follow Risk Controls. - Crypto financial features is a related feature workflow using Engineer. It does not import Live. Follow Backtest to Live.
- Crypto backtest simulates funding-aligned decisions manually. It does not import Live. Follow Backtest to Live.
- Crypto risk management studies sizing and risk manually. It does not import Live. Follow Risk Controls.
The case-study files use research data, model artifacts, and their own simulation assumptions.
LiveEngine needs a feed, venue capability check, broker account state, and explicit LiveRiskConfig.
Do not treat a research result as a qualified paper or live run.
Find the public interface¶
- Run lifecycle callbacks with
LiveEngineandThreadSafeBrokerWrapper: Backtest to Live. - Limit and audit orders with
LiveRiskConfig,SafeBroker,RiskState, andVirtualPortfolio: Risk Controls. - Connect
IBBrokerorAlpacaBroker: Brokers. - Choose
OKXFundingFeed,BarAggregator, or an experimental provider feed: Data Feeds. - Inspect or restart with
LiveEngine.runtime_statusandSafeBroker.reconciliation_report: Operator Guide.
See the API Reference for functions, classes, and options.