Searches for QuantConnect options data or LEAN custom data usually end at raw chains - every strike, every quote, and all of the assembly work still ahead of you. What LEAN backtests of dealer-positioning strategies actually need is the computed layer: net gamma exposure, the flip level, pin risk, VRP state, as they stood at each bar's timestamp. That layer is exactly what the bridge streams.
17
Endpoint families as native LEAN bar types
1 line
AddData call per data type, C# or Python
2017
Point-in-time replay start (SPY)
Install
# Python (self-hosted LEAN or QC Cloud project)
pip install flashalpha-quantconnect
# C#
dotnet add package FlashAlpha.QuantConnect
Both packages are official, MIT-licensed, CI-tested, and version-pinned to the underlying FlashAlpha SDK - if the API schema moves, the build breaks instead of your backtest silently drifting. Source: github.com/FlashAlpha-lab/flashalpha-quantconnect.
The bar families
| Family | C# bar class | Python | What lands in OnData |
| GEX | FlashAlphaGexBar | GexBar | Net GEX, per-strike gamma, flip level |
| DEX / VEX / CHEX | FlashAlphaDexBar ... | DexBar ... | Delta / vanna / charm exposure by strike |
| Exposure summary | FlashAlphaExposureSummaryBar | ExposureSummaryBar | Full dashboard: regime, flip, hedging estimates |
| Levels | FlashAlphaExposureLevelsBar | ExposureLevelsBar | Call wall, put wall, max-gamma strikes |
| Vol surface | FlashAlphaSurfaceBar | SurfaceBar | Smoothed IV grid |
| 0DTE | FlashAlphaZeroDteBar | ZeroDteBar | Pin risk, dealer hedging flow, expected move decay |
| Max pain / Volatility / VRP / Advanced vol / Narrative / quotes / universe | ... | The rest of the seventeen families |
A runnable dealer-regime algorithm
This is the bridge's own end-to-end test algorithm (lightly trimmed), which ships in the repo with a committed golden result file - long SPY in positive-gamma regimes, flat in negative:
from AlgorithmImports import *
from flashalpha_quantconnect import add_flashalpha_gex
class GexRegimeFollowing(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2024, 6, 3)
self.SetCash(100_000)
self._equity = self.AddEquity("SPY", Resolution.Daily).Symbol
self._gex = add_flashalpha_gex(self, "SPY").Symbol
def OnData(self, slice):
if not slice.ContainsKey(self._gex):
return
bar = slice[self._gex]
if bar is None or bar.NetGex is None:
return
# Long-gamma regime: dealers absorb vol. Short-gamma: they amplify it.
self.SetHoldings(self._equity, 1.0 if bar.NetGex > 0 else 0.0)
Whether that regime filter carries incremental information is a question we have tested honestly elsewhere - see the 8-year GEX backtest and its walk-forward validation before sizing anything on it. The point here is the plumbing: the signal arrives in OnData like any other bar, timestamped point-in-time by the Historical API, so research and live trading share one code path.
Research notebooks
You can see live response shapes before committing to any tier - a free key covers single-name GEX and levels.
QC research nodes allow outbound HTTP, so exploratory work can also hit the REST API directly - useful for endpoint families you want to eyeball before wiring bars:
import requests
r = requests.get("https://historical.flashalpha.com/v1/exposure/summary/SPY",
params={"at": "2024-08-05T15:30:00"},
headers={"X-Api-Key": API_KEY}).json()
r["regime"], r["gamma_flip"]
The essay collection
A companion repository, flashalpha-historical-examples, is being built in the open: a planned set of 21 LEAN backtest essays (gamma scalping first), each shipped side-by-side in C# and Python with lean.json configs and golden-file validation so every published number is regenerable. Star it if you want the essays as they land.
Access
The bridge reads the Historical API, which is an Alpha tier capability - point-in-time replay since 2017 (SPY from 2017-01-03), response shapes matching live with a few documented deltas. The packages themselves are free and open source. For the wider systematic stack, start with the complete quant backtesting guide and the flow replay article.
LEAN users have been assembling dealer-positioning data by hand for years; the bridge makes it a dependency instead of a project. One package install, one AddData line per family, golden-file schema pinning, and the same endpoints serve your live deployment when the backtest graduates. If you build something on it, the repos take issues and PRs - the integration is developed in the open.