-
Notifications
You must be signed in to change notification settings - Fork 11
docs: rewrite README for beta release #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,11 +18,13 @@ Each library addresses a distinct stage: data infrastructure, feature engineerin | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Deploying a backtested strategy to live markets requires careful handling of async broker connections, risk limits, and testing infrastructure. ml4t-live provides: | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - The same Strategy class used in ml4t-backtest works unchanged | ||||||||||||||||||||||||||||||||||
| - Shadow mode for testing without placing real orders | ||||||||||||||||||||||||||||||||||
| - Position and order limits with rate limiting | ||||||||||||||||||||||||||||||||||
| - Interactive Brokers integration via TWS/Gateway | ||||||||||||||||||||||||||||||||||
| - Thread-safe bridging between sync strategies and async brokers | ||||||||||||||||||||||||||||||||||
| - The same Strategy class used in ml4t-backtest works unchanged in production | ||||||||||||||||||||||||||||||||||
| - Two broker integrations: Interactive Brokers (TWS/Gateway) and Alpaca (stocks + crypto) | ||||||||||||||||||||||||||||||||||
| - Six data feeds: Alpaca, IB, Databento, CCXT (100+ crypto exchanges), OKX | ||||||||||||||||||||||||||||||||||
| - Shadow mode for testing without placing real orders (VirtualPortfolio tracking) | ||||||||||||||||||||||||||||||||||
| - 16-parameter risk configuration: position limits, order limits, loss limits, price protection | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
| - 16-parameter risk configuration: position limits, order limits, loss limits, price protection | |
| - Multi-parameter risk configuration: position limits, order limits, loss limits, price protection |
Copilot
AI
Mar 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example sets kill_switch_enabled=True, but SafeBroker.submit_order_async() treats kill_switch_enabled as an active kill switch and will immediately reject all orders. To document crash-safe persistence for drawdown-triggered kills, the example should not pre-enable the kill switch (instead configure max_drawdown_pct/state_file, and mention SafeBroker.enable_kill_switch() for manual activation).
| config = LiveRiskConfig( | |
| kill_switch_enabled=True, | |
| max_drawdown_pct=0.05, | |
| state_file=".ml4t_risk_state.json", # Atomic JSON writes | |
| ) | |
| # Configure crash-safe kill switch persistence | |
| config = LiveRiskConfig( | |
| max_drawdown_pct=0.05, | |
| state_file=".ml4t_risk_state.json", # Atomic JSON writes | |
| ) | |
| # Create a SafeBroker with this risk config | |
| safe_broker = SafeBroker(broker, config) | |
| # Optional: manually activate the kill switch (e.g., from an ops tool) | |
| safe_broker.enable_kill_switch() |
Copilot
AI
Mar 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the live snippet, calling LiveEngine(...).run() without await engine.connect() will raise RuntimeError("Call connect() before run()"). Update this example to show the required connect/run/stop lifecycle (similar to the Quick Start section).
| await LiveEngine(MyStrategy(), safe_broker, live_feed).run() | |
| engine = LiveEngine(MyStrategy(), safe_broker, live_feed) | |
| await engine.connect() | |
| try: | |
| await engine.run() | |
| finally: | |
| await engine.stop() |
Copilot
AI
Mar 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Safety Notice suggests setting kill_switch_enabled=True, but that flag makes the kill switch immediately active and will block all new orders. Consider recommending leaving it False initially (and relying on max_drawdown_pct activation), or calling SafeBroker.enable_kill_switch() when you actually want to halt trading.
| - Enable `kill_switch_enabled=True` with a reasonable `max_drawdown_pct` | |
| - Configure a reasonable `max_drawdown_pct` for the kill switch, and only enable it (for example via `SafeBroker.enable_kill_switch()`) when you explicitly intend to halt trading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intro bullet claims "Six data feeds" but only lists five (Alpaca, IB, Databento, CCXT, OKX). Either add the 6th item (e.g., BarAggregator) to the list or change the count to match the items listed.