Add Tradovate brokerage model and fee model
Summary
Closes #9136 I'd like to contribute Tradovate brokerage support to LEAN. Tradovate is a popular futures broker, especially among prop firm traders using platforms like Apex Trader Funding, TopStep, and others that are backed by Tradovate infrastructure.
What's Included
This PR to LEAN (models only):
-
TradovateBrokerageModel- Order type and security type validation -
TradovateFeeModel- Per-contract fee structure (micro/e-mini/standard) -
BrokerageName.Tradovateenum value - 30 unit tests
Separate brokerage implementation repository:
- Full brokerage implementation with 88 unit tests
- REST API client for order placement/modification/cancellation
- WebSocket client for real-time order updates
- OAuth and API key authentication with automatic token refresh
- Symbol mapping for CME futures contracts
- WebSocket reconnection with exponential backoff
Supported Features
Market orders Limit orders Stop orders Stop-limit orders Trailing stop orders (native Tradovate support) Order modifications Order cancellation Partial fill handling Multiple sub-accounts Demo & Live environments
Known Limitations
Execution-only brokerage - No market data streaming or historical data.
Reason: CME requires a sub-vendor license ($290-375/month per exchange) for API market data distribution. Since Tradovate is popular with budget-conscious prop firm traders, this cost is prohibitive for most users. The brokerage is designed to work with separate data feeds (IQFeed, Databento, QuantConnect Cloud data, etc.).
Fee Structure
Based on Tradovate's published commission schedule:
- Micro futures (MYM, MES, MNQ, M2K, MCL, MGC): $0.79/contract
- E-mini futures (YM, ES, NQ, RTY): $1.29/contract
- Standard futures (ZB, ZN, CL, GC, SI): $1.79/contract
Testing
- TradovateBrokerageModel: 15 tests
- TradovateFeeModel: 15 tests
- Brokerage implementation: 88 tests
- Live tested with Tradovate demo account (trailing stops, order lifecycle)
Related
- Tradovate API documentation: https://tradovate.com/blog/tradovate-api/
- Implementation repository: https://github.com/adamoverton/qc-tradovate-brokerage
Note: The tradovate brokerage implementation is here: https://github.com/adamoverton/qc-tradovate-brokerage