tradingview-gex-flashalpha 0.0.0-stage → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +323 -0
- package/LICENSE +21 -0
- package/README.md +1103 -2
- package/dist/tradingview-gex-flashalpha.cjs +3722 -0
- package/dist/tradingview-gex-flashalpha.css +2 -0
- package/dist/tradingview-gex-flashalpha.js +3696 -0
- package/dist/tradingview-gex-flashalpha.min.js +52 -0
- package/dist/tradingview-gex-flashalpha.mjs +3701 -0
- package/embed.js +116 -0
- package/package.json +97 -4
- package/types/index.d.ts +460 -0
package/README.md
CHANGED
|
@@ -1,3 +1,1104 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://flashalpha.com/?utm_source=github&utm_medium=readme&utm_campaign=tradingview-gex-flashalpha">
|
|
3
|
+
<img src="assets/flashalpha-logo.png" alt="FlashAlpha" width="140">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
<h1 align="center">TradingView GEX by FlashAlpha</h1>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<strong>Options gamma exposure (GEX) indicators drawn on a live candlestick chart: call wall, put wall, gamma flip, max pain, 0DTE magnet, net GEX, strike heatmap and GEX profile.</strong><br>
|
|
11
|
+
Data from the <a href="https://flashalpha.com/?utm_source=github&utm_medium=readme&utm_campaign=tradingview-gex-flashalpha">FlashAlpha</a> options analytics API. Built on TradingView Lightweight Charts™.
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="https://www.npmjs.com/package/tradingview-gex-flashalpha"><img src="https://img.shields.io/npm/v/tradingview-gex-flashalpha.svg" alt="npm version"></a>
|
|
16
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT license"></a>
|
|
17
|
+
<a href="https://github.com/tradingview/lightweight-charts"><img src="https://img.shields.io/badge/Lightweight%20Charts-5.3.0-26a69a.svg" alt="Built on TradingView Lightweight Charts 5.3.0"></a>
|
|
18
|
+
<img src="https://img.shields.io/badge/types-TypeScript-blue" alt="TypeScript types">
|
|
19
|
+
<img src="https://img.shields.io/badge/data-FlashAlpha%20API-4f8cff.svg" alt="Data from the FlashAlpha API">
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
<p align="center">
|
|
23
|
+
<img src="assets/gex-levels-walls-gamma-flip.png" alt="SPY 1-hour candlestick chart with FlashAlpha GEX Levels: call wall, put wall, gamma flip and max pain lines, the gamma regime tint behind the candles and a net GEX pane under the price" width="900">
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
<p align="center">
|
|
27
|
+
<strong><a href="https://flashalpha-lab.github.io/tradingview-gex-flashalpha/">Live demo</a></strong> ·
|
|
28
|
+
<a href="#indicators-at-a-glance">Indicators</a> ·
|
|
29
|
+
<a href="#add-the-chart-to-your-site-in-one-line">Embed in one line</a> ·
|
|
30
|
+
<a href="#install-from-npm">npm install</a> ·
|
|
31
|
+
<a href="https://flashalpha.com/pricing?utm_source=github&utm_medium=readme&utm_campaign=tradingview-gex-flashalpha">Free API key</a> ·
|
|
32
|
+
<a href="#faq">FAQ</a>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
**TradingView GEX by FlashAlpha** puts options dealer positioning on the price chart. Its indicators turn FlashAlpha's
|
|
36
|
+
gamma exposure (GEX) data into lines, shading and panes on a TradingView-style candlestick chart, bar by bar and on the
|
|
37
|
+
same time axis as the candles. You see where the call wall and put wall sit, which side of the gamma flip the price is
|
|
38
|
+
on, and which strikes hold the most dealer gamma, without leaving the chart.
|
|
39
|
+
|
|
40
|
+
The chart is open source and built on
|
|
41
|
+
[TradingView Lightweight Charts™](https://github.com/tradingview/lightweight-charts). The indicators read the FlashAlpha
|
|
42
|
+
chart API with your FlashAlpha API key.
|
|
43
|
+
|
|
44
|
+
**In short**
|
|
45
|
+
|
|
46
|
+
- **What it shows:** call wall, put wall, gamma flip, max pain, 0DTE magnet, gamma regime, net GEX, net GEX per strike
|
|
47
|
+
(heatmap and profile) and per expiration, delta / vanna / charm exposure, the expected move, what the price did at the
|
|
48
|
+
levels, the 0DTE hedging flow, and 0DTE metrics such as the pin score.
|
|
49
|
+
- **Where:** US stocks, ETFs and indices such as SPX, SPY, QQQ, AAPL, MSFT and TSLA, from 1-minute to weekly bars.
|
|
50
|
+
- **How:** one `<div>` and one `<script>` tag on any website, or `npm install tradingview-gex-flashalpha` and
|
|
51
|
+
`mount(el, { symbol: 'SPX' })` in your app.
|
|
52
|
+
- **Cost:** the chart is free and open source. Data needs a FlashAlpha API key; the free plan shows the candles, and GEX
|
|
53
|
+
indicators start on the Basic plan.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Table of contents
|
|
58
|
+
|
|
59
|
+
- [Why GEX on the price chart?](#why-gex-on-the-price-chart)
|
|
60
|
+
- [Indicators at a glance](#indicators-at-a-glance)
|
|
61
|
+
- [1. GEX Levels: call wall, put wall, gamma flip, max pain, 0DTE magnet](#1-gex-levels-call-wall-put-wall-gamma-flip-max-pain-0dte-magnet)
|
|
62
|
+
- [2. Net GEX pane](#2-net-gex-pane)
|
|
63
|
+
- [3. Strike heatmap and GEX profile](#3-strike-heatmap-and-gex-profile)
|
|
64
|
+
- [4. Greeks exposure and 0DTE metrics pane](#4-greeks-exposure-and-0dte-metrics-pane)
|
|
65
|
+
- [5. 0DTE scope and live open interest](#5-0dte-scope-and-live-open-interest)
|
|
66
|
+
- [6. Expected move](#6-expected-move)
|
|
67
|
+
- [7. Expiry heatmap](#7-expiry-heatmap)
|
|
68
|
+
- [8. Level events](#8-level-events)
|
|
69
|
+
- [9. 0DTE hedging flow](#9-0dte-hedging-flow)
|
|
70
|
+
- [Chart features](#chart-features)
|
|
71
|
+
- [Which plan unlocks which indicator?](#which-plan-unlocks-which-indicator)
|
|
72
|
+
- [Add the chart to your site in one line](#add-the-chart-to-your-site-in-one-line)
|
|
73
|
+
- [Install from npm](#install-from-npm)
|
|
74
|
+
- [How do I add my FlashAlpha API key?](#how-do-i-add-my-flashalpha-api-key)
|
|
75
|
+
- [Use without a bundler](#use-without-a-bundler)
|
|
76
|
+
- [Framework examples](#framework-examples)
|
|
77
|
+
- [Options](#options)
|
|
78
|
+
- [Methods](#methods)
|
|
79
|
+
- [Several charts (layouts)](#several-charts-layouts)
|
|
80
|
+
- [Events](#events)
|
|
81
|
+
- [Core layers and FlashAlpha layers](#core-layers-and-flashalpha-layers)
|
|
82
|
+
- [Keep your API key safe](#keep-your-api-key-safe)
|
|
83
|
+
- [Use your own data](#use-your-own-data)
|
|
84
|
+
- [Add layers](#add-layers)
|
|
85
|
+
- [Who uses GEX indicators?](#who-uses-gex-indicators)
|
|
86
|
+
- [FAQ](#faq)
|
|
87
|
+
- [About FlashAlpha](#about-flashalpha)
|
|
88
|
+
- [Development](#development)
|
|
89
|
+
- [License, trademarks and disclaimer](#license-trademarks-and-disclaimer)
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Why GEX on the price chart?
|
|
94
|
+
|
|
95
|
+
**Gamma exposure (GEX)** estimates how much options market makers (dealers) must buy or sell the underlying to stay
|
|
96
|
+
delta-hedged as the price moves. It is computed from open interest and each option's gamma, strike by strike.
|
|
97
|
+
|
|
98
|
+
- When dealers are **long gamma** (positive GEX), they sell rallies and buy dips. Moves tend to be **dampened** and the
|
|
99
|
+
price often pins near large strikes.
|
|
100
|
+
- When dealers are **short gamma** (negative GEX), they buy rallies and sell dips. Moves tend to be **amplified** and
|
|
101
|
+
ranges widen.
|
|
102
|
+
|
|
103
|
+
Most GEX tools show a bar chart by strike for one moment. TradingView GEX by FlashAlpha draws the same information **over
|
|
104
|
+
time, on the candles**, so you can see how the levels moved during the session, where the price reacted to them, and
|
|
105
|
+
whether the regime changed. That makes the context usable for intraday trading, 0DTE options and risk planning.
|
|
106
|
+
|
|
107
|
+
The levels are model estimates from open interest, not observed dealer positions. The theory and the math are in
|
|
108
|
+
[gex-explained](https://github.com/FlashAlpha-lab/gex-explained).
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Indicators at a glance
|
|
113
|
+
|
|
114
|
+
| Indicator | What it draws | Main benefit | Lowest plan |
|
|
115
|
+
|---|---|---|---|
|
|
116
|
+
| [GEX Levels](docs/indicators/gex-levels.md) | Call wall, put wall, gamma flip and max pain lines, the 0DTE magnet, the gamma regime tint and the previous session's levels | Key support, resistance and regime levels from options positioning, right on the price | Basic |
|
|
117
|
+
| [Net GEX](docs/indicators/net-gex.md) | Net dealer gamma in dollars as a line around zero in a pane under the price | See at a glance when dealers switch from dampening to amplifying moves | Basic |
|
|
118
|
+
| [Strike heatmap and GEX profile](docs/indicators/gex-by-strike.md) | Net GEX per strike behind the candles, and as bars at the right edge; each can show delta, vanna or charm instead | Find the strikes that attract, stall or accelerate the price | Growth |
|
|
119
|
+
| [Expiry heatmap](docs/indicators/expiry-heatmap.md) | A strike × expiration grid in a panel beside the chart, with totals per strike and per expiration | Know which expiry a wall comes from, and what each expiration takes away | Growth |
|
|
120
|
+
| [Greeks and 0DTE metrics](docs/indicators/metrics-pane.md) | A pane for delta, vanna or charm exposure, or a 0DTE metric such as pin score, IV ratio, VIX or dealer hedge per ±1 % | Track the forces behind the levels, minute by minute | Basic (Greeks), Growth (metrics) |
|
|
121
|
+
| [0DTE scope and live OI](docs/indicators/0dte-and-live-oi.md) | The same indicators computed on today's expiry only, or on open interest updated with today's flow | Same-day options context for 0DTE traders | Growth (0DTE), Alpha (live OI) |
|
|
122
|
+
| [Expected move](docs/indicators/expected-move.md) | The options-implied 1σ range of each session from its open, green above and red below | The range the options market expects today, and how often the price stayed inside it | Growth |
|
|
123
|
+
| [Level events](docs/indicators/level-events.md) | Markers where the price was rejected at a level, broke it or crossed the flip; regime flips; OPEX, earnings and OI change days | See which levels held and which broke, as it happened | Growth |
|
|
124
|
+
| [0DTE hedging flow](docs/indicators/0dte-hedging-flow.md) | The stock dealers had to buy or sell since the open to hedge today's 0DTE trades, in a pane under the price | Who is pushing the price, and whether a move has hedging behind it | Growth |
|
|
125
|
+
|
|
126
|
+
Every indicator above is in the chart's **Indicators** menu, whatever your plan; the metrics pane is a
|
|
127
|
+
setting of Net GEX, the 0DTE scope and live open interest are settings of GEX Levels. A layer above your plan shows a
|
|
128
|
+
lock and the plan it needs.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## 1. GEX Levels: call wall, put wall, gamma flip, max pain, 0DTE magnet
|
|
133
|
+
|
|
134
|
+
The core indicator. It draws the levels options traders watch most, bar by bar through the session.
|
|
135
|
+
|
|
136
|
+
| Level | What it is | How traders use it |
|
|
137
|
+
|---|---|---|
|
|
138
|
+
| **Call wall** (green, solid) | The strike at or above spot with the largest call positioning | Often acts as resistance: dealer hedging tends to slow rallies into it |
|
|
139
|
+
| **Put wall** (red, solid) | The strike at or below spot with the largest put positioning | Often acts as support: dealer hedging tends to slow sell-offs into it |
|
|
140
|
+
| **Gamma flip** (amber, dashed) | The price where net dealer gamma changes sign | The line between the calm regime (above) and the volatile regime (below) |
|
|
141
|
+
| **Max pain** (violet, dashed) | The strike where open options lose the most value at expiry | A pull toward expiry, most visible on expiration days |
|
|
142
|
+
| **0DTE magnet** (pink, dashed) | The same-day strike the price is most drawn to | An intraday target on days with heavy 0DTE positioning |
|
|
143
|
+
|
|
144
|
+
**Benefits**
|
|
145
|
+
|
|
146
|
+
- **Levels on the candles, not in a separate table.** Each level is drawn per bar, so you see exactly when a wall moved
|
|
147
|
+
and how the price behaved at it.
|
|
148
|
+
- **Gamma regime at a glance.** The background is tinted green above the gamma flip (positive gamma, moves tend to
|
|
149
|
+
dampen) and red below it (negative gamma, moves tend to amplify).
|
|
150
|
+
- **Distance from spot in the legend.** For example `Call wall 730.00 (+1.0%) (−45.00)`: the level, its distance from
|
|
151
|
+
spot and its change since the previous session. The legend also names the regime, for example
|
|
152
|
+
`Regime −γ (dealers amplify moves)`.
|
|
153
|
+
- **Never lose an off-screen level.** A level outside the visible range is pinned to the chart edge with its distance,
|
|
154
|
+
for example `▲ Call wall 8,000.00 (+11.5%)`.
|
|
155
|
+
- **Know how fresh the levels are.** The legend ends with `As of 11:59 ET`; during a session, levels more than 10 minutes
|
|
156
|
+
behind the candles turn amber: `As of 11:40 ET (delayed 15 min)`.
|
|
157
|
+
- **Broken-wall alerts (optional).** When a candle closes through a wall, the wall fades for the rest of the session and
|
|
158
|
+
a marker such as `Put wall broken 10:30` appears on the bar.
|
|
159
|
+
- **Previous-session levels.** On daily and weekly bars, each session shows the prior close's levels as dashed lines.
|
|
160
|
+
- **Session focus.** Hover a session and the other sessions fade, so one day's levels and candles stand out.
|
|
161
|
+
- **Your colours.** Colour, width, line style, price line and axis label per level, like TradingView's Style tab.
|
|
162
|
+
|
|
163
|
+
Read more: [GEX Levels](docs/indicators/gex-levels.md).
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## 2. Net GEX pane
|
|
168
|
+
|
|
169
|
+
<p align="center">
|
|
170
|
+
<img src="assets/gex-strike-heatmap-net-gex-pane.png" alt="Net GEX pane under a SPY 1-hour chart: net dealer gamma exposure in dollars, green above zero and red below zero, with the strike heatmap behind the candles" width="900">
|
|
171
|
+
</p>
|
|
172
|
+
|
|
173
|
+
Net dealer gamma exposure in dollars, drawn as a line around zero in its own pane under the price: green above zero,
|
|
174
|
+
red below.
|
|
175
|
+
|
|
176
|
+
**Benefits**
|
|
177
|
+
|
|
178
|
+
- **Regime changes are obvious.** A cross below zero tells you dealers have turned short gamma and moves may speed up.
|
|
179
|
+
- **Size, not only sign.** A net GEX of +$5B and one of +$200M mean very different market behaviour; the pane shows both.
|
|
180
|
+
- **Change since the previous session** in the legend, for example `Net GEX −$5.49B (+$3.80B)`.
|
|
181
|
+
- **Sessions kept apart.** The line is cut between sessions, and hovering a session fades the others.
|
|
182
|
+
|
|
183
|
+
Read more: [Net GEX](docs/indicators/net-gex.md).
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## 3. Strike heatmap and GEX profile
|
|
188
|
+
|
|
189
|
+
<p align="center">
|
|
190
|
+
<img src="assets/gex-by-strike-heatmap-profile.png" alt="SPY 1-hour chart with the strike heatmap and the GEX profile: net GEX per strike as a heatmap behind the candles and as horizontal bars at the right edge, green for long gamma strikes and red for short gamma strikes" width="900">
|
|
191
|
+
</p>
|
|
192
|
+
|
|
193
|
+
The full options positioning by strike, on the price axis, in two indicators.
|
|
194
|
+
|
|
195
|
+
- **Strike heatmap:** net GEX per strike behind the candles, for every bar. Green strikes are long gamma, red strikes
|
|
196
|
+
short gamma; stronger colour means more gamma. The 8 largest strikes stand out and far-away strikes fade, so the chart
|
|
197
|
+
stays readable. Hover a strike to read its value, for example `Strike 727: Net GEX −$111.6M`.
|
|
198
|
+
- **GEX profile:** net GEX per strike as horizontal bars at the right edge of the chart, for the latest snapshot or the
|
|
199
|
+
bar under your cursor. Small ticks show where each strike stood 15 minutes earlier; the legend gives the value of a
|
|
200
|
+
full bar, for example `GEX profile: full bar $3.16B`.
|
|
201
|
+
- **Lenses:** switch each from **gamma (GEX)** to **delta (DEX)**, **vanna (VEX)** or **charm (CHEX)** exposure per strike.
|
|
202
|
+
|
|
203
|
+
**Benefits**
|
|
204
|
+
|
|
205
|
+
- **See where liquidity sits.** Large long-gamma strikes tend to slow the price; large short-gamma strikes can let it run.
|
|
206
|
+
- **Watch positioning change during the day.** The heatmap shows a strike building or fading over time, not only now.
|
|
207
|
+
- **Compare with 15 minutes ago.** The profile's ticks reveal which strikes are gaining or losing gamma right now.
|
|
208
|
+
- **One chart, four Greeks.** Vanna shows sensitivity to implied volatility, charm the drift into the close, delta the
|
|
209
|
+
directional hedge.
|
|
210
|
+
|
|
211
|
+
Read more: [Strike heatmap and GEX profile](docs/indicators/gex-by-strike.md).
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## 4. Greeks exposure and 0DTE metrics pane
|
|
216
|
+
|
|
217
|
+
<p align="center">
|
|
218
|
+
<img src="assets/0dte-magnet-atm-iv-pane.png" alt="SPY 1-hour chart with the 0DTE magnet on the candles, the net GEX pane and a 0DTE ATM IV metric pane under it" width="900">
|
|
219
|
+
</p>
|
|
220
|
+
|
|
221
|
+
A pane under the price for one exposure or metric, minute by minute. Pick it in the **Metric pane** setting of the Net GEX
|
|
222
|
+
indicator.
|
|
223
|
+
|
|
224
|
+
| Metric | What it tells you | Plan |
|
|
225
|
+
|---|---|---|
|
|
226
|
+
| Delta (net DEX) | The directional hedge dealers hold | Basic |
|
|
227
|
+
| Vanna (net VEX) | How dealer hedging changes when implied volatility moves | Basic |
|
|
228
|
+
| Charm (net CHEX) | How dealer hedging drifts with time, strongest into the close and expiry | Basic |
|
|
229
|
+
| 0DTE pin score | How likely the price is to pin near a strike today | Growth |
|
|
230
|
+
| 0DTE move left (±$) | The 1σ move the market still prices for today | Growth |
|
|
231
|
+
| 0DTE ATM IV, IV ratio 0DTE / 7DTE, 25Δ skew, VIX | Volatility context for same-day options | Growth |
|
|
232
|
+
| 0DTE net GEX, 0DTE share of GEX, 0DTE put/call volume, 0DTE net theta | How much of the day is driven by same-day options | Growth |
|
|
233
|
+
| Distance to flip (σ) | How far the price is from the gamma flip, in standard deviations | Growth |
|
|
234
|
+
| Dealer hedge if +1 % / −1 % ($) | The notional dealers would buy or sell on a 1 % move | Growth |
|
|
235
|
+
|
|
236
|
+
**Benefits:** the forces behind the levels, on the same time axis as the price. Spot a rising pin score into the
|
|
237
|
+
afternoon, a vanna build before an event, or a hedge estimate that grows as the price nears the flip.
|
|
238
|
+
|
|
239
|
+
Read more: [Greeks and 0DTE metrics](docs/indicators/metrics-pane.md).
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## 5. 0DTE scope and live open interest
|
|
244
|
+
|
|
245
|
+
Two settings in the options of GEX Levels change what every indicator is computed on:
|
|
246
|
+
|
|
247
|
+
- **Expiries: All or 0DTE.** With 0DTE, the walls, flip, magnet, heatmap and profile use today's expiry only. (Growth)
|
|
248
|
+
- **Open interest: Settled or Live.** Live adds today's option flow to the last settled open interest, so the levels
|
|
249
|
+
follow positioning during the session instead of waiting for tomorrow's update. (Alpha)
|
|
250
|
+
|
|
251
|
+
**Benefits:** same-day options now drive a large share of index volume. The 0DTE scope shows the levels that matter
|
|
252
|
+
**today**, and live open interest keeps them current as new positions open.
|
|
253
|
+
|
|
254
|
+
Read more: [0DTE scope and live OI](docs/indicators/0dte-and-live-oi.md).
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## 6. Expected move
|
|
259
|
+
|
|
260
|
+
The move the options market prices in for each session, drawn from the session's 9:30 ET open: **+1σ** dotted light green,
|
|
261
|
+
**−1σ** dotted light red, and the band between them filled faintly. On weekly bars the band is
|
|
262
|
+
the week's.
|
|
263
|
+
|
|
264
|
+
**Benefits**
|
|
265
|
+
|
|
266
|
+
- **A frame for the day.** About 2 sessions in 3 close inside ±1σ: targets and stops next to the range options expect.
|
|
267
|
+
- **How reliable it was.** The legend counts the finished sessions in view that stayed inside, for example
|
|
268
|
+
`Inside 14/20 (70%)`.
|
|
269
|
+
- **Hover a bar** for nodes on its close and on the band, and a box with the close in σ from the open and the distance
|
|
270
|
+
to +1σ and −1σ.
|
|
271
|
+
- **Pairs with the GEX levels.** A test of +1σ under positive gamma often stalls; under negative gamma it often breaks.
|
|
272
|
+
|
|
273
|
+
Read more: [Expected move](docs/indicators/expected-move.md).
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## 7. Expiry heatmap
|
|
278
|
+
|
|
279
|
+
The options positioning near the price, split by expiration: a grid in a panel beside the chart (under it on a phone),
|
|
280
|
+
a row per strike and a column per expiration, each cell coloured by its net GEX, or by delta, vanna or charm exposure.
|
|
281
|
+
|
|
282
|
+
**Benefits**
|
|
283
|
+
|
|
284
|
+
- **Know how long a level lasts.** A wall built on 0DTE options is gone after today's close; one on the monthly OPEX lasts.
|
|
285
|
+
- **See what an expiration takes away.** A total per expiration, with its share of the whole, and a total per strike.
|
|
286
|
+
- **Tied to the chart.** `CW`, `PW`, `0DTE` and `MP` tag the strikes of the levels drawn on the candles; lines mark the
|
|
287
|
+
price and the gamma flip.
|
|
288
|
+
- **At hand.** Lens, strikes shown (20, 30 or 50) and values in cells in the panel's header; fold the panel to a tab.
|
|
289
|
+
|
|
290
|
+
Read more: [Expiry heatmap](docs/indicators/expiry-heatmap.md).
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## 8. Level events
|
|
295
|
+
|
|
296
|
+
Markers on the candles for what the price did at the GEX levels, from 1-minute bars: **▼ / ▲** rejected at a level
|
|
297
|
+
(resistance / support), **■** broken, **●** gamma flip crossed, **+γ / −γ** dealers' gamma changed sign and held. Each
|
|
298
|
+
marker names its level (CW, PW, 0DTE, MP, Flip). Day markers flag OPEX, earnings, expiry rolls and the largest open
|
|
299
|
+
interest change.
|
|
300
|
+
|
|
301
|
+
**Benefits**
|
|
302
|
+
|
|
303
|
+
- **Which levels held.** The legend counts it per level, for example `PW held 10/13`.
|
|
304
|
+
- **Readable.** The 0DTE magnet's events are off by default (it is touched many times a day); zoomed out, the markers show
|
|
305
|
+
their shapes only.
|
|
306
|
+
- **Hover a bar** for its events, the minute of each and the wall's strength.
|
|
307
|
+
- **Breaks with context:** with the 0DTE hedging flow on, a break says whether the flow went with the move or against it.
|
|
308
|
+
|
|
309
|
+
Read more: [Level events](docs/indicators/level-events.md).
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## 9. 0DTE hedging flow
|
|
314
|
+
|
|
315
|
+
An estimate of the stock dealers had to buy (above zero, blue) or sell (below zero, orange) since the 9:30 ET open to hedge
|
|
316
|
+
the options on today's expiry traded today, in a pane under the price, with the flow of each bar as a histogram.
|
|
317
|
+
|
|
318
|
+
**Benefits**
|
|
319
|
+
|
|
320
|
+
- **Who is pushing.** The slope shows hedging that adds buying or selling pressure.
|
|
321
|
+
- **Divergences.** **Div** markers where the price makes a new session high (low) with less hedging behind it.
|
|
322
|
+
- **Calls and puts.** The two legs of the total, on request.
|
|
323
|
+
- **Comparable across symbols.** In **% move** units the flow is set against the session's 0DTE gamma.
|
|
324
|
+
|
|
325
|
+
Read more: [0DTE hedging flow](docs/indicators/0dte-hedging-flow.md).
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Chart features
|
|
330
|
+
|
|
331
|
+
The indicators run on a full TradingView-style chart:
|
|
332
|
+
|
|
333
|
+
- **Candles and volume** from 1-minute to weekly bars, regular or extended hours, on a US Eastern time axis.
|
|
334
|
+
- **TradingView-style legend:** each indicator's line starts with its title, with hide, options and remove buttons (on
|
|
335
|
+
a touch screen the Indicators menu does those).
|
|
336
|
+
- **Indicators menu** with options per layer: colours, line widths, line styles, price lines and axis labels.
|
|
337
|
+
- **Laid out like TradingView:** a chart type menu next to Indicators (candles, hollow candles, bars, line, area,
|
|
338
|
+
baseline, Heikin Ashi); **%**, **log** and **auto** price scale buttons at the right of the time bar; and Settings in
|
|
339
|
+
sections: Appearance (theme, grid lines, watermark), Scales (regular, logarithmic, percent or indexed to 100; left or
|
|
340
|
+
right; auto scale; invert; price label and last price line), Crosshair (free, magnet on the close or on OHLC, hidden)
|
|
341
|
+
and Status line (legend, volume).
|
|
342
|
+
- **Layouts:** one to four charts side by side, each with its own interval and indicators (19 layouts).
|
|
343
|
+
- **Auto-refresh** every 60 seconds, and optional live streaming of candles and levels over WebSocket (the `live`
|
|
344
|
+
option).
|
|
345
|
+
- **More history as you drag** to the left edge of the chart.
|
|
346
|
+
- **Symbol search, date ranges, full screen, screenshot, light and dark themes, phone layout.**
|
|
347
|
+
- **Framework-free:** plain JavaScript for React, Vue, Angular, Svelte or a single HTML page. Its CSS never restyles your
|
|
348
|
+
page (every rule sits under its own `fac-` classes).
|
|
349
|
+
- **npm package:** ES module, CommonJS and script-tag builds, a separate style sheet, and TypeScript declarations.
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## Which plan unlocks which indicator?
|
|
354
|
+
|
|
355
|
+
| FlashAlpha plan | What the chart shows |
|
|
356
|
+
|---|---|
|
|
357
|
+
| **Free** | Candles and volume |
|
|
358
|
+
| **Basic** | GEX Levels (call wall, put wall, gamma flip, max pain, 0DTE magnet), Net GEX pane, delta / vanna / charm exposure panes |
|
|
359
|
+
| **Growth** | Basic, plus the strike heatmap, the GEX profile and the expiry heatmap with GEX / DEX / VEX / CHEX lenses, the expected move, level events, the 0DTE hedging flow, the 0DTE scope, and 0DTE and volatility metrics |
|
|
360
|
+
| **Alpha** | Growth, plus the live open interest basis |
|
|
361
|
+
|
|
362
|
+
The chart reads the plan from your API key; you do not set it. The API enforces the plan; the chart only shows it. Prices
|
|
363
|
+
and daily request limits are on the
|
|
364
|
+
[FlashAlpha pricing page](https://flashalpha.com/pricing?utm_source=github&utm_medium=readme&utm_campaign=tradingview-gex-flashalpha).
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## Add the chart to your site in one line
|
|
369
|
+
|
|
370
|
+
1. [Create a free FlashAlpha account](https://flashalpha.com/pricing?utm_source=github&utm_medium=readme&utm_campaign=get_api_key)
|
|
371
|
+
and copy your API key from your [profile](https://flashalpha.com/profile?utm_source=github&utm_medium=readme&utm_campaign=get_api_key).
|
|
372
|
+
2. Add a `div` and the embed script:
|
|
373
|
+
|
|
374
|
+
```html
|
|
375
|
+
<div data-flashalpha-chart
|
|
376
|
+
data-symbol="SPY"
|
|
377
|
+
data-resolution="5m"
|
|
378
|
+
data-layers="levels,maxpain,netgex"
|
|
379
|
+
style="height: 520px"></div>
|
|
380
|
+
|
|
381
|
+
<script async src="https://charts.flashalpha.com/embed.js" data-key="YOUR_FLASHALPHA_API_KEY"></script>
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
The script loads Lightweight Charts, the chart and the FlashAlpha indicators from the chart host, then draws every
|
|
385
|
+
element that has `data-flashalpha-chart`. A full page is in [`examples/embed.html`](examples/embed.html). If your page
|
|
386
|
+
adds charts after it loads, for example in a single-page app, call `FlashAlphaEmbed.scan()`.
|
|
387
|
+
|
|
388
|
+
| Layer ID for `data-layers` | Indicator |
|
|
389
|
+
|---|---|
|
|
390
|
+
| `levels` | GEX Levels: call wall, put wall, gamma flip |
|
|
391
|
+
| `maxpain` | GEX Levels: max pain |
|
|
392
|
+
| `magnet` | GEX Levels: 0DTE magnet |
|
|
393
|
+
| `netgex` | Net GEX pane |
|
|
394
|
+
| `heatmap` | Strike heatmap |
|
|
395
|
+
| `profile` | GEX profile |
|
|
396
|
+
| `expiries` | Expiry heatmap |
|
|
397
|
+
| `em` | Expected move |
|
|
398
|
+
| `events` | Level events |
|
|
399
|
+
| `hedgeflow` | 0DTE hedging flow |
|
|
400
|
+
|
|
401
|
+
| Attribute | Default | Description |
|
|
402
|
+
|---|---|---|
|
|
403
|
+
| `data-symbol` | Required | Ticker, for example `SPX` or `SPY`. |
|
|
404
|
+
| `data-key` | The script tag's `data-key` | FlashAlpha API key for this chart. |
|
|
405
|
+
| `data-resolution` | `5m` | One of `1m`, `5m`, `15m`, `1h`, `1d`, `1w`. |
|
|
406
|
+
| `data-range` | Depends on resolution | Days to show, or `1D`, `5D`, `1M`, `6M`, `1Y`. |
|
|
407
|
+
| `data-theme` | `dark` | `dark`, `light`, or `auto`. |
|
|
408
|
+
| `data-upgrade-url` | FlashAlpha pricing | Where locked layers and the Upgrade button link. |
|
|
409
|
+
| `data-layers` | None | Comma-separated layer IDs from the table above. Without it the chart opens with price and volume; the reader's picks are remembered. |
|
|
410
|
+
| `data-session` | `rth` | `rth` for regular hours, `eth` to add pre-market and after-hours. |
|
|
411
|
+
| `data-controls` | `true` | `false` hides the toolbar. |
|
|
412
|
+
| `data-background` | `#0f1115` | Chart background color, used with the theme of its kind (see `background` under [Options](#options)). |
|
|
413
|
+
| `data-refresh` | `60` | Seconds between refreshes while the page is visible. `0` turns refresh off. |
|
|
414
|
+
| `data-base` | The script's host | Chart API root URL, for example when you use a proxy. |
|
|
415
|
+
|
|
416
|
+
On the `<script>` tag, `data-key` sets the key for every chart on the page, `data-layer-bundle="false"` skips the
|
|
417
|
+
FlashAlpha layers (GEX Levels only), and `data-debug="true"` shows load status. Lightweight Charts 5.3.0 is loaded from
|
|
418
|
+
the chart host, not a CDN. A copy the page already has is used only when it is the same version; otherwise the charts get
|
|
419
|
+
their own copy and the page keeps its `window.LightweightCharts`.
|
|
420
|
+
|
|
421
|
+
On a public website, use an **embed key** (`fa_pk_…`) instead of your secret API key: it is read-only, reads chart data
|
|
422
|
+
only, works only on the domains you list, and expires. See [Keep your API key safe](#keep-your-api-key-safe).
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
## Install from npm
|
|
427
|
+
|
|
428
|
+
```sh
|
|
429
|
+
npm install tradingview-gex-flashalpha lightweight-charts@5.3.0
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
Lightweight Charts 5 is a peer dependency; the chart never bundles it. Each release is tested with one version, **5.3.0**
|
|
433
|
+
for this one.
|
|
434
|
+
|
|
435
|
+
```html
|
|
436
|
+
<div id="chart" style="height: 480px"></div>
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
```js
|
|
440
|
+
import * as LightweightCharts from 'lightweight-charts';
|
|
441
|
+
import { mount } from 'tradingview-gex-flashalpha';
|
|
442
|
+
|
|
443
|
+
const chart = mount(document.getElementById('chart'), {
|
|
444
|
+
lightweightCharts: LightweightCharts,
|
|
445
|
+
baseUrl: 'https://charts.flashalpha.com',
|
|
446
|
+
apiKey: 'YOUR_FLASHALPHA_API_KEY',
|
|
447
|
+
symbol: 'SPX',
|
|
448
|
+
resolution: '5m',
|
|
449
|
+
layers: ['levels', 'maxpain'],
|
|
450
|
+
});
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
Replace `YOUR_FLASHALPHA_API_KEY` with your key. The chart fills its container and follows its size, so give the
|
|
454
|
+
container a height. It adds its style sheet to the page the first time it mounts. For a strict Content Security Policy,
|
|
455
|
+
load the style sheet yourself and pass `injectCss: false`:
|
|
456
|
+
|
|
457
|
+
```js
|
|
458
|
+
import 'tradingview-gex-flashalpha/style.css';
|
|
459
|
+
mount(el, { lightweightCharts: LightweightCharts, injectCss: false, /* ... */ });
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
**What the npm package draws.** The package is the chart and the core layers of GEX Levels: call wall, put wall, gamma
|
|
463
|
+
flip and max pain (`levels`, `maxpain`), with the daily levels, the regime tint and the broken-wall markers. The other
|
|
464
|
+
indicators (0DTE magnet, Net GEX, the strike heatmap, the GEX profile, the expiry heatmap, the expected move, level events,
|
|
465
|
+
the 0DTE hedging flow, the metrics pane, the 0DTE scope and live open interest) are FlashAlpha
|
|
466
|
+
layers served by the chart host: use the [embed](#add-the-chart-to-your-site-in-one-line), or the
|
|
467
|
+
[script build](#use-without-a-bundler) with the layer file. See
|
|
468
|
+
[Core layers and FlashAlpha layers](#core-layers-and-flashalpha-layers).
|
|
469
|
+
|
|
470
|
+
---
|
|
471
|
+
|
|
472
|
+
## How do I add my FlashAlpha API key?
|
|
473
|
+
|
|
474
|
+
The chart reads the FlashAlpha **chart API** (`https://charts.flashalpha.com`: `/v1/symbols`, `/v1/bars`, `/v1/charts`),
|
|
475
|
+
not the other FlashAlpha APIs. It sends the key in the `X-Api-Key` header. Use the same placeholder,
|
|
476
|
+
`YOUR_FLASHALPHA_API_KEY`, in whichever setup you use.
|
|
477
|
+
|
|
478
|
+
**JavaScript option**
|
|
479
|
+
|
|
480
|
+
```js
|
|
481
|
+
mount(el, { baseUrl: 'https://charts.flashalpha.com', apiKey: 'YOUR_FLASHALPHA_API_KEY', symbol: 'SPX', lightweightCharts: LightweightCharts });
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
**Once per page, for every chart mounted afterward**
|
|
485
|
+
|
|
486
|
+
```js
|
|
487
|
+
FlashAlphaChart.setLicenseKey('YOUR_FLASHALPHA_API_KEY');
|
|
488
|
+
FlashAlphaChart.mount(el, { symbol: 'SPX', baseUrl: 'https://charts.flashalpha.com' });
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
**HTML attribute (embed)**
|
|
492
|
+
|
|
493
|
+
```html
|
|
494
|
+
<script async src="https://charts.flashalpha.com/embed.js" data-key="YOUR_FLASHALPHA_API_KEY"></script>
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
**Environment variable (Vite)**
|
|
498
|
+
|
|
499
|
+
```bash
|
|
500
|
+
VITE_FLASHALPHA_API_KEY=YOUR_FLASHALPHA_API_KEY
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
```js
|
|
504
|
+
mount(el, { apiKey: import.meta.env.VITE_FLASHALPHA_API_KEY, baseUrl: 'https://charts.flashalpha.com', symbol: 'SPX', lightweightCharts: LightweightCharts });
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
**Environment variable (Next.js):** `NEXT_PUBLIC_FLASHALPHA_API_KEY=YOUR_FLASHALPHA_API_KEY`.
|
|
508
|
+
|
|
509
|
+
**Your own server (for public websites)**
|
|
510
|
+
|
|
511
|
+
```js
|
|
512
|
+
mount(el, { baseUrl: '/api/flashalpha-charts', symbol: 'SPX', lightweightCharts: LightweightCharts });
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
Your server forwards the requests to `https://charts.flashalpha.com` and adds the key. See
|
|
516
|
+
[Keep your API key safe](#keep-your-api-key-safe).
|
|
517
|
+
|
|
518
|
+
You do not need to set your plan: the chart API answers with the key's plan, and the chart turns layers on or locks them
|
|
519
|
+
to match it.
|
|
520
|
+
|
|
521
|
+
---
|
|
522
|
+
|
|
523
|
+
## Use without a bundler
|
|
524
|
+
|
|
525
|
+
Serve the files from your own site and load the script build after Lightweight Charts. It sets
|
|
526
|
+
`window.FlashAlphaChart`. To get the FlashAlpha indicators too, load the layer file from the chart host after the chart
|
|
527
|
+
and before `mount` (it needs `window.FlashAlphaChart`, so it does not work with the npm `import`):
|
|
528
|
+
|
|
529
|
+
```html
|
|
530
|
+
<div id="chart" style="height: 480px"></div>
|
|
531
|
+
|
|
532
|
+
<script src="/js/lightweight-charts-5.3.0.standalone.production.js"></script>
|
|
533
|
+
<script src="/js/tradingview-gex-flashalpha.min.js"></script>
|
|
534
|
+
<script src="https://charts.flashalpha.com/flashalpha-chart-layers.js"></script>
|
|
535
|
+
<script>
|
|
536
|
+
FlashAlphaChart.setLicenseKey('YOUR_FLASHALPHA_API_KEY');
|
|
537
|
+
FlashAlphaChart.mount(document.getElementById('chart'), {
|
|
538
|
+
symbol: 'SPX',
|
|
539
|
+
resolution: '5m',
|
|
540
|
+
baseUrl: 'https://charts.flashalpha.com',
|
|
541
|
+
layers: ['levels', 'maxpain', 'netgex'],
|
|
542
|
+
});
|
|
543
|
+
</script>
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
The built files are in `node_modules/tradingview-gex-flashalpha/dist/`, or in `dist/` after `npm run build` in this
|
|
547
|
+
repository:
|
|
548
|
+
|
|
549
|
+
| File | Format | Use |
|
|
550
|
+
|---|---|---|
|
|
551
|
+
| `dist/tradingview-gex-flashalpha.mjs` | ES module | `import` (bundlers, `<script type="module">`) |
|
|
552
|
+
| `dist/tradingview-gex-flashalpha.cjs` | CommonJS | `require` |
|
|
553
|
+
| `dist/tradingview-gex-flashalpha.js`, `.min.js` | Script tag | `window.FlashAlphaChart` |
|
|
554
|
+
| `dist/tradingview-gex-flashalpha.css` | Style sheet | `tradingview-gex-flashalpha/style.css` with `injectCss: false` |
|
|
555
|
+
| `dist/vendor/lightweight-charts-5.3.0.*` | Script, LICENSE, NOTICE | The tested Lightweight Charts, to host yourself (after `npm run build` in this repository; not in the npm package) |
|
|
556
|
+
| `types/index.d.ts` | TypeScript | Options, data shapes and the plugin API |
|
|
557
|
+
|
|
558
|
+
---
|
|
559
|
+
|
|
560
|
+
## Framework examples
|
|
561
|
+
|
|
562
|
+
### React
|
|
563
|
+
|
|
564
|
+
```jsx
|
|
565
|
+
import { useEffect, useRef } from 'react';
|
|
566
|
+
import * as LightweightCharts from 'lightweight-charts';
|
|
567
|
+
import { mount } from 'tradingview-gex-flashalpha';
|
|
568
|
+
|
|
569
|
+
export function GexChart({ symbol = 'SPX' }) {
|
|
570
|
+
const ref = useRef(null);
|
|
571
|
+
|
|
572
|
+
useEffect(() => {
|
|
573
|
+
const chart = mount(ref.current, {
|
|
574
|
+
lightweightCharts: LightweightCharts,
|
|
575
|
+
baseUrl: 'https://charts.flashalpha.com',
|
|
576
|
+
apiKey: import.meta.env.VITE_FLASHALPHA_API_KEY,
|
|
577
|
+
symbol,
|
|
578
|
+
layers: ['levels', 'maxpain'],
|
|
579
|
+
});
|
|
580
|
+
return () => chart.destroy();
|
|
581
|
+
}, [symbol]);
|
|
582
|
+
|
|
583
|
+
return <div ref={ref} style={{ height: 480 }} />;
|
|
584
|
+
}
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
### Vue 3
|
|
588
|
+
|
|
589
|
+
```vue
|
|
590
|
+
<script setup>
|
|
591
|
+
import { onMounted, onBeforeUnmount, ref } from 'vue';
|
|
592
|
+
import * as LightweightCharts from 'lightweight-charts';
|
|
593
|
+
import { mount } from 'tradingview-gex-flashalpha';
|
|
594
|
+
|
|
595
|
+
const el = ref(null);
|
|
596
|
+
let chart;
|
|
597
|
+
|
|
598
|
+
onMounted(() => {
|
|
599
|
+
chart = mount(el.value, {
|
|
600
|
+
lightweightCharts: LightweightCharts,
|
|
601
|
+
baseUrl: 'https://charts.flashalpha.com',
|
|
602
|
+
apiKey: import.meta.env.VITE_FLASHALPHA_API_KEY,
|
|
603
|
+
symbol: 'SPY',
|
|
604
|
+
layers: ['levels', 'maxpain'],
|
|
605
|
+
});
|
|
606
|
+
});
|
|
607
|
+
onBeforeUnmount(() => chart?.destroy());
|
|
608
|
+
</script>
|
|
609
|
+
|
|
610
|
+
<template><div ref="el" style="height: 480px" /></template>
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
### Angular, Svelte and others
|
|
614
|
+
|
|
615
|
+
Call `mount(element, options)` after the element is in the DOM, and `chart.destroy()` when the component is destroyed.
|
|
616
|
+
|
|
617
|
+
More examples are in [`examples/`](examples): a basic page, the one-line embed, and your own data source.
|
|
618
|
+
|
|
619
|
+
---
|
|
620
|
+
|
|
621
|
+
## Options
|
|
622
|
+
|
|
623
|
+
`mount(element, options)` (or `FlashAlphaChart.mount` with the script build) accepts these options:
|
|
624
|
+
|
|
625
|
+
| Option | Default | Description |
|
|
626
|
+
|---|---|---|
|
|
627
|
+
| `symbol` | First symbol with data | Ticker. |
|
|
628
|
+
| `resolution` | `5m` | One of `1m`, `5m`, `15m`, `1h`, `1d`, `1w`. |
|
|
629
|
+
| `days` | Depends on resolution | Number of days to show. Each resolution has a maximum. |
|
|
630
|
+
| `session` | `rth` | `rth` or `eth`. |
|
|
631
|
+
| `layers` | None | Layer IDs: `levels`, `maxpain`, and IDs from registered layer plugins (the FlashAlpha layers). By default the chart opens with price and volume only. |
|
|
632
|
+
| `storage` | `true` | Remembers the layers the reader turns on or off (localStorage) and opens with them next time, over `layers`. `false` turns it off. |
|
|
633
|
+
| `storageKey` | `tradingview-gex-flashalpha:layers` | The localStorage key, to keep the picks of different charts apart. |
|
|
634
|
+
| `controls` | `true` | `false` hides the toolbar (and the Layout menu: one chart). |
|
|
635
|
+
| `layouts` | `true` | The **Layout** menu next to Settings: one to four charts. `false` mounts one chart. See [Several charts](#several-charts-layouts). |
|
|
636
|
+
| `layout` | `1` | The layout the chart opens with (`1`, `2v`, `2h`, `3v` ... `4tr`); the reader's last pick wins. |
|
|
637
|
+
| `symbolButtons` | `true` | `false` hides the symbol dropdown. |
|
|
638
|
+
| `exposure` | `true` | `false` draws candles only. |
|
|
639
|
+
| `source` | FlashAlpha chart API | Your own data source. See [Use your own data](#use-your-own-data). |
|
|
640
|
+
| `apiKey` | `setLicenseKey` value | FlashAlpha API key, sent as `X-Api-Key`. |
|
|
641
|
+
| `baseUrl` | Same origin | Chart API root URL: `https://charts.flashalpha.com`, or your proxy. |
|
|
642
|
+
| `refresh` | `60` | Seconds between refreshes. `0` turns refresh off. |
|
|
643
|
+
| `live` | `false` | `true` draws 1m to 1h candles and levels live from the chart API's WebSocket (`/v1/live`, FlashAlpha chart API only). While it is connected the refresh runs every 5 minutes; while it is down the chart refreshes as usual. |
|
|
644
|
+
| `theme` | `dark` | `dark`, `light`, or `auto` (follows the reader's system setting). |
|
|
645
|
+
| `background` | Per theme | Background color. A dark color is used with the dark theme and a light color with the light theme; the other theme keeps its own background, so the text stays readable when the reader switches theme. A color given other than as hex or `rgb()` (a name, `hsl()`, `var()`) is used with both. You can also set the CSS variable `--fac-bg`. |
|
|
646
|
+
| `upgradeUrl` | FlashAlpha pricing | Where locked layers, the Upgrade box and the plan name in the toolbar link. |
|
|
647
|
+
| `upsell` | `false` | `true` shows an **Upgrade** box over the chart while a layer that is on needs a higher plan (hidden by default for now). |
|
|
648
|
+
| `account` | `true` | `false` hides the account button at the right of the toolbar: **Sign up** when the chart has no plan (no key), the plan's name (for example **Growth**) when the API returns one. |
|
|
649
|
+
| `signupUrl` | FlashAlpha pricing | Where the **Sign up** button and the **Sign up free** box link. |
|
|
650
|
+
| `debug` | `false` | Shows load status in the toolbar. `'latency'` also shows the live lag (p50/p95). |
|
|
651
|
+
| `note` | Model-estimate disclaimer | A line under the chart next to the credit. `''` hides it. |
|
|
652
|
+
| `brand` | None | `{ logo, href, name }`: shows your logo, linked to `href`, at the bottom left of the price pane instead of the TradingView logo, and a "Charts by TradingView" link under the chart. |
|
|
653
|
+
| `lightweightCharts` | `window.LightweightCharts` | The Lightweight Charts module, if you import it instead of loading the script. |
|
|
654
|
+
| `styles` | Plugin defaults | Plot styles by plot ID, for example `{ callWall: { color: '#00c853', lineWidth: 2 } }` (`color`, `lineWidth`, `lineStyle`, `visible`, `priceLine`, `axisLabel`). Plot IDs of the core indicator: `callWall`, `putWall`, `flip`, `flipUnverified`, `maxPain`. |
|
|
655
|
+
| `injectCss` | `true` | `false` doesn't add the chart's `<style>` to the page. Load `tradingview-gex-flashalpha/style.css` yourself. |
|
|
656
|
+
|
|
657
|
+
## Methods
|
|
658
|
+
|
|
659
|
+
```js
|
|
660
|
+
chart.setSymbol('SPY');
|
|
661
|
+
chart.setResolution('15m');
|
|
662
|
+
chart.setLayers(['levels', 'maxpain']);
|
|
663
|
+
chart.setTheme('light');
|
|
664
|
+
chart.destroy();
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
| Member | Description |
|
|
668
|
+
|---|---|
|
|
669
|
+
| `setSymbol(symbol)` | Load another ticker. |
|
|
670
|
+
| `setResolution(resolution)` | `1m` to `1w`. |
|
|
671
|
+
| `setRange(days)` | Days back from now, capped per resolution. |
|
|
672
|
+
| `setSession('rth' \| 'eth')` | Regular hours, or with pre-market and after-hours. |
|
|
673
|
+
| `setLayers([...])` | The layers to draw. |
|
|
674
|
+
| `setTheme(theme)` | `dark`, `light` or `auto`. |
|
|
675
|
+
| `setStyle(plotId, style)` / `styles` | Change a plot's colour, width, line style or visibility, as a layer's options do. |
|
|
676
|
+
| `layers`, `plan` | The layers drawn, and the key's plan from the last answer (`null` before it). |
|
|
677
|
+
| `reload()` | Load the window again. |
|
|
678
|
+
| `destroy()` | Remove the chart. A chart whose element leaves the page stops refreshing by itself. |
|
|
679
|
+
| `chart` | The Lightweight Charts instance, for your own series. |
|
|
680
|
+
|
|
681
|
+
With the FlashAlpha layers loaded, the chart also has `setExposure({ scope, basis })` (for example
|
|
682
|
+
`chart.setExposure({ scope: 'zero_dte', basis: 'live' })`), `setMetric(name)`, `setLens(lens, layer)` (the value per strike
|
|
683
|
+
of the strike heatmap, the GEX profile and the expiry heatmap: all three, or the one named) and `setHedgeUnits('usd' | 'move')`
|
|
684
|
+
(the 0DTE hedging flow's units). Their options: `lens` (`'gex'`, `'dex'`, `'vex'` or `'chex'`, or
|
|
685
|
+
`{ heatmap, profile, expiries }`), `expiryRows` (the strikes in the expiry heatmap) and `hedgeUnits`.
|
|
686
|
+
|
|
687
|
+
Static functions: `mount`, `registerLayers`, `setLicenseKey`, `chartEngineSource(baseUrl, apiKey)`, `plans`, `version`
|
|
688
|
+
(and `FlashAlphaChart.layers` with the script build).
|
|
689
|
+
|
|
690
|
+
## Several charts (layouts)
|
|
691
|
+
|
|
692
|
+
The **Layout** button next to Settings splits the chart into one to four charts, like TradingView's layouts: 1;
|
|
693
|
+
2 side by side or one above the other; 3 in columns, rows, or one large chart with two small ones; 4 in a grid, rows,
|
|
694
|
+
columns, or one large chart with three small ones. Use it to watch several intervals (1m, 5m, 15m, 1h) or different
|
|
695
|
+
indicators on the same symbol.
|
|
696
|
+
|
|
697
|
+
- One toolbar and one time bar act on the chart in focus (outlined); click a chart to focus it. Each chart keeps its own
|
|
698
|
+
interval, range, session, indicators and Settings.
|
|
699
|
+
- A new symbol goes to every chart. The theme too.
|
|
700
|
+
- A new chart opens with an interval no other chart has (1m, 5m, 15m, 1h ...) and no indicator.
|
|
701
|
+
- The layout and each chart's interval, range and session are remembered (localStorage, `storageKey` + `:group`);
|
|
702
|
+
the layers of the first chart under `storageKey`, of the others under `storageKey:2` to `storageKey:4`.
|
|
703
|
+
- Below 640 px wide only the chart in focus shows and the Layout menu is hidden.
|
|
704
|
+
|
|
705
|
+
```js
|
|
706
|
+
const chart = FlashAlphaChart.mount(el, { symbol: 'SPX', layout: '2v' });
|
|
707
|
+
chart.setLayout('4'); // 2 x 2
|
|
708
|
+
chart.charts[1].setResolution('1m');
|
|
709
|
+
chart.focus(1); // the toolbar now acts on the second chart
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
| Member | Description |
|
|
713
|
+
|---|---|
|
|
714
|
+
| `setLayout(id)` / `layout` | The layout: `1`, `2v`, `2h`, `3v`, `3h`, `3l`, `3r`, `3t`, `3b`, `4`, `4h`, `4v`, `4l`, `4r`, `4t`, `4b`, `4lc`, `4rc`, `4tr`. |
|
|
715
|
+
| `charts` | Every chart's methods (the table above), in layout order. |
|
|
716
|
+
| `focus(i)` / `active` | The chart in focus, from 0. |
|
|
717
|
+
|
|
718
|
+
The other methods act on the chart in focus, except `setSymbol`, `setTheme`, `reload` and `destroy`, which act on all of
|
|
719
|
+
them. Each chart also has `symbol`, `resolution`, `range` and `session`. `layouts: false` mounts one chart, as before.
|
|
720
|
+
|
|
721
|
+
---
|
|
722
|
+
|
|
723
|
+
## Events
|
|
724
|
+
|
|
725
|
+
When there's no data to draw, the chart shows a message and dispatches a `flashalpha:nodata` event on the container.
|
|
726
|
+
When the API wants a key (`api_key_required`: a signed-out reader), the message is a sign-up box over a blurred picture
|
|
727
|
+
of the chart, with a **Sign up free** link to `signupUrl`.
|
|
728
|
+
The event bubbles, and `event.detail` has `symbol` and `error`. For example, you can hide the chart's section:
|
|
729
|
+
|
|
730
|
+
```js
|
|
731
|
+
el.addEventListener('flashalpha:nodata', () => { el.closest('section').hidden = true; });
|
|
732
|
+
```
|
|
733
|
+
|
|
734
|
+
After the symbol, interval, range, session or layers changed (by the reader or by a method), the chart dispatches
|
|
735
|
+
`flashalpha:change` on the container. It bubbles; `event.detail` is `{ symbol, resolution, range, session, layers }`
|
|
736
|
+
(in a layout, each chart sends its own). For example, keep the chart in the page address so a link opens the same chart:
|
|
737
|
+
|
|
738
|
+
```js
|
|
739
|
+
el.addEventListener('flashalpha:change', e => {
|
|
740
|
+
const q = new URLSearchParams(location.search);
|
|
741
|
+
q.set('symbol', e.detail.symbol); q.set('res', e.detail.resolution); q.set('layers', e.detail.layers.join(','));
|
|
742
|
+
history.replaceState(null, '', '?' + q);
|
|
743
|
+
});
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
When the reader follows a **Sign up** or **Upgrade** link or prompt, the chart dispatches `flashalpha:upgrade` on the
|
|
747
|
+
container. It bubbles; `event.detail` is `{ campaign, content, href, symbol }`: `campaign` is `'signup'` or `'upgrade'`,
|
|
748
|
+
`content` where it was (`toolbar`, `account`, `legend`, `gate`, `upsell`, or the locked layer such as `levels`).
|
|
749
|
+
These links carry `utm_source=chart` tags so FlashAlpha can count where readers came from, except a link to the page's
|
|
750
|
+
own site (`upgradeUrl` / `signupUrl` on the same host, `www.` or not), whose tags would replace the reader's own traffic
|
|
751
|
+
source. On your own site, count the clicks with the event instead:
|
|
752
|
+
|
|
753
|
+
```js
|
|
754
|
+
el.addEventListener('flashalpha:upgrade', e => {
|
|
755
|
+
gtag('event', 'cta_click', { cta_name: `chart-${e.detail.campaign}-${e.detail.content}`, destination_url: e.detail.href });
|
|
756
|
+
});
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
---
|
|
760
|
+
|
|
761
|
+
## Core layers and FlashAlpha layers
|
|
762
|
+
|
|
763
|
+
The chart in this repository draws two **core layers**:
|
|
764
|
+
|
|
765
|
+
| Layer ID | What it draws |
|
|
766
|
+
|---|---|
|
|
767
|
+
| `levels` | Call wall, put wall, and gamma flip as step lines through the day. The flip is lighter when the data source marks it as not certified. |
|
|
768
|
+
| `maxpain` | Max pain. |
|
|
769
|
+
|
|
770
|
+
Both layers also draw the **daily levels**: each session gets the previous session's closing levels as a dashed step
|
|
771
|
+
line, in the colours of the intraday levels. You see them on `1d` and `1w`, and on intraday resolutions before the first
|
|
772
|
+
intraday level in the window (max pain: before the first intraday row that has a max pain, so where the intraday rows
|
|
773
|
+
have none the daily max pain continues, "Max pain (daily)" in the legend). They cover all expiries on settled open
|
|
774
|
+
interest, so a 0DTE scope or live flow hides them.
|
|
775
|
+
|
|
776
|
+
The price scale fits the candles, not the levels: a level far from the price is off screen, and its value stays in the
|
|
777
|
+
legend. Drag the price axis to bring it in.
|
|
778
|
+
|
|
779
|
+
After the last stored bar, the chart draws muted "spot" candles when the data source sends spot prices for those
|
|
780
|
+
minutes. Bars built from quote mids (`source: 'quotes'`, no trades that day) have no volume and the legend says
|
|
781
|
+
"quote mid (no trades)"; they are muted on `1m`, outside regular hours (a stub quote's mid) and when every bar in the
|
|
782
|
+
window is one (a symbol without trades), otherwise drawn in the normal colours. An index (`asset_class: 'index'` in
|
|
783
|
+
`symbols()`, such as SPX) has only quote bars, so they are drawn as normal candles. A weekly bar that mixes quote days and
|
|
784
|
+
trade days (`source: 'mixed'`) has no volume either, since its volume counts the trade days only; the legend says
|
|
785
|
+
"some days quote mid (no volume)". The chart refreshes every 60 seconds while the page is visible (it loads only the
|
|
786
|
+
bars after the newest one) and keeps your zoom.
|
|
787
|
+
|
|
788
|
+
The range buttons pick the first window. Drag the chart (or zoom out) to its left edge and it loads the window before
|
|
789
|
+
the first bar, as long as the range picked (up to the most a resolution allows in one request), until the symbol's
|
|
790
|
+
`first_bar` from `symbols()`; drag it to the right edge when the newest bar is more than two bars old and it loads the bars
|
|
791
|
+
after it. Both start after the reader touches the chart and keep the bars in view where they are.
|
|
792
|
+
|
|
793
|
+
The **FlashAlpha layers** (`magnet`, `netgex`, `heatmap`, `profile`, `expiries`, `em`, `events`, `hedgeflow`, the metrics pane, the 0DTE scope and live open
|
|
794
|
+
interest, described in [Indicators at a glance](#indicators-at-a-glance)) are a layer plugin served by the chart host,
|
|
795
|
+
`https://charts.flashalpha.com/flashalpha-chart-layers.js`. They are not in this repository or the npm package. The embed
|
|
796
|
+
loads them for you; with the script build, load that file after the chart and before `mount`.
|
|
797
|
+
|
|
798
|
+
The Indicators menu lists every layer whatever your plan. A layer above your plan shows a lock and the plan it needs on
|
|
799
|
+
the right, and links to the pricing page; the layers your plan opens carry no plan label. Without a key (or with a key
|
|
800
|
+
that is not valid) the chart locks every paid layer, like the free plan.
|
|
801
|
+
|
|
802
|
+
---
|
|
803
|
+
|
|
804
|
+
## Keep your API key safe
|
|
805
|
+
|
|
806
|
+
An API key placed in browser code can be read by anyone who opens the page.
|
|
807
|
+
|
|
808
|
+
- **Personal or internal pages:** pass `apiKey` directly.
|
|
809
|
+
- **Public websites:** use an **embed key** (`fa_pk_…`): made from your secret key on your server, read-only, chart data
|
|
810
|
+
only, locked to your domains, with an expiry. See [Embed keys](docs/embed-keys.md). Or keep the key on your server and
|
|
811
|
+
set `baseUrl` to a small proxy that adds the `X-Api-Key` header to the requests it forwards to the chart API.
|
|
812
|
+
|
|
813
|
+
The chart sends the key only in the `X-Api-Key` header. It never stores the key or writes it to the URL.
|
|
814
|
+
|
|
815
|
+
---
|
|
816
|
+
|
|
817
|
+
## Use your own data
|
|
818
|
+
|
|
819
|
+
Pass an object with the following methods as the `source` option. Each method can return a value or a promise. You need
|
|
820
|
+
a FlashAlpha key only for FlashAlpha data.
|
|
821
|
+
|
|
822
|
+
```js
|
|
823
|
+
const mySource = {
|
|
824
|
+
// Tickers the chart can show.
|
|
825
|
+
symbols: () => [{ symbol: 'SPX', last_bar: '2026-11-10T21:00:00Z' }],
|
|
826
|
+
|
|
827
|
+
// OHLCV bars.
|
|
828
|
+
bars: (symbol, resolution, fromIso, toIso, session) => ({
|
|
829
|
+
bars: [{ ts: '2026-11-10T14:30:00Z', open: 0, high: 0, low: 0, close: 0, volume: 0, source: 'mine' }],
|
|
830
|
+
}),
|
|
831
|
+
|
|
832
|
+
// Gamma exposure levels per bar.
|
|
833
|
+
charts: (symbol, resolution, fromIso, toIso, { layers, session }) => ({
|
|
834
|
+
exposure: [{
|
|
835
|
+
ts: '2026-11-10T14:30:00Z',
|
|
836
|
+
call_wall: 0, put_wall: 0, max_pain: 0, // walls: 'oi' | 'gex' says which definition the API used (optional)
|
|
837
|
+
gamma_flip: { last: 0, status: 'available' },
|
|
838
|
+
}],
|
|
839
|
+
}),
|
|
840
|
+
};
|
|
841
|
+
```
|
|
842
|
+
|
|
843
|
+
- Times are UTC ISO 8601 strings. The chart shows them in US Eastern time.
|
|
844
|
+
- A `null` value is drawn as a gap, not as the previous value.
|
|
845
|
+
- A `gamma_flip.status` other than `available` draws the flip lighter.
|
|
846
|
+
- Levels are drawn on intraday resolutions (`1m` to `1h`). Daily levels come from `levels_daily` rows
|
|
847
|
+
`{ ts (session date), call_wall, put_wall, gamma_flip, gamma_flip_status, max_pain, status }` (a status other than `ok`
|
|
848
|
+
leaves a gap), asked for on every resolution.
|
|
849
|
+
- An exposure row can include `spot: { first, min, max, last }`. The chart then draws muted "spot" candles for minutes
|
|
850
|
+
after the last bar.
|
|
851
|
+
- To report an error, return `{ error: 'message' }`. The chart shows the message instead of an empty chart.
|
|
852
|
+
- To lock layers by plan, return `plan` (`free`, `basic`, `growth`, `alpha`) from `charts`; layer plugins declare the
|
|
853
|
+
plan each layer needs with `plans: { id: 'growth' }`.
|
|
854
|
+
|
|
855
|
+
For a complete page, open [`examples/custom-source.html`](examples/custom-source.html) in a browser. The FlashAlpha chart
|
|
856
|
+
API itself is described in the [chart API reference](docs/api.md).
|
|
857
|
+
|
|
858
|
+
## Add layers
|
|
859
|
+
|
|
860
|
+
To add layers to the Indicators menu, call `FlashAlphaChart.registerLayers(plugin)` before `mount`. The layers apply to
|
|
861
|
+
every chart that you mount afterward. This example adds a VWAP line:
|
|
862
|
+
|
|
863
|
+
```js
|
|
864
|
+
FlashAlphaChart.registerLayers({
|
|
865
|
+
layers: [['vwap', 'VWAP']],
|
|
866
|
+
attach(ctx) {
|
|
867
|
+
let line;
|
|
868
|
+
return {
|
|
869
|
+
ready() { line = ctx.chart.addSeries(ctx.LW.LineSeries, { color: '#4fc3f7', lineWidth: 1 }); },
|
|
870
|
+
draw() {
|
|
871
|
+
let pv = 0, v = 0;
|
|
872
|
+
line.setData(!ctx.on('vwap') ? [] : ctx.bars.map(b => {
|
|
873
|
+
pv += b.close * (b.volume || 0); v += b.volume || 0;
|
|
874
|
+
return v ? { time: b.time, value: pv / v } : { time: b.time };
|
|
875
|
+
}));
|
|
876
|
+
},
|
|
877
|
+
clear() { line.setData([]); },
|
|
878
|
+
};
|
|
879
|
+
},
|
|
880
|
+
});
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
A plugin has these fields:
|
|
884
|
+
|
|
885
|
+
- `layers`: an array of `[id, label]` pairs.
|
|
886
|
+
- `indicator` (optional): the name of the indicator it joins, for example `GEX Levels`.
|
|
887
|
+
- `indicators` (optional): an indicator per layer ID, so one plugin can fill several, for example
|
|
888
|
+
`{ heatmap: 'Strike heatmap' }`. `ctx.addControl(el, 'panel', name)` puts a control in one of them.
|
|
889
|
+
- `defaults`: not used any more (an indicator's switch turns all its layers on, or all off).
|
|
890
|
+
- `plans` (optional): the lowest plan per layer ID, for example `{ heatmap: 'growth' }`.
|
|
891
|
+
- `apiLayers(ctx)` (optional): extra API layers to request.
|
|
892
|
+
- `attach(ctx)`: runs once per chart and returns a handle with any of `ready()`, `draw(response)`, `clear()`,
|
|
893
|
+
`legend(time, y)`, `crosshair(time, y)`, and `destroy()`. The handle can also have:
|
|
894
|
+
- `legendLevels(row, parts, prev, indicator, at)`: add to an indicator's line in the legend (called once per indicator
|
|
895
|
+
of the plugin that is on, `indicator` is its name, at every bar: `row` is `{ time }` where there is no exposure row;
|
|
896
|
+
`at` is `{ time, y }`, the crosshair's y or null) by inserting into or appending to
|
|
897
|
+
`parts`: `{ label, value, prev, cls, format, note }` reads like a key level (a number with its change against `prev`,
|
|
898
|
+
the previous session's last row, written by `format` when given; or a string; `note` in brackets after the value),
|
|
899
|
+
`{ text, title }` is a note whose `title` shows on hover, a string part is shown as text.
|
|
900
|
+
- `paneOf(indicator)`: the series of a pane of its own the indicator draws in; its legend line goes to the top left of
|
|
901
|
+
that pane. `paneLegends(time)`: lines for panes that are no indicator of their own,
|
|
902
|
+
`[{ series, name, parts, indicator, remove }]`.
|
|
903
|
+
- `methods`: an object of functions added to the chart object that `mount` returns, for example `setMyOption(x)`.
|
|
904
|
+
|
|
905
|
+
`ctx.setQuery({...})` adds parameters to the chart API request and reloads; called inside `attach` it only sets the
|
|
906
|
+
first request. A series that a plugin adds in a new pane under the price gets a fifth of the chart's height.
|
|
907
|
+
|
|
908
|
+
`ctx.exposure` has the exposure rows of the last load on bar times. [Layer plugins](docs/plugins.md) describes `ctx`
|
|
909
|
+
and the handle in full. The core layers `levels` and `maxpain` are a plugin too:
|
|
910
|
+
[`src/plugins/levels.js`](src/plugins/levels.js).
|
|
911
|
+
|
|
912
|
+
---
|
|
913
|
+
|
|
914
|
+
## Who uses GEX indicators?
|
|
915
|
+
|
|
916
|
+
- **Intraday and 0DTE traders** who want the call wall, put wall, gamma flip and 0DTE magnet on their execution chart.
|
|
917
|
+
- **Swing traders** who check whether the market is in a positive or negative gamma regime before sizing a trade.
|
|
918
|
+
- **Index and ETF traders** (SPX, SPY, QQQ) who track where dealer hedging may slow or speed up the market.
|
|
919
|
+
- **Fintech products, brokers, newsletters and trading communities** that want a GEX chart on their own site without
|
|
920
|
+
building the data pipeline.
|
|
921
|
+
- **Educators and analysts** who use real sessions to show how options positioning shapes price action.
|
|
922
|
+
|
|
923
|
+
---
|
|
924
|
+
|
|
925
|
+
## FAQ
|
|
926
|
+
|
|
927
|
+
**What is TradingView GEX by FlashAlpha?**
|
|
928
|
+
It is a set of options gamma exposure indicators drawn on a TradingView-style candlestick chart: call wall, put wall, gamma
|
|
929
|
+
flip, max pain, 0DTE magnet, net GEX, a strike heatmap, a GEX profile, Greeks exposure and 0DTE metrics. The data comes
|
|
930
|
+
from the FlashAlpha options analytics API.
|
|
931
|
+
|
|
932
|
+
**Is this a TradingView Pine Script indicator?**
|
|
933
|
+
No. It is a chart you embed on your own website or app, built on TradingView's open-source Lightweight Charts™ library.
|
|
934
|
+
It looks and works like a TradingView chart, but it runs outside tradingview.com and reads FlashAlpha data directly.
|
|
935
|
+
|
|
936
|
+
**What is a call wall and a put wall?**
|
|
937
|
+
The call wall is the strike above the price with the largest call positioning, often read as resistance. The put wall is
|
|
938
|
+
the strike below the price with the largest put positioning, often read as support.
|
|
939
|
+
|
|
940
|
+
**What is the gamma flip?**
|
|
941
|
+
The price at which net dealer gamma changes sign. Above it dealers are estimated to be long gamma, which tends to dampen
|
|
942
|
+
moves; below it they are short gamma, which tends to amplify moves.
|
|
943
|
+
|
|
944
|
+
**What does net GEX tell me?**
|
|
945
|
+
The total dealer gamma exposure in dollars. Positive net GEX points to a calmer, mean-reverting market; negative net GEX
|
|
946
|
+
points to larger, trending moves.
|
|
947
|
+
|
|
948
|
+
**Which symbols are supported?**
|
|
949
|
+
US stocks, ETFs and indices that the FlashAlpha chart API lists (`/v1/symbols`), such as SPX, SPY, QQQ, AAPL, MSFT and
|
|
950
|
+
TSLA.
|
|
951
|
+
|
|
952
|
+
**Which timeframes are supported?**
|
|
953
|
+
1-minute, 5-minute, 15-minute, 1-hour, daily and weekly bars, with regular or extended trading hours. GEX levels are drawn
|
|
954
|
+
intraday from per-bar data; daily and weekly charts show each session's closing levels.
|
|
955
|
+
|
|
956
|
+
**How often do the indicators update?**
|
|
957
|
+
Every 60 seconds while the page is visible (`refresh`), loading only the bars after the newest one, and in real time with
|
|
958
|
+
the optional `live` WebSocket mode. Outside market hours the chart shows the last sessions.
|
|
959
|
+
|
|
960
|
+
**Is it free?**
|
|
961
|
+
The chart is free and open source under the MIT license. FlashAlpha data needs an API key: the free plan shows candles and
|
|
962
|
+
volume, GEX Levels and Net GEX start on Basic, and the strike heatmap, GEX profile, expiry heatmap, expected move, level
|
|
963
|
+
events, 0DTE hedging flow and 0DTE scope are on Growth. With your
|
|
964
|
+
own `source` you need no key at all.
|
|
965
|
+
|
|
966
|
+
**Can I use it for 0DTE trading?**
|
|
967
|
+
Yes. Set Expiries to 0DTE to compute the levels on today's expiry only, and add the 0DTE magnet, the pin score and the
|
|
968
|
+
0DTE move left to follow same-day positioning.
|
|
969
|
+
|
|
970
|
+
**Can I put it on my website?**
|
|
971
|
+
Yes, with one `div` and one `script` tag, or with the npm package in your app. Use an embed key on public pages so your
|
|
972
|
+
secret API key never reaches the browser.
|
|
973
|
+
|
|
974
|
+
**Does it work with React, Vue, Angular or Svelte?**
|
|
975
|
+
Yes. It is plain JavaScript with no framework dependency. See [Framework examples](#framework-examples).
|
|
976
|
+
|
|
977
|
+
**Will it change the styles of my page?**
|
|
978
|
+
No. Every CSS rule of the chart sits under its own `fac-` classes.
|
|
979
|
+
|
|
980
|
+
**Why is Lightweight Charts a peer dependency?**
|
|
981
|
+
So your app loads one copy and controls its version. Each release is tested with one version (5.3.0 for this one).
|
|
982
|
+
|
|
983
|
+
**Are the levels trading signals?**
|
|
984
|
+
No. They are model estimates from open interest, not observed dealer positions, and they are not financial advice.
|
|
985
|
+
|
|
986
|
+
**Where can I get help?**
|
|
987
|
+
Open an issue at https://github.com/FlashAlpha-lab/tradingview-gex-flashalpha/issues, or see the
|
|
988
|
+
[chart API reference](docs/api.md).
|
|
989
|
+
|
|
990
|
+
---
|
|
991
|
+
|
|
992
|
+
## About FlashAlpha
|
|
993
|
+
|
|
994
|
+
[FlashAlpha](https://flashalpha.com/?utm_source=github&utm_medium=readme&utm_campaign=tradingview-gex-flashalpha) is an
|
|
995
|
+
options analytics API: gamma exposure (GEX), delta, vanna and charm exposure, key levels, 0DTE analytics, option flow,
|
|
996
|
+
volatility and historical data for US stocks, ETFs and indices. TradingView GEX by FlashAlpha is the official way to see
|
|
997
|
+
that data on a price chart.
|
|
998
|
+
|
|
999
|
+
- [API docs](https://flashalpha.com/docs?utm_source=github&utm_medium=readme&utm_campaign=tradingview-gex-flashalpha)
|
|
1000
|
+
- [GEX exposure API](https://flashalpha.com/docs/lab-api-exposure?utm_source=github&utm_medium=readme&utm_campaign=tradingview-gex-flashalpha)
|
|
1001
|
+
- [Pricing and free API key](https://flashalpha.com/pricing?utm_source=github&utm_medium=readme&utm_campaign=tradingview-gex-flashalpha)
|
|
1002
|
+
- [Free GEX tool](https://flashalpha.com/tools/gamma-exposure?utm_source=github&utm_medium=readme&utm_campaign=tradingview-gex-flashalpha)
|
|
1003
|
+
- [flashalpha-js](https://github.com/FlashAlpha-lab/flashalpha-js): JavaScript and TypeScript SDK.
|
|
1004
|
+
- [flashalpha-python](https://github.com/FlashAlpha-lab/flashalpha-python): Python SDK.
|
|
1005
|
+
- [flashalpha-mcp](https://github.com/FlashAlpha-lab/flashalpha-mcp): MCP server for Claude, Cursor and other AI assistants.
|
|
1006
|
+
- [gex-explained](https://github.com/FlashAlpha-lab/gex-explained): the theory and math behind GEX.
|
|
1007
|
+
- [awesome-options-analytics](https://github.com/FlashAlpha-lab/awesome-options-analytics): options analytics resources.
|
|
1008
|
+
|
|
1009
|
+
---
|
|
1010
|
+
|
|
1011
|
+
## Development
|
|
1012
|
+
|
|
1013
|
+
```sh
|
|
1014
|
+
npm ci
|
|
1015
|
+
npm run build # dist/ from src/
|
|
1016
|
+
npm test # unit tests on src/ and dist/
|
|
1017
|
+
npm run check # source check, type check, build, tests, npm pack --dry-run
|
|
1018
|
+
```
|
|
1019
|
+
|
|
1020
|
+
`dist/` is not committed: run `npm run build` before opening the examples, which load `../dist/`. A release is a push
|
|
1021
|
+
to the `releases` branch: the Release workflow runs `npm run check` and publishes the version in `package.json` to npm
|
|
1022
|
+
(a version already on npm is skipped). The chart host serves, next to
|
|
1023
|
+
`embed.js`, `dist/tradingview-gex-flashalpha.min.js` as `flashalpha-chart-core.js` and the files in `dist/vendor/` under the
|
|
1024
|
+
same names.
|
|
1025
|
+
|
|
1026
|
+
FlashAlpha publishes this repository from its chart source with each release. Issues and suggestions are welcome.
|
|
1027
|
+
|
|
1028
|
+
### Project structure
|
|
1029
|
+
|
|
1030
|
+
```
|
|
1031
|
+
src/
|
|
1032
|
+
index.js public API: mount, registerLayers, setLicenseKey, chartEngineSource, plans, version
|
|
1033
|
+
global.js script-tag entry: window.FlashAlphaChart
|
|
1034
|
+
group.js mount(): one to four charts in a layout, one toolbar for the chart in focus, the symbol on all
|
|
1035
|
+
layouts.js the layouts (CSS grid areas) and their icons
|
|
1036
|
+
chart.js mountChart(): one Lightweight Charts chart, loading, refresh, the plugin context
|
|
1037
|
+
source.js chartEngineSource(): the FlashAlpha chart API client
|
|
1038
|
+
live.js the live WebSocket feed (option live)
|
|
1039
|
+
constants.js resolutions, ranges, plans, colours, themes, error messages
|
|
1040
|
+
time.js ET time helpers (etTime, dayOf, sessionOf)
|
|
1041
|
+
util.js esc, num, big, floorIndex, cutGaps (a gap in a line stays a gap)
|
|
1042
|
+
plans.js plan ranks, license key, upgrade links
|
|
1043
|
+
registry.js registerLayers and the built-in plugins
|
|
1044
|
+
theme.js dark / light / auto
|
|
1045
|
+
display.js chart type, price scale, crosshair, price line and watermark (chart type menu, % log auto, Settings)
|
|
1046
|
+
percent-levels.js the level lines and labels on a Percent or Indexed to 100 scale (drawn on the candles)
|
|
1047
|
+
css.js, styles.css the style sheet and its injection
|
|
1048
|
+
plugins/levels.js the core layers (levels, maxpain, daily levels) as a layer plugin
|
|
1049
|
+
components/ layout, toolbar, indicators, screenshot, legend, Upgrade box, empty state, brand
|
|
1050
|
+
scripts/ build (esbuild + lightningcss) and the source check
|
|
1051
|
+
test/ node:test + jsdom, with a stand-in for Lightweight Charts
|
|
1052
|
+
types/index.d.ts TypeScript declarations
|
|
1053
|
+
embed.js the one-line embed served from the chart host
|
|
1054
|
+
index.html the live demo page (GitHub Pages): your key, the chart from the chart host
|
|
1055
|
+
docs/ indicator pages, the chart API reference, embed keys, layer plugins
|
|
1056
|
+
assets/ screenshots for this README
|
|
1057
|
+
```
|
|
1058
|
+
|
|
1059
|
+
### Upgrading Lightweight Charts
|
|
1060
|
+
|
|
1061
|
+
The version is pinned: `devDependencies` holds one exact version, and `embed.js`, the examples and `dist/vendor/` use
|
|
1062
|
+
that version only. To move to a new one:
|
|
1063
|
+
|
|
1064
|
+
1. `npm install --save-dev --save-exact lightweight-charts@<version>`.
|
|
1065
|
+
2. Copy the release's `NOTICE` from https://github.com/tradingview/lightweight-charts (tag `v<version>`) to
|
|
1066
|
+
`vendor/lightweight-charts/NOTICE` (the npm package doesn't include it).
|
|
1067
|
+
3. Set `LW_VERSION` in `embed.js` and the script paths in `examples/`.
|
|
1068
|
+
4. `npm run check`: `test/lightweight-charts.test.js` mounts the chart on the new version and fails until every pin
|
|
1069
|
+
matches.
|
|
1070
|
+
5. Deploy the new `dist/vendor/` files to the chart host before the new `embed.js`.
|
|
1071
|
+
|
|
1072
|
+
### Browser support
|
|
1073
|
+
|
|
1074
|
+
The chart supports current versions of Chrome, Edge, Firefox, and Safari on desktop and mobile. It needs ES2020 and
|
|
1075
|
+
`Intl.DateTimeFormat` with time zone support.
|
|
1076
|
+
|
|
1077
|
+
---
|
|
1078
|
+
|
|
1079
|
+
## License, trademarks and disclaimer
|
|
1080
|
+
|
|
1081
|
+
This project is licensed under the [MIT License](LICENSE).
|
|
1082
|
+
|
|
1083
|
+
The chart loads [TradingView Lightweight Charts™](https://github.com/tradingview/lightweight-charts) at run time; the
|
|
1084
|
+
npm package doesn't include its source code. `npm run build` puts an unmodified copy in `dist/vendor/`, with its LICENSE
|
|
1085
|
+
and NOTICE, for the examples and the chart host. Lightweight Charts is licensed under the Apache License 2.0:
|
|
1086
|
+
|
|
1087
|
+
> TradingView Lightweight Charts™
|
|
1088
|
+
> Copyright (c) 2025 TradingView, Inc. https://www.tradingview.com/
|
|
1089
|
+
|
|
1090
|
+
The chart keeps the TradingView attribution logo, which is the Lightweight Charts default
|
|
1091
|
+
(`layout.attributionLogo: true`). The logo meets the license requirement to link to tradingview.com. If you turn the
|
|
1092
|
+
logo off, link to https://www.tradingview.com/ elsewhere on your page. If you bundle Lightweight Charts with your code,
|
|
1093
|
+
include its LICENSE and NOTICE files. The `brand` option turns the TradingView logo off and adds a "Charts by
|
|
1094
|
+
TradingView" link to https://www.tradingview.com/ under the chart instead. Keep that link if you change the chart's markup.
|
|
1095
|
+
|
|
1096
|
+
TradingView and Lightweight Charts are trademarks of TradingView, Inc. This project is not affiliated with, endorsed by or
|
|
1097
|
+
sponsored by TradingView.
|
|
1098
|
+
|
|
1099
|
+
GEX levels and metrics are model estimates from options open interest. They are provided for information and education
|
|
1100
|
+
only and are not investment advice.
|
|
1101
|
+
|
|
1102
|
+
<sub>Topics: gamma exposure, GEX indicator, GEX chart, dealer gamma, dealer positioning, call wall, put wall, gamma flip,
|
|
1103
|
+
zero gamma, max pain, 0DTE, net GEX, GEX heatmap, GEX profile, vanna exposure, charm exposure, delta exposure, options
|
|
1104
|
+
analytics, TradingView Lightweight Charts, npm, JavaScript chart, SPX, SPY, QQQ.</sub>
|