Coming from QuantConnect
Forge API 1Updated 1 Oct 2026
What is the same
A LEAN algorithm is a class with event handlers. A Forge strategy is a class too, and compute returns signals for every bar at once, with optional hooks for events. Both are Python.
What is different
- Data arrives as arrays. LEAN calls
OnDatawith a slice for each bar. Forge handscomputethe whole history as arrays, and the engine applies the signals. - Indicators are functions. LEAN registers an indicator and feeds it through a consolidator. Forge calls
ta.rsi(close, period)on an array, and a slower series isd.tf("H4"). - Warm-up is declared. An indicator states its own warm-up, and a strategy does not trade on values that are still missing.
- Time is UTC. LEAN's clock follows the time zone you set.
The traps page lists the mistakes that cost the most.
Where to start
Read From LEAN first, then warm-up and broker time and the trading day. Then write your first indicator.
LEAN names, in Forge
A short list. A full table for LEAN is not written yet.
self.rsiforge.ta.rsiself.smaforge.ta.smaself.emaforge.ta.emainitializeforge.strategy.Strategyon_dataforge.strategy.Strategyset_holdingsforge.types.Contextself.debugforge.types.Context