Skip to content

Conversation

@adamoverton
Copy link

@adamoverton adamoverton commented Dec 17, 2025

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.Tradovate enum 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

Add support for Tradovate futures brokerage:

- TradovateBrokerageModel: Validates order types (Market, Limit, Stop,
  StopLimit, TrailingStop) and security types (Future, FutureOption)
- TradovateFeeModel: Per-contract fees based on contract type
  - Micro futures: $0.79/contract (MYM, MES, MNQ, M2K, MCL, MGC, etc.)
  - E-mini futures: $1.29/contract (YM, ES, NQ, RTY)
  - Standard futures: $1.79/contract (ZB, ZN, CL, GC, etc.)
- BrokerageName.Tradovate enum value

Includes 30 unit tests for both models.

The brokerage implementation itself will be in a separate
Lean.Brokerages.Tradovate repository.
@adamoverton
Copy link
Author

Note: The tradovate brokerage implementation is here: https://github.com/adamoverton/qc-tradovate-brokerage

- Update all projects to target net10.0
- Add Demonstration.cs for testing DataBento data provider
- Add DataLibraries/ to .gitignore (build artifacts)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Tradovate Brokerage Support for Futures Trading

1 participant