tradingview-gex-flashalpha 1.1.0 → 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 +23 -0
- package/README.md +27 -0
- package/dist/tradingview-gex-flashalpha.cjs +66 -8
- package/dist/tradingview-gex-flashalpha.css +1 -1
- package/dist/tradingview-gex-flashalpha.js +66 -8
- package/dist/tradingview-gex-flashalpha.min.js +15 -15
- package/dist/tradingview-gex-flashalpha.mjs +66 -8
- package/embed.js +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.2.0 — 2026-11-27
|
|
4
|
+
|
|
5
|
+
- Sign up and Upgrade links to the page's own site (`upgradeUrl` / `signupUrl` on the page's host, `www.` or not) no
|
|
6
|
+
longer carry `utm_source=chart` tags, which replaced the reader's own traffic source there. Links to another site keep
|
|
7
|
+
them.
|
|
8
|
+
- New event **`flashalpha:upgrade`** on the container (it bubbles) when the reader follows a Sign up or Upgrade link or
|
|
9
|
+
prompt, including the prompts that open the pricing page without a link (an indicator whose every layer is locked, a
|
|
10
|
+
locked option); `event.detail` is `{ campaign, content, href, symbol }`. Plugins: `ctx.openUpgrade(what)` opens the
|
|
11
|
+
upgrade page and sends it.
|
|
12
|
+
- **How fresh the levels are:** the GEX Levels legend ends with `As of 11:59 ET`, the time the newest levels were
|
|
13
|
+
computed (the row's `as_of`). While a session trades, levels more than 10 minutes behind the newest regular-hours
|
|
14
|
+
candle, or from the previous session, turn amber and go first on the line (`As of 11:40 ET (delayed 15 min)`); levels
|
|
15
|
+
that stopped before the newest candle get a line of their own (`⚠ GEX levels delayed 25 min: last update 11:30 ET`).
|
|
16
|
+
A past session is not checked.
|
|
17
|
+
- New event **`flashalpha:change`** on the container (it bubbles) after the symbol, interval, range, session or layers
|
|
18
|
+
changed, by the reader or by a method; `event.detail` is `{ symbol, resolution, range, session, layers }`. In a layout
|
|
19
|
+
each chart sends its own.
|
|
20
|
+
- Without a key, the box over the chart (`upsell: true`) says **Sign up free** and links to `signupUrl`, like the legend's
|
|
21
|
+
"Not in your plan" line (it said Upgrade).
|
|
22
|
+
- Level events are measured against the levels the chart draws: on settled open interest each session's levels from
|
|
23
|
+
the open, so a wall no longer "moves" every few minutes; on live open interest a level moves once the new strike has
|
|
24
|
+
held for 5 minutes (chart API).
|
|
25
|
+
|
|
3
26
|
## 1.1.0 — 2026-11-25
|
|
4
27
|
|
|
5
28
|
- **Level events** (FlashAlpha layer `events`, Growth) is released: markers on the candles where the price was rejected
|
package/README.md
CHANGED
|
@@ -152,6 +152,8 @@ The core indicator. It draws the levels options traders watch most, bar by bar t
|
|
|
152
152
|
`Regime −γ (dealers amplify moves)`.
|
|
153
153
|
- **Never lose an off-screen level.** A level outside the visible range is pinned to the chart edge with its distance,
|
|
154
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)`.
|
|
155
157
|
- **Broken-wall alerts (optional).** When a candle closes through a wall, the wall fades for the rest of the session and
|
|
156
158
|
a marker such as `Put wall broken 10:30` appears on the bar.
|
|
157
159
|
- **Previous-session levels.** On daily and weekly bars, each session shows the prior close's levels as dashed lines.
|
|
@@ -729,6 +731,31 @@ The event bubbles, and `event.detail` has `symbol` and `error`. For example, you
|
|
|
729
731
|
el.addEventListener('flashalpha:nodata', () => { el.closest('section').hidden = true; });
|
|
730
732
|
```
|
|
731
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
|
+
|
|
732
759
|
---
|
|
733
760
|
|
|
734
761
|
## Core layers and FlashAlpha layers
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tradingview-gex-flashalpha v1.
|
|
1
|
+
/*! tradingview-gex-flashalpha v1.2.0 | MIT | https://github.com/FlashAlpha-lab/tradingview-gex-flashalpha */
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -362,8 +362,11 @@ function setLicenseKey(key) {
|
|
|
362
362
|
licenseKey = key || null;
|
|
363
363
|
}
|
|
364
364
|
var getLicenseKey = () => licenseKey;
|
|
365
|
+
var siteOf = (host) => String(host || "").toLowerCase().replace(/^www\./, "");
|
|
365
366
|
function upgradeHref(upgradeUrl, what, campaign = "upgrade") {
|
|
366
|
-
const
|
|
367
|
+
const here = global.location;
|
|
368
|
+
const u = new URL(upgradeUrl, here ? here.href : void 0);
|
|
369
|
+
if (here && here.hostname && siteOf(u.hostname) === siteOf(here.hostname)) return u.toString();
|
|
367
370
|
u.searchParams.set("utm_source", "chart");
|
|
368
371
|
u.searchParams.set("utm_medium", "embed");
|
|
369
372
|
u.searchParams.set("utm_campaign", campaign);
|
|
@@ -552,6 +555,8 @@ var LevelsOverlay = class {
|
|
|
552
555
|
|
|
553
556
|
// src/plugins/levels.js
|
|
554
557
|
var CORE_INDICATOR = "GEX Levels";
|
|
558
|
+
var STALE_MINUTES = 10;
|
|
559
|
+
var STALE_COLOR = "#f59e0b";
|
|
555
560
|
var dailyQuery = (q) => (q.scope || "all") === "all" && (q.basis || "settled") === "settled";
|
|
556
561
|
var WALLS = [
|
|
557
562
|
{ id: "callWall", broken: "callWallBroken", field: "call_wall", title: "Call wall", through: (close, wall) => close > wall, position: "aboveBar", shape: "arrowUp" },
|
|
@@ -617,6 +622,20 @@ var levelsPlugin = {
|
|
|
617
622
|
}
|
|
618
623
|
}
|
|
619
624
|
const newSession = (a, b) => dayOf2(a.time) !== dayOf2(b.time);
|
|
625
|
+
function freshness() {
|
|
626
|
+
const rows = ctx.exposure, row = rows[rows.length - 1];
|
|
627
|
+
if (!ctx.intraday() || !row) return null;
|
|
628
|
+
const at = row.as_of ? etTime(row.as_of) : row.time;
|
|
629
|
+
let bar = null;
|
|
630
|
+
for (let i = ctx.bars.length - 1; i >= 0 && !bar; i--) if (sessionOf(ctx.bars[i].time) === "rth") bar = ctx.bars[i];
|
|
631
|
+
const step = { "1m": 60, "5m": 300, "15m": 900, "1h": 3600 }[ctx.resolution] || 60;
|
|
632
|
+
const trading = !!bar && etTime((/* @__PURE__ */ new Date()).toISOString()) - (bar.time + step) < STALE_MINUTES * 60;
|
|
633
|
+
const lag = trading ? Math.round((bar.time - at) / 60) : 0;
|
|
634
|
+
const late = !trading ? "" : dayOf2(bar.time) !== dayOf2(at) ? "from the previous session" : lag > STALE_MINUTES ? `delayed ${lag} min` : "";
|
|
635
|
+
const clock = `${dayOf2(at) === dayOf2(bar ? bar.time : at) ? "" : fmtDay.format(new Date(at * 1e3)) + " "}${fmtClock.format(new Date(at * 1e3))} ET`;
|
|
636
|
+
return { row, at, clock, late, bar };
|
|
637
|
+
}
|
|
638
|
+
const levelsOn = () => ["levels", "maxpain"].some(ctx.on);
|
|
620
639
|
function flatLines(id, points, split, style) {
|
|
621
640
|
const st = ctx.styleOf(id);
|
|
622
641
|
if (st.visible === false) return [];
|
|
@@ -847,6 +866,15 @@ var levelsPlugin = {
|
|
|
847
866
|
const dm = g.max_pain == null && g.time < dailyCut.maxPain ? dailyByTime.get(g.time) : null;
|
|
848
867
|
if (ctx.on("maxpain") && dm && dm.max_pain != null) parts.push({ label: "Max pain (daily)", value: dm.max_pain, plot: "maxPain" });
|
|
849
868
|
else if (ctx.on("maxpain")) parts.push({ label: "Max pain", value: g.max_pain, prev: prev && prev.max_pain, plot: "maxPain" });
|
|
869
|
+
const fresh = levelsOn() ? freshness() : null;
|
|
870
|
+
if (fresh && fresh.row === g && fresh.late) parts.unshift({ label: "As of", value: fresh.clock, color: STALE_COLOR, note: fresh.late });
|
|
871
|
+
else if (fresh && fresh.row === g) parts.push({ label: "As of", value: fresh.clock });
|
|
872
|
+
},
|
|
873
|
+
// The levels stopped before the newest bar (no exposure row there, so no levels line values): a line says so.
|
|
874
|
+
legend(time) {
|
|
875
|
+
const f = levelsOn() ? freshness() : null;
|
|
876
|
+
if (!f || !f.late || !f.bar || time !== f.bar.time || f.row.time === f.bar.time) return [];
|
|
877
|
+
return [`⚠ GEX levels ${f.late}: last update ${f.clock}`];
|
|
850
878
|
}
|
|
851
879
|
};
|
|
852
880
|
}
|
|
@@ -1521,11 +1549,15 @@ function createToolbar(view) {
|
|
|
1521
1549
|
account.textContent = PLAN_NAMES[plan] || state.plan;
|
|
1522
1550
|
account.title = `Your plan: ${PLAN_NAMES[plan] || state.plan}`;
|
|
1523
1551
|
account.href = view.upgradeHref("account");
|
|
1552
|
+
account.setAttribute("data-fac-cta", "upgrade");
|
|
1553
|
+
account.setAttribute("data-fac-content", "account");
|
|
1524
1554
|
} else {
|
|
1525
1555
|
account.className = "fac-account fac-signup";
|
|
1526
1556
|
account.textContent = "Sign up";
|
|
1527
1557
|
account.title = "Create a free FlashAlpha account";
|
|
1528
1558
|
account.href = view.signupHref();
|
|
1559
|
+
account.setAttribute("data-fac-cta", "signup");
|
|
1560
|
+
account.setAttribute("data-fac-content", "toolbar");
|
|
1529
1561
|
}
|
|
1530
1562
|
account.hidden = false;
|
|
1531
1563
|
}
|
|
@@ -1783,7 +1815,7 @@ function createLegend(view, chart) {
|
|
|
1783
1815
|
return i < 0 ? Infinity : i;
|
|
1784
1816
|
};
|
|
1785
1817
|
const gatedNames = [...new Set(data.notes.concat(extra).filter(isGated).map((x) => String(x.gated)))].sort((a, b2) => menuAt(a) - menuAt(b2));
|
|
1786
|
-
const gatedLine = !gatedNames.length ? "" : `<div class="sub fac-lg-gated">Not in your plan: ${esc(gatedNames.join(", "))} ` + (view.state.noKey ? `<a class="fac-lg-up" href="${esc(view.signupHref("legend"))}" target="_blank" rel="noopener">Sign up</a>` : `<a class="fac-lg-up" href="${esc(view.upgradeHref("legend"))}" target="_blank" rel="noopener">Upgrade</a>`) + "</div>";
|
|
1818
|
+
const gatedLine = !gatedNames.length ? "" : `<div class="sub fac-lg-gated">Not in your plan: ${esc(gatedNames.join(", "))} ` + (view.state.noKey ? `<a class="fac-lg-up" href="${esc(view.signupHref("legend"))}" ${view.ctaAttrs("legend", "signup")} target="_blank" rel="noopener">Sign up</a>` : `<a class="fac-lg-up" href="${esc(view.upgradeHref("legend"))}" ${view.ctaAttrs("legend")} target="_blank" rel="noopener">Upgrade</a>`) + "</div>";
|
|
1787
1819
|
lines.push(...extra.filter((x) => !isGated(x)));
|
|
1788
1820
|
const notes = data.notes.filter((x) => !isGated(x));
|
|
1789
1821
|
if (notes.length) lines.push(notes.join(" · "));
|
|
@@ -1812,7 +1844,7 @@ function createUpsell(view) {
|
|
|
1812
1844
|
}
|
|
1813
1845
|
const need = wanted.map((k) => layerPlan[k]).sort((a, b) => planRank(a) - planRank(b))[0];
|
|
1814
1846
|
const names = layerList.filter(([k]) => wanted.includes(k) && layerPlan[k] === need).map(([, l]) => l);
|
|
1815
|
-
box.innerHTML = `<span>🔒 ${esc(names.slice(0, 2).join(", "))}${names.length > 2 ? ` +${names.length - 2}` : ""}</span>` + (PLAN_PITCH[need] ? `<span class="pitch">${esc(PLAN_PITCH[need])}</span>` : "") + `<span class="plan">${esc(PLAN_NAMES[need] || need)}</span
|
|
1847
|
+
box.innerHTML = `<span>🔒 ${esc(names.slice(0, 2).join(", "))}${names.length > 2 ? ` +${names.length - 2}` : ""}</span>` + (PLAN_PITCH[need] ? `<span class="pitch">${esc(PLAN_PITCH[need])}</span>` : "") + `<span class="plan">${esc(PLAN_NAMES[need] || need)}</span>` + (view.state.noKey ? `<a href="${esc(view.signupHref("upsell"))}" ${view.ctaAttrs("upsell", "signup")} target="_blank" rel="noopener">Sign up free</a>` : `<a href="${esc(view.upgradeHref(wanted[0]))}" ${view.ctaAttrs(wanted[0])} target="_blank" rel="noopener">Upgrade</a>`);
|
|
1816
1848
|
box.hidden = false;
|
|
1817
1849
|
}
|
|
1818
1850
|
return { render };
|
|
@@ -1842,7 +1874,7 @@ function createEmptyState(view) {
|
|
|
1842
1874
|
return;
|
|
1843
1875
|
}
|
|
1844
1876
|
if (error === "api_key_required") {
|
|
1845
|
-
box.innerHTML = `${PREVIEW}<div class="fac-gate-box">${ICONS.lock}<p class="fac-gate-ttl">${esc(GATE.title(state.symbol))}</p><p class="fac-gate-txt">${esc(GATE.text)}</p><a class="fac-gate-cta" href="${esc(view.signupHref("gate"))}" target="_blank" rel="noopener">${ICONS.key}${esc(GATE.cta)}</a></div>`;
|
|
1877
|
+
box.innerHTML = `${PREVIEW}<div class="fac-gate-box">${ICONS.lock}<p class="fac-gate-ttl">${esc(GATE.title(state.symbol))}</p><p class="fac-gate-txt">${esc(GATE.text)}</p><a class="fac-gate-cta" href="${esc(view.signupHref("gate"))}" ${view.ctaAttrs("gate", "signup")} target="_blank" rel="noopener">${ICONS.key}${esc(GATE.cta)}</a></div>`;
|
|
1846
1878
|
} else {
|
|
1847
1879
|
box.textContent = (error === "unknown_symbol" || error === "no bars") && state.symbol ? `No chart data for ${state.symbol} yet.` : ERRORS[error] || "Chart data is unavailable right now.";
|
|
1848
1880
|
}
|
|
@@ -1939,14 +1971,14 @@ function createIndicators(view) {
|
|
|
1939
1971
|
const planName = (p) => PLAN_NAMES[p] || p;
|
|
1940
1972
|
function layerRow(k, label, bold = false) {
|
|
1941
1973
|
const plan = view.layerPlan[k] || "free", name = bold ? `<b>${esc(label)}</b>` : esc(label);
|
|
1942
|
-
if (view.locked(k)) return `<a class="fac-lock" href="${esc(view.upgradeHref(k))}" target="_blank" rel="noopener">🔒 ${name} <span class="plan">${esc(planName(plan))}</span></a>`;
|
|
1974
|
+
if (view.locked(k)) return `<a class="fac-lock" href="${esc(view.upgradeHref(k))}" ${view.ctaAttrs(k)} target="_blank" rel="noopener">🔒 ${name} <span class="plan">${esc(planName(plan))}</span></a>`;
|
|
1943
1975
|
return `<label><input type="checkbox" data-layer="${esc(k)}" ${view.active(k) ? "checked" : ""}> ${name}</label>`;
|
|
1944
1976
|
}
|
|
1945
1977
|
function toggleGroup(g, wanted, input) {
|
|
1946
1978
|
if (wanted && g.layers.length && g.layers.every(([k]) => view.locked(k))) {
|
|
1947
1979
|
input.checked = false;
|
|
1948
1980
|
const [k] = g.layers.slice().sort(([a], [b]) => planRank(view.layerPlan[a]) - planRank(view.layerPlan[b]))[0];
|
|
1949
|
-
|
|
1981
|
+
view.openUpgrade(k);
|
|
1950
1982
|
return;
|
|
1951
1983
|
}
|
|
1952
1984
|
return view.setGroup(g, wanted);
|
|
@@ -2422,6 +2454,15 @@ function mountChart(container, options2, hooks = {}) {
|
|
|
2422
2454
|
const s = $(".fac-status");
|
|
2423
2455
|
if (s) s.textContent = o.debug ? text : "";
|
|
2424
2456
|
};
|
|
2457
|
+
const upgradeEvent = (campaign, content, href) => container.dispatchEvent(new CustomEvent("flashalpha:upgrade", {
|
|
2458
|
+
bubbles: true,
|
|
2459
|
+
detail: { campaign, content: content || null, href, symbol: state.symbol }
|
|
2460
|
+
}));
|
|
2461
|
+
const ctaClick = (e) => {
|
|
2462
|
+
const a = e.target && e.target.closest ? e.target.closest("a[data-fac-cta]") : null;
|
|
2463
|
+
if (a) upgradeEvent(a.getAttribute("data-fac-cta"), a.getAttribute("data-fac-content"), a.href);
|
|
2464
|
+
};
|
|
2465
|
+
root.addEventListener("click", ctaClick, true);
|
|
2425
2466
|
const view = {
|
|
2426
2467
|
container,
|
|
2427
2468
|
root,
|
|
@@ -2438,6 +2479,14 @@ function mountChart(container, options2, hooks = {}) {
|
|
|
2438
2479
|
frame: () => hooks.frame && hooks.frame() || root,
|
|
2439
2480
|
upgradeHref: (what) => upgradeHref(o.upgradeUrl, what),
|
|
2440
2481
|
signupHref: (what = "toolbar") => upgradeHref(o.signupUrl, what, "signup"),
|
|
2482
|
+
/** The data-fac-cta / data-fac-content attributes of a Sign up ('signup') or Upgrade link, for ctaClick. */
|
|
2483
|
+
ctaAttrs: (what, campaign = "upgrade") => `data-fac-cta="${esc(campaign)}" data-fac-content="${esc(what || "")}"`,
|
|
2484
|
+
/** Opens the upgrade page in a new tab (a prompt that is not a link) and tells the page. */
|
|
2485
|
+
openUpgrade(what) {
|
|
2486
|
+
const href = view.upgradeHref(what);
|
|
2487
|
+
upgradeEvent("upgrade", what, href);
|
|
2488
|
+
global.open(href, "_blank", "noopener");
|
|
2489
|
+
},
|
|
2441
2490
|
call,
|
|
2442
2491
|
api: null,
|
|
2443
2492
|
applySetting: null,
|
|
@@ -2560,6 +2609,7 @@ function mountChart(container, options2, hooks = {}) {
|
|
|
2560
2609
|
on,
|
|
2561
2610
|
lockedPlan,
|
|
2562
2611
|
upgradeHref: view.upgradeHref,
|
|
2612
|
+
openUpgrade: view.openUpgrade,
|
|
2563
2613
|
/** True for a layer that is on but hidden with the legend's 👁 (on() is false for it): e.g. keep its pane, empty. */
|
|
2564
2614
|
hidden: hiddenLayer,
|
|
2565
2615
|
/** True when the last load's answer gave API layer `apiLayer` as status "gated" (the key's plan does not include it). */
|
|
@@ -3236,8 +3286,13 @@ function mountChart(container, options2, hooks = {}) {
|
|
|
3236
3286
|
const stale = Date.now() - newest > Math.max(2 * (RES_SECONDS[state.res] || 60) * 1e3, 12e4);
|
|
3237
3287
|
if (lr.to > data.bars.length - 1 - EDGE / 2 && stale && Date.now() - lazy.newerAt > 6e4) loadNewer();
|
|
3238
3288
|
});
|
|
3289
|
+
const announce = () => container.dispatchEvent(new CustomEvent("flashalpha:change", {
|
|
3290
|
+
bubbles: true,
|
|
3291
|
+
detail: { symbol: state.symbol, resolution: state.res, range: state.days, session: o.session, layers: [...state.layers] }
|
|
3292
|
+
}));
|
|
3239
3293
|
const changed = (p) => {
|
|
3240
3294
|
if (hooks.changed) hooks.changed(api);
|
|
3295
|
+
announce();
|
|
3241
3296
|
return p;
|
|
3242
3297
|
};
|
|
3243
3298
|
const api = {
|
|
@@ -3246,6 +3301,7 @@ function mountChart(container, options2, hooks = {}) {
|
|
|
3246
3301
|
toolbar.render();
|
|
3247
3302
|
const p = load();
|
|
3248
3303
|
if (hooks.symbol) hooks.symbol(x, api);
|
|
3304
|
+
announce();
|
|
3249
3305
|
return p;
|
|
3250
3306
|
},
|
|
3251
3307
|
setResolution(r) {
|
|
@@ -3307,7 +3363,9 @@ function mountChart(container, options2, hooks = {}) {
|
|
|
3307
3363
|
/** For a chart group: the toolbar, time bar and credit line, and where they are now (see `outside`). */
|
|
3308
3364
|
_parts: () => ({ bar: root.querySelector(".fac-bar"), time: root.querySelector(".fac-timebar"), credit: root.querySelector(".fac-credit") }),
|
|
3309
3365
|
_outside(list) {
|
|
3366
|
+
outside.forEach((el) => el.removeEventListener("click", ctaClick, true));
|
|
3310
3367
|
outside = list.filter(Boolean);
|
|
3368
|
+
outside.forEach((el) => el.addEventListener("click", ctaClick, true));
|
|
3311
3369
|
},
|
|
3312
3370
|
_closeMenus: () => view.closeMenus(),
|
|
3313
3371
|
/** The key's plan from the last answer ('free', 'basic', ...), or null before it / without auth. */
|
|
@@ -3649,7 +3707,7 @@ function mount(container, options2) {
|
|
|
3649
3707
|
|
|
3650
3708
|
// src/index.js
|
|
3651
3709
|
var plans = PLANS;
|
|
3652
|
-
var version = true ? "1.
|
|
3710
|
+
var version = true ? "1.2.0" : "0.0.0-dev";
|
|
3653
3711
|
var FlashAlphaChart = {
|
|
3654
3712
|
mount,
|
|
3655
3713
|
chartEngineSource,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! tradingview-gex-flashalpha v1.
|
|
1
|
+
/*! tradingview-gex-flashalpha v1.2.0 | MIT | https://github.com/FlashAlpha-lab/tradingview-gex-flashalpha */
|
|
2
2
|
.fac{background:var(--fac-bg,#0f1115);width:100%;height:100%;min-height:240px;color:var(--fac-text,#d6d9e0);flex-direction:column;font:12px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;display:flex;position:relative}.fac a.fac-lock,.fac-grp a.fac-lock{color:var(--fac-muted,#8a909c);white-space:nowrap;border-radius:4px;align-items:center;gap:6px;padding:4px 6px;text-decoration:none;display:flex}.fac a.fac-lock:hover,.fac-grp a.fac-lock:hover{background:var(--fac-line,#262a33);color:var(--fac-text,#d6d9e0)}.fac-lock .plan,.fac-upsell .plan{background:var(--fac-accent,#4f8cff);color:#fff;border-radius:3px;padding:1px 5px;font-size:10px}.fac-more{border-top:1px solid var(--fac-line,#262a33);flex-direction:column;gap:6px;margin-top:4px;padding:6px 6px 2px;display:none}.fac-more:not(:empty){display:flex}.fac-more select{max-width:none}.fac-upsell{z-index:5;border:1px solid var(--fac-line,#262a33);background:var(--fac-bg,#0f1115);color:var(--fac-text,#d6d9e0);box-shadow:0 2px 10px var(--fac-shadow,#0006);border-radius:6px;align-items:center;gap:8px;padding:4px 6px 4px 10px;display:flex;position:absolute;top:6px;right:64px}.fac-upsell[hidden]{display:none}.fac-upsell a{background:var(--fac-accent,#4f8cff);color:#fff;border-radius:4px;padding:3px 10px;font-weight:600;text-decoration:none}.fac-narrow .fac-upsell{top:auto;bottom:34px;left:8px;right:auto}.fac-bar{border-bottom:1px solid var(--fac-line,#262a33);flex-wrap:wrap;align-items:center;gap:8px;padding:6px 8px;display:flex}.fac-timebar{border-top:1px solid var(--fac-line,#262a33);flex-wrap:wrap;align-items:center;gap:4px 8px;padding:3px 8px;display:flex}.fac-timebar .fac-group{border:0;padding:0}.fac-spacer{flex:1}.fac-clock{color:var(--fac-muted,#8a909c);font-variant-numeric:tabular-nums;white-space:nowrap}.fac-narrow .fac-clock{display:none}.fac-group{border:1px solid var(--fac-line,#262a33);border-radius:6px;gap:2px;padding:2px;display:flex}.fac-group button,.fac-menu>button{color:var(--fac-muted,#8a909c);cursor:pointer;font:inherit;background:0 0;border:0;border-radius:4px;padding:3px 8px}.fac-group button:hover,.fac-menu>button:hover{color:var(--fac-text,#d6d9e0)}.fac select option,.fac-grp select option{background:var(--fac-bg,#0f1115);color:var(--fac-text,#d6d9e0)}.fac-group button.on{background:var(--fac-accent,#4f8cff);color:#fff}.fac select,.fac-grp select{color:inherit;border:1px solid var(--fac-line,#262a33);font:inherit;background:0 0;border-radius:6px;max-width:170px;padding:3px 4px}.fac-menu{border:1px solid var(--fac-line,#262a33);border-radius:6px;position:relative}.fac-menu>button{color:var(--fac-text,#d6d9e0)}.fac-panel{z-index:10;background:var(--fac-bg,#0f1115);border:1px solid var(--fac-line,#262a33);border-radius:6px;min-width:190px;padding:6px;display:none;position:absolute;top:calc(100% + 4px);left:0;box-shadow:0 6px 24px #0006}.fac-menu.open .fac-panel{display:block}.fac-panel label{cursor:pointer;white-space:nowrap;border-radius:4px;align-items:center;gap:8px;padding:4px 6px;display:flex}.fac-panel label:hover{background:var(--fac-line,#262a33)}.fac-status{color:var(--fac-muted,#8a909c)}.fac-body{flex:1;min-height:0;position:relative}.fac-canvas{position:absolute;top:0;bottom:0;left:0;right:0}.fac-legend{top:6px;left:calc(10px + var(--fac-axis-left,0px));right:calc(var(--fac-plot-right,0px) + 6px);z-index:3;pointer-events:none;font-variant-numeric:tabular-nums;position:absolute}.fac-legend b{margin-right:6px;font-size:14px}.fac-legend .k{color:var(--fac-muted,#8a909c);margin-left:6px}.fac-legend .up{color:#26a69a}.fac-legend .dn{color:#ef5350}.fac-legend .sub{color:var(--fac-muted,#8a909c);margin-top:2px}.fac-empty{z-index:4;text-align:center;color:var(--fac-muted,#8a909c);background:var(--fac-bg,#0f1115);justify-content:center;align-items:center;padding:16px;display:none;position:absolute;top:0;bottom:0;left:0;right:0}.fac-empty.fac-gate{padding:0;overflow:hidden}.fac-gate-bg{filter:blur(6px);opacity:.35;pointer-events:none;width:100%;height:100%;position:absolute;top:0;bottom:0;left:0;right:0}.fac-gate-box{background:var(--fac-shade,#0f111599);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);flex-direction:column;justify-content:center;align-items:center;padding:16px;display:flex;position:absolute;top:0;bottom:0;left:0;right:0;overflow:auto}.fac-gate-box>svg{width:40px;height:40px;color:var(--fac-muted,#8a909c);flex:none;margin-bottom:12px}.fac-gate-ttl{color:var(--fac-text,#d6d9e0);margin:0 0 4px;font-size:16px;font-weight:600;line-height:1.4}.fac-gate-txt{max-width:384px;color:var(--fac-muted,#8a909c);margin:0 0 16px;font-size:13px;line-height:1.5}.fac-gate-cta{color:#fff;background:var(--fac-accent,#4f8cff);border-radius:8px;align-items:center;gap:8px;padding:10px 20px;font-size:13px;font-weight:600;text-decoration:none;display:inline-flex;box-shadow:0 8px 20px -6px #4f8cff73}.fac-gate-cta:hover{filter:brightness(1.1)}.fac-gate-cta svg{width:16px;height:16px}.fac-narrow .fac-gate-ttl{font-size:14px}.fac-narrow .fac-gate-txt{margin-bottom:12px;font-size:12px}.fac-narrow .fac-gate-box>svg{width:32px;height:32px;margin-bottom:8px}.fac-narrow .fac-status{display:none}.fac-narrow .fac-group button,.fac-narrow .fac-menu>button{min-width:32px;min-height:32px;padding:3px 7px}.fac-credit{justify-content:space-between;align-items:center;gap:8px;padding:2px 10px 4px;font-size:10px;display:flex}.fac-credit a{color:var(--fac-muted,#8a909c);text-decoration:none}.fac-credit a:hover{text-decoration:underline}.fac-body>.fac-brand{left:calc(10px + var(--fac-axis-left,0px));z-index:3;color:var(--fac-text,#d6d9e0);opacity:.55;align-items:center;gap:5px;font:600 12px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;text-decoration:none;display:flex;position:absolute;bottom:34px}.fac-body>.fac-brand:hover{opacity:1}.fac-body>.fac-brand img{height:16px}.fac-narrow .fac-body>.fac-brand span{display:none}.fac select,.fac select option,.fac select optgroup,.fac-grp select,.fac-grp select option,.fac-grp select optgroup{background-color:var(--fac-bg,#0f1115);color:var(--fac-text,#d6d9e0)}.fac-panel .fac-field{color:var(--fac-muted,#8a909c);cursor:default;white-space:normal;flex-direction:column;align-items:stretch;gap:3px;padding:2px 6px;font-size:11px;display:flex}.fac-panel .fac-field:hover{background:0 0}.fac-field select{width:100%;max-width:none;color:var(--fac-text,#d6d9e0)}.fac-panel{min-width:230px}.fac-credit .fac-brand{color:var(--fac-text,#d6d9e0);opacity:.8;align-items:center;gap:5px;font:600 12px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;display:flex}.fac-credit .fac-brand:hover{opacity:1;text-decoration:none}.fac-brand img{width:auto;height:16px}.fac-note{text-align:center;min-width:0;color:var(--fac-muted,#8a909c);text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.fac-narrow .fac-note{white-space:normal;text-overflow:clip;line-height:1.3}.fac-empty.fac-loading{pointer-events:none;background:0 0}.fac-busy{z-index:5;border:1px solid var(--fac-line,#262a33);background:var(--fac-bg,#0f1115);color:var(--fac-muted,#8a909c);pointer-events:none;opacity:0;border-radius:10px;padding:2px 10px;font-size:12px;transition:opacity .15s;position:absolute;top:8px;left:50%;transform:translate(-50%)}.fac-busy.on{opacity:1;transition-delay:.2s}.fac-upsell .pitch{color:var(--fac-muted,#8a909c);max-width:260px}.fac-narrow .fac-upsell .pitch{display:none}.fac-panel{overflow-y:auto}.fac-dd-btn{align-items:center;gap:5px;display:inline-flex}.fac-dd-btn svg{width:16px;height:16px;color:var(--fac-muted,#8a909c)}.fac-dd-btn b{font-weight:700}.fac-menu.open>button,.fac-dd-btn:hover{background:var(--fac-line,#262a33)}.fac-menu.open .fac-sym-panel{flex-direction:column;display:flex}.fac-sym-panel{width:250px;min-width:0;overflow:hidden}.fac-dd .fac-panel:not(.fac-sym-panel){min-width:150px}.fac-search{box-sizing:border-box;width:100%;color:inherit;border:1px solid var(--fac-line,#262a33);font:inherit;background:0 0;border-radius:4px;outline:none;margin-bottom:4px;padding:5px 8px}.fac-search:focus{border-color:var(--fac-accent,#4f8cff)}.fac-list{flex:1;min-height:0;max-height:280px;overflow-y:auto}.fac-opt{cursor:pointer;white-space:nowrap;border-radius:4px;justify-content:space-between;gap:14px;padding:5px 8px;display:flex}.fac-opt:hover,.fac-opt.active{background:var(--fac-line,#262a33)}.fac-opt.on{color:var(--fac-accent,#4f8cff);font-weight:600}.fac-hint{text-overflow:ellipsis;min-width:0;color:var(--fac-muted,#8a909c);font-weight:400;overflow:hidden}.fac-none{color:var(--fac-muted,#8a909c);padding:6px 8px}.fac-right{align-items:center;gap:2px;display:flex}.fac-right .fac-menu{border:0}.fac-icon{width:30px;height:28px;color:var(--fac-muted,#8a909c);cursor:pointer;background:0 0;border:0;border-radius:4px;justify-content:center;align-items:center;padding:0;display:inline-flex}.fac-menu>button.fac-icon{color:var(--fac-muted,#8a909c);padding:0}.fac-icon:hover,.fac-menu.open>button.fac-icon{background:var(--fac-line,#262a33);color:var(--fac-text,#d6d9e0)}.fac-icon[hidden],.fac-account[hidden]{display:none}.fac-ttl{padding:2px 6px 6px;font-weight:600}.fac-sec{color:var(--fac-muted,#8a909c);letter-spacing:.06em;text-transform:uppercase;padding:8px 6px 2px;font-size:10px;font-weight:600}.fac-ttl+.fac-sec{padding-top:0}.fac-type .fac-dd-btn svg{color:currentColor;width:18px;height:18px}.fac-type-opt{align-items:center;gap:8px;display:inline-flex}.fac-type-opt svg{flex:none;width:18px;height:18px}.fac-scale-btns button{padding:3px 6px}.fac-feed{white-space:nowrap;border-radius:10px;margin-left:6px;padding:2px 8px;font-size:12px;font-weight:600}.fac-feed[hidden]{display:none}.fac-delayed{color:#d97706;background:#d9770626}.fac-live{color:#26a69a;background:#26a69a26}.fac-account{white-space:nowrap;border-radius:6px;margin-left:6px;padding:4px 12px;font-weight:600;text-decoration:none}.fac-signup{background:var(--fac-accent,#4f8cff);color:#fff}.fac-signup:hover{filter:brightness(1.1)}.fac-tier{border:1px solid var(--fac-line,#262a33);color:var(--fac-text,#d6d9e0)}.fac-tier:hover{border-color:var(--fac-accent,#4f8cff)}.fac-nolegend .fac-legend,.fac-nolegend .fac-pane-lgs{display:none}.fac-fullscreen{width:100vw;height:100vh}.fac-narrow .fac-icon{width:32px;height:32px}.fac-narrow .fac-account{margin-left:2px;padding:4px 8px}.fac-narrow .fac-feed{margin-left:2px;padding:2px 6px;font-size:11px}.fac-narrow .fac-sym-panel{width:220px}.fac-legend .lv{white-space:nowrap;flex-wrap:nowrap;gap:0 12px;display:flex}.fac-legend .lv>*{flex:none}.fac-legend .lv>[hidden]{display:none}.fac-legend .fac-lg-top,.fac-legend .lv,.fac-legend>.sub:not(.fac-lg-foldrow){box-sizing:border-box;background:linear-gradient(var(--fac-shade,#0f111599), var(--fac-shade,#0f111599)), var(--fac-shade,#0f111599);border-radius:3px;width:-moz-fit-content;width:fit-content;max-width:100%;margin-left:-4px;padding:0 4px}.fac-legend .fac-lg-top{display:block}.fac-lg-more{pointer-events:auto;cursor:help;color:var(--fac-muted,#8a909c)}.fac-lg-foldrow{margin-top:2px}.fac-lg-btn.fac-lg-fold{border:1px solid var(--fac-line,#262a33);background:var(--fac-bg,#0f1115);width:auto;min-width:22px;height:18px;font:inherit;gap:2px;padding:0 4px;font-size:11px}.fac-lg-fold svg{width:14px;height:14px}.fac-lg-fold.on svg{transform:rotate(180deg)}.fac-legend .lv .k{margin-left:0}.fac-legend .ch{color:var(--fac-muted,#8a909c)}.fac-fx{margin-right:2px;font-family:Georgia,serif;font-style:italic;font-weight:700}.fac-ind-menu .fac-panel{min-width:270px}.fac-ind+.fac-ind{border-top:1px solid var(--fac-line,#262a33);margin-top:4px;padding-top:4px}.fac-ind-head{align-items:center;gap:4px;display:flex}.fac-ind-head label{flex:1;min-width:0}.fac-ind-head b{text-overflow:ellipsis;overflow:hidden}.fac-ind-head .fac-icon{flex:none;width:26px;height:24px}.fac-ind-head .fac-icon svg,.fac-lg-btn svg{width:15px;height:15px}.fac-ind-layers{padding-left:22px}.fac-ind-one .fac-ind-row b{text-overflow:ellipsis;overflow:hidden}.fac-ind-row{align-items:center;gap:2px;display:flex}.fac-ind-row>:first-child{flex:1;min-width:0}.fac-ind-row .fac-icon{width:26px;height:24px;color:var(--fac-muted,#8a909c);flex:none}.fac-ind-row .fac-icon svg{width:15px;height:15px}.fac-dlg-sub{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--fac-muted,#8a909c);flex:0 auto;font-size:11px;overflow:hidden}.fac-dlg-hint{color:var(--fac-muted,#8a909c);margin:0 0 4px;font-size:11px}.fac-panel .fac-lock .plan,.fac-dialog .fac-lock .plan{margin-left:auto}.fac-lg-name{color:var(--fac-text,#d6d9e0);font-weight:600}.fac-lg-head{pointer-events:auto;align-items:center;display:inline-flex;position:relative}.fac-lg-head .fac-lg-name{white-space:nowrap;min-width:64px}.fac-lg-btns{z-index:1;background:var(--fac-bg,#0f1115);visibility:hidden;border-radius:4px;align-items:center;gap:4px;padding:2px 2px 2px 6px;transition:visibility 0s linear .4s;display:inline-flex;position:absolute;top:50%;left:100%;transform:translateY(-50%)}.fac-lg-head:hover .fac-lg-btns,.fac-lg-head:focus-within .fac-lg-btns,.fac-lg-off .fac-lg-btns{visibility:visible;transition-delay:0s}.fac-lg-off .fac-lg-name{opacity:.5}.fac-lg-btn{pointer-events:auto;width:22px;height:22px;color:var(--fac-muted,#8a909c);cursor:pointer;background:0 0;border:0;border-radius:4px;justify-content:center;align-items:center;padding:0;display:inline-flex}.fac-lg-btn svg{width:16px;height:16px}.fac-lg-btn:hover{background:var(--fac-line,#262a33);color:var(--fac-text,#d6d9e0)}.fac-pane-lgs{z-index:3;pointer-events:none;position:absolute;top:0;bottom:0;left:0;right:0}.fac-legend.fac-pane-lg{top:0}@media (hover:none){.fac-lg-btns{visibility:visible;position:static;transform:none}.fac-legend .fac-lg-btns{display:none}}.fac-lg-note{pointer-events:auto;cursor:help;text-underline-offset:2px;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.fac-lg-up{pointer-events:auto;color:var(--fac-accent,#4f8cff);font-weight:600;text-decoration:none}.fac-lg-up:hover{text-decoration:underline}.fac-lg-info{pointer-events:auto;width:18px;height:18px;color:var(--fac-muted,#8a909c);cursor:help;background:0 0;border:0;border-radius:50%;justify-content:center;align-items:center;padding:0;display:inline-flex;position:relative}.fac-lg-info svg{width:14px;height:14px}.fac-lg-info:hover,.fac-lg-info.fac-tip-open{color:var(--fac-text,#d6d9e0)}.fac-lg-info:focus{outline:none}.fac-lg-info:focus-visible{outline:1px solid var(--fac-accent,#4f8cff)}.fac-lg-info .fac-tip{z-index:5;border:1px solid var(--fac-line,#262a33);background:var(--fac-bg,#0f1115);width:max-content;max-width:320px;color:var(--fac-text,#d6d9e0);text-align:left;white-space:pre-line;box-shadow:0 4px 14px var(--fac-shadow,#0006);border-radius:6px;margin-top:6px;padding:8px 10px;font-size:12px;font-weight:400;line-height:1.45;display:none;position:absolute;top:100%;left:0}.fac-lg-info:hover .fac-tip,.fac-lg-info.fac-tip-open .fac-tip{display:block}.fac-lg-info:focus-visible .fac-tip{display:block}.fac-lg-ramp{pointer-events:auto;cursor:help;color:var(--fac-muted,#8a909c);align-items:center;gap:4px;font-size:11px;display:inline-flex}.fac-lg-ramp i{border:1px solid var(--fac-line,#262a33);border-radius:2px;width:72px;height:8px;display:inline-block}.fac-dialog{z-index:20;background:#00000059;justify-content:center;align-items:center;padding:12px;display:flex;position:absolute;top:0;bottom:0;left:0;right:0}.fac-dialog[hidden]{display:none}.fac-dlg{border:1px solid var(--fac-line,#262a33);background:var(--fac-bg,#0f1115);width:min(440px,100%);max-height:100%;box-shadow:0 10px 40px var(--fac-shadow,#0006);border-radius:8px;flex-direction:column;display:flex}.fac-dlg-head{align-items:center;gap:8px;padding:10px 10px 6px 14px;font-size:14px;display:flex}.fac-dlg-head b{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.fac-dlg-head .fac-icon{font-size:20px;line-height:1}.fac-tabs{border-bottom:1px solid var(--fac-line,#262a33);gap:4px;padding:0 12px;display:flex}.fac-tabs button{color:var(--fac-muted,#8a909c);font:inherit;cursor:pointer;background:0 0;border:0;border-bottom:2px solid #0000;padding:6px 10px}.fac-tabs button.on{border-bottom-color:var(--fac-accent,#4f8cff);color:var(--fac-text,#d6d9e0)}.fac-dlg-body{flex:1;min-height:0;padding:8px 14px;overflow-y:auto}.fac-dlg-body label{cursor:pointer;align-items:center;gap:8px;padding:4px 0;display:flex}.fac-dlg-body a.fac-lock{padding:4px 0}.fac-dlg-sec{color:var(--fac-muted,#8a909c);text-transform:uppercase;letter-spacing:.04em;margin:8px 0 2px;font-size:11px}.fac-dlg-sec:first-child{margin-top:0}.fac-dlg-inputs .fac-field{color:var(--fac-muted,#8a909c);cursor:default;flex-direction:column;align-items:stretch;gap:3px;font-size:11px;display:flex}.fac-sty{align-items:center;gap:8px;padding:3px 0;display:flex}.fac-sty-name{flex:1;min-width:0}.fac-sty input[type=color]{border:1px solid var(--fac-line,#262a33);cursor:pointer;background:0 0;border-radius:4px;width:30px;height:22px;padding:0 2px}.fac-sty select{max-width:90px}.fac-dlg-foot{border-top:1px solid var(--fac-line,#262a33);align-items:center;gap:8px;padding:10px 14px;display:flex}.fac-dlg-foot button{border:1px solid var(--fac-line,#262a33);color:var(--fac-text,#d6d9e0);font:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:5px 12px}.fac-dlg-foot button:hover{border-color:var(--fac-accent,#4f8cff)}.fac-dlg-foot .fac-primary{border-color:var(--fac-accent,#4f8cff);background:var(--fac-accent,#4f8cff);color:#fff}.fac-narrow .fac-sty{flex-wrap:wrap}.fac-grp{background:var(--fac-bg,#0f1115);width:100%;height:100%;min-height:240px;color:var(--fac-text,#d6d9e0);flex-direction:column;font:12px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;display:flex;position:relative}.fac-grp-top{z-index:10;order:-1;position:relative}.fac-grp-grid{background:var(--fac-line,#262a33);flex:1;gap:1px;min-height:0;display:grid}.fac-cell{background:var(--fac-bg,#0f1115);min-width:0;min-height:0;display:flex;position:relative;overflow:hidden}.fac-cell[hidden]{display:none}.fac-cell>.fac{min-height:0}.fac-cell .fac-bar,.fac-cell .fac-timebar,.fac-cell .fac-credit{display:none}.fac-grp-multi .fac-cell.on:after{content:"";z-index:8;border:1px solid var(--fac-accent,#4f8cff);pointer-events:none;position:absolute;top:0;bottom:0;left:0;right:0}.fac-grp-single .fac-layouts{display:none}.fac-layouts>button{justify-content:center;align-items:center;display:inline-flex}.fac-layouts .fac-panel{white-space:nowrap;min-width:0}.fac-lay-row{border-top:1px solid var(--fac-line,#262a33);align-items:center;gap:2px;padding:4px 2px;display:flex}.fac-ttl+.fac-lay-row{border-top:0}.fac-lay-n{width:18px;color:var(--fac-muted,#8a909c);text-align:center;flex:none;font-size:11px}.fac-lay-row button{width:30px;height:26px;color:var(--fac-text,#d6d9e0);cursor:pointer;background:0 0;border:0;border-radius:4px;justify-content:center;align-items:center;padding:0;display:inline-flex}.fac-lay-row button:hover{background:var(--fac-line,#262a33)}.fac-lay-row button.on{background:var(--fac-text,#d6d9e0);color:var(--fac-bg,#0f1115)}.fac,.fac-grp{color-scheme:var(--fac-scheme,dark)}.fac input[type=checkbox],.fac input[type=radio],.fac-grp input[type=checkbox],.fac-grp input[type=radio]{all:revert}.fac select,.fac input[type=search],.fac-grp select,.fac-grp input[type=search]{-webkit-appearance:auto;appearance:auto;-webkit-print-color-adjust:economy;-moz-print-color-adjust:economy;print-color-adjust:economy}.fac select:focus,.fac input[type=search]:focus,.fac-grp select:focus,.fac-grp input[type=search]:focus{box-shadow:none}.fac select:focus,.fac-grp select:focus{outline:revert}.fac input[type=search]::placeholder,.fac-grp input[type=search]::placeholder{color:revert;opacity:revert}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tradingview-gex-flashalpha v1.
|
|
1
|
+
/*! tradingview-gex-flashalpha v1.2.0 | MIT | https://github.com/FlashAlpha-lab/tradingview-gex-flashalpha */
|
|
2
2
|
(() => {
|
|
3
3
|
// src/constants.js
|
|
4
4
|
var ET = "America/New_York";
|
|
@@ -332,8 +332,11 @@ ${apiKey || ""}`, hit = symbolsAnswers.get(k);
|
|
|
332
332
|
licenseKey = key || null;
|
|
333
333
|
}
|
|
334
334
|
var getLicenseKey = () => licenseKey;
|
|
335
|
+
var siteOf = (host) => String(host || "").toLowerCase().replace(/^www\./, "");
|
|
335
336
|
function upgradeHref(upgradeUrl, what, campaign = "upgrade") {
|
|
336
|
-
const
|
|
337
|
+
const here = global.location;
|
|
338
|
+
const u = new URL(upgradeUrl, here ? here.href : void 0);
|
|
339
|
+
if (here && here.hostname && siteOf(u.hostname) === siteOf(here.hostname)) return u.toString();
|
|
337
340
|
u.searchParams.set("utm_source", "chart");
|
|
338
341
|
u.searchParams.set("utm_medium", "embed");
|
|
339
342
|
u.searchParams.set("utm_campaign", campaign);
|
|
@@ -522,6 +525,8 @@ ${apiKey || ""}`, hit = symbolsAnswers.get(k);
|
|
|
522
525
|
|
|
523
526
|
// src/plugins/levels.js
|
|
524
527
|
var CORE_INDICATOR = "GEX Levels";
|
|
528
|
+
var STALE_MINUTES = 10;
|
|
529
|
+
var STALE_COLOR = "#f59e0b";
|
|
525
530
|
var dailyQuery = (q) => (q.scope || "all") === "all" && (q.basis || "settled") === "settled";
|
|
526
531
|
var WALLS = [
|
|
527
532
|
{ id: "callWall", broken: "callWallBroken", field: "call_wall", title: "Call wall", through: (close, wall) => close > wall, position: "aboveBar", shape: "arrowUp" },
|
|
@@ -587,6 +592,20 @@ ${apiKey || ""}`, hit = symbolsAnswers.get(k);
|
|
|
587
592
|
}
|
|
588
593
|
}
|
|
589
594
|
const newSession = (a, b) => dayOf2(a.time) !== dayOf2(b.time);
|
|
595
|
+
function freshness() {
|
|
596
|
+
const rows = ctx.exposure, row = rows[rows.length - 1];
|
|
597
|
+
if (!ctx.intraday() || !row) return null;
|
|
598
|
+
const at = row.as_of ? etTime(row.as_of) : row.time;
|
|
599
|
+
let bar = null;
|
|
600
|
+
for (let i = ctx.bars.length - 1; i >= 0 && !bar; i--) if (sessionOf(ctx.bars[i].time) === "rth") bar = ctx.bars[i];
|
|
601
|
+
const step = { "1m": 60, "5m": 300, "15m": 900, "1h": 3600 }[ctx.resolution] || 60;
|
|
602
|
+
const trading = !!bar && etTime((/* @__PURE__ */ new Date()).toISOString()) - (bar.time + step) < STALE_MINUTES * 60;
|
|
603
|
+
const lag = trading ? Math.round((bar.time - at) / 60) : 0;
|
|
604
|
+
const late = !trading ? "" : dayOf2(bar.time) !== dayOf2(at) ? "from the previous session" : lag > STALE_MINUTES ? `delayed ${lag} min` : "";
|
|
605
|
+
const clock = `${dayOf2(at) === dayOf2(bar ? bar.time : at) ? "" : fmtDay.format(new Date(at * 1e3)) + " "}${fmtClock.format(new Date(at * 1e3))} ET`;
|
|
606
|
+
return { row, at, clock, late, bar };
|
|
607
|
+
}
|
|
608
|
+
const levelsOn = () => ["levels", "maxpain"].some(ctx.on);
|
|
590
609
|
function flatLines(id, points, split, style) {
|
|
591
610
|
const st = ctx.styleOf(id);
|
|
592
611
|
if (st.visible === false) return [];
|
|
@@ -817,6 +836,15 @@ ${apiKey || ""}`, hit = symbolsAnswers.get(k);
|
|
|
817
836
|
const dm = g.max_pain == null && g.time < dailyCut.maxPain ? dailyByTime.get(g.time) : null;
|
|
818
837
|
if (ctx.on("maxpain") && dm && dm.max_pain != null) parts.push({ label: "Max pain (daily)", value: dm.max_pain, plot: "maxPain" });
|
|
819
838
|
else if (ctx.on("maxpain")) parts.push({ label: "Max pain", value: g.max_pain, prev: prev && prev.max_pain, plot: "maxPain" });
|
|
839
|
+
const fresh = levelsOn() ? freshness() : null;
|
|
840
|
+
if (fresh && fresh.row === g && fresh.late) parts.unshift({ label: "As of", value: fresh.clock, color: STALE_COLOR, note: fresh.late });
|
|
841
|
+
else if (fresh && fresh.row === g) parts.push({ label: "As of", value: fresh.clock });
|
|
842
|
+
},
|
|
843
|
+
// The levels stopped before the newest bar (no exposure row there, so no levels line values): a line says so.
|
|
844
|
+
legend(time) {
|
|
845
|
+
const f = levelsOn() ? freshness() : null;
|
|
846
|
+
if (!f || !f.late || !f.bar || time !== f.bar.time || f.row.time === f.bar.time) return [];
|
|
847
|
+
return [`⚠ GEX levels ${f.late}: last update ${f.clock}`];
|
|
820
848
|
}
|
|
821
849
|
};
|
|
822
850
|
}
|
|
@@ -1491,11 +1519,15 @@ ${apiKey || ""}`, hit = symbolsAnswers.get(k);
|
|
|
1491
1519
|
account.textContent = PLAN_NAMES[plan] || state.plan;
|
|
1492
1520
|
account.title = `Your plan: ${PLAN_NAMES[plan] || state.plan}`;
|
|
1493
1521
|
account.href = view.upgradeHref("account");
|
|
1522
|
+
account.setAttribute("data-fac-cta", "upgrade");
|
|
1523
|
+
account.setAttribute("data-fac-content", "account");
|
|
1494
1524
|
} else {
|
|
1495
1525
|
account.className = "fac-account fac-signup";
|
|
1496
1526
|
account.textContent = "Sign up";
|
|
1497
1527
|
account.title = "Create a free FlashAlpha account";
|
|
1498
1528
|
account.href = view.signupHref();
|
|
1529
|
+
account.setAttribute("data-fac-cta", "signup");
|
|
1530
|
+
account.setAttribute("data-fac-content", "toolbar");
|
|
1499
1531
|
}
|
|
1500
1532
|
account.hidden = false;
|
|
1501
1533
|
}
|
|
@@ -1753,7 +1785,7 @@ ${apiKey || ""}`, hit = symbolsAnswers.get(k);
|
|
|
1753
1785
|
return i < 0 ? Infinity : i;
|
|
1754
1786
|
};
|
|
1755
1787
|
const gatedNames = [...new Set(data.notes.concat(extra).filter(isGated).map((x) => String(x.gated)))].sort((a, b2) => menuAt(a) - menuAt(b2));
|
|
1756
|
-
const gatedLine = !gatedNames.length ? "" : `<div class="sub fac-lg-gated">Not in your plan: ${esc(gatedNames.join(", "))} ` + (view.state.noKey ? `<a class="fac-lg-up" href="${esc(view.signupHref("legend"))}" target="_blank" rel="noopener">Sign up</a>` : `<a class="fac-lg-up" href="${esc(view.upgradeHref("legend"))}" target="_blank" rel="noopener">Upgrade</a>`) + "</div>";
|
|
1788
|
+
const gatedLine = !gatedNames.length ? "" : `<div class="sub fac-lg-gated">Not in your plan: ${esc(gatedNames.join(", "))} ` + (view.state.noKey ? `<a class="fac-lg-up" href="${esc(view.signupHref("legend"))}" ${view.ctaAttrs("legend", "signup")} target="_blank" rel="noopener">Sign up</a>` : `<a class="fac-lg-up" href="${esc(view.upgradeHref("legend"))}" ${view.ctaAttrs("legend")} target="_blank" rel="noopener">Upgrade</a>`) + "</div>";
|
|
1757
1789
|
lines.push(...extra.filter((x) => !isGated(x)));
|
|
1758
1790
|
const notes = data.notes.filter((x) => !isGated(x));
|
|
1759
1791
|
if (notes.length) lines.push(notes.join(" · "));
|
|
@@ -1782,7 +1814,7 @@ ${apiKey || ""}`, hit = symbolsAnswers.get(k);
|
|
|
1782
1814
|
}
|
|
1783
1815
|
const need = wanted.map((k) => layerPlan[k]).sort((a, b) => planRank(a) - planRank(b))[0];
|
|
1784
1816
|
const names = layerList.filter(([k]) => wanted.includes(k) && layerPlan[k] === need).map(([, l]) => l);
|
|
1785
|
-
box.innerHTML = `<span>🔒 ${esc(names.slice(0, 2).join(", "))}${names.length > 2 ? ` +${names.length - 2}` : ""}</span>` + (PLAN_PITCH[need] ? `<span class="pitch">${esc(PLAN_PITCH[need])}</span>` : "") + `<span class="plan">${esc(PLAN_NAMES[need] || need)}</span
|
|
1817
|
+
box.innerHTML = `<span>🔒 ${esc(names.slice(0, 2).join(", "))}${names.length > 2 ? ` +${names.length - 2}` : ""}</span>` + (PLAN_PITCH[need] ? `<span class="pitch">${esc(PLAN_PITCH[need])}</span>` : "") + `<span class="plan">${esc(PLAN_NAMES[need] || need)}</span>` + (view.state.noKey ? `<a href="${esc(view.signupHref("upsell"))}" ${view.ctaAttrs("upsell", "signup")} target="_blank" rel="noopener">Sign up free</a>` : `<a href="${esc(view.upgradeHref(wanted[0]))}" ${view.ctaAttrs(wanted[0])} target="_blank" rel="noopener">Upgrade</a>`);
|
|
1786
1818
|
box.hidden = false;
|
|
1787
1819
|
}
|
|
1788
1820
|
return { render };
|
|
@@ -1812,7 +1844,7 @@ ${apiKey || ""}`, hit = symbolsAnswers.get(k);
|
|
|
1812
1844
|
return;
|
|
1813
1845
|
}
|
|
1814
1846
|
if (error === "api_key_required") {
|
|
1815
|
-
box.innerHTML = `${PREVIEW}<div class="fac-gate-box">${ICONS.lock}<p class="fac-gate-ttl">${esc(GATE.title(state.symbol))}</p><p class="fac-gate-txt">${esc(GATE.text)}</p><a class="fac-gate-cta" href="${esc(view.signupHref("gate"))}" target="_blank" rel="noopener">${ICONS.key}${esc(GATE.cta)}</a></div>`;
|
|
1847
|
+
box.innerHTML = `${PREVIEW}<div class="fac-gate-box">${ICONS.lock}<p class="fac-gate-ttl">${esc(GATE.title(state.symbol))}</p><p class="fac-gate-txt">${esc(GATE.text)}</p><a class="fac-gate-cta" href="${esc(view.signupHref("gate"))}" ${view.ctaAttrs("gate", "signup")} target="_blank" rel="noopener">${ICONS.key}${esc(GATE.cta)}</a></div>`;
|
|
1816
1848
|
} else {
|
|
1817
1849
|
box.textContent = (error === "unknown_symbol" || error === "no bars") && state.symbol ? `No chart data for ${state.symbol} yet.` : ERRORS[error] || "Chart data is unavailable right now.";
|
|
1818
1850
|
}
|
|
@@ -1909,14 +1941,14 @@ ${apiKey || ""}`, hit = symbolsAnswers.get(k);
|
|
|
1909
1941
|
const planName = (p) => PLAN_NAMES[p] || p;
|
|
1910
1942
|
function layerRow(k, label, bold = false) {
|
|
1911
1943
|
const plan = view.layerPlan[k] || "free", name = bold ? `<b>${esc(label)}</b>` : esc(label);
|
|
1912
|
-
if (view.locked(k)) return `<a class="fac-lock" href="${esc(view.upgradeHref(k))}" target="_blank" rel="noopener">🔒 ${name} <span class="plan">${esc(planName(plan))}</span></a>`;
|
|
1944
|
+
if (view.locked(k)) return `<a class="fac-lock" href="${esc(view.upgradeHref(k))}" ${view.ctaAttrs(k)} target="_blank" rel="noopener">🔒 ${name} <span class="plan">${esc(planName(plan))}</span></a>`;
|
|
1913
1945
|
return `<label><input type="checkbox" data-layer="${esc(k)}" ${view.active(k) ? "checked" : ""}> ${name}</label>`;
|
|
1914
1946
|
}
|
|
1915
1947
|
function toggleGroup(g, wanted, input) {
|
|
1916
1948
|
if (wanted && g.layers.length && g.layers.every(([k]) => view.locked(k))) {
|
|
1917
1949
|
input.checked = false;
|
|
1918
1950
|
const [k] = g.layers.slice().sort(([a], [b]) => planRank(view.layerPlan[a]) - planRank(view.layerPlan[b]))[0];
|
|
1919
|
-
|
|
1951
|
+
view.openUpgrade(k);
|
|
1920
1952
|
return;
|
|
1921
1953
|
}
|
|
1922
1954
|
return view.setGroup(g, wanted);
|
|
@@ -2392,6 +2424,15 @@ ${apiKey || ""}`, hit = symbolsAnswers.get(k);
|
|
|
2392
2424
|
const s = $(".fac-status");
|
|
2393
2425
|
if (s) s.textContent = o.debug ? text : "";
|
|
2394
2426
|
};
|
|
2427
|
+
const upgradeEvent = (campaign, content, href) => container.dispatchEvent(new CustomEvent("flashalpha:upgrade", {
|
|
2428
|
+
bubbles: true,
|
|
2429
|
+
detail: { campaign, content: content || null, href, symbol: state.symbol }
|
|
2430
|
+
}));
|
|
2431
|
+
const ctaClick = (e) => {
|
|
2432
|
+
const a = e.target && e.target.closest ? e.target.closest("a[data-fac-cta]") : null;
|
|
2433
|
+
if (a) upgradeEvent(a.getAttribute("data-fac-cta"), a.getAttribute("data-fac-content"), a.href);
|
|
2434
|
+
};
|
|
2435
|
+
root.addEventListener("click", ctaClick, true);
|
|
2395
2436
|
const view = {
|
|
2396
2437
|
container,
|
|
2397
2438
|
root,
|
|
@@ -2408,6 +2449,14 @@ ${apiKey || ""}`, hit = symbolsAnswers.get(k);
|
|
|
2408
2449
|
frame: () => hooks.frame && hooks.frame() || root,
|
|
2409
2450
|
upgradeHref: (what) => upgradeHref(o.upgradeUrl, what),
|
|
2410
2451
|
signupHref: (what = "toolbar") => upgradeHref(o.signupUrl, what, "signup"),
|
|
2452
|
+
/** The data-fac-cta / data-fac-content attributes of a Sign up ('signup') or Upgrade link, for ctaClick. */
|
|
2453
|
+
ctaAttrs: (what, campaign = "upgrade") => `data-fac-cta="${esc(campaign)}" data-fac-content="${esc(what || "")}"`,
|
|
2454
|
+
/** Opens the upgrade page in a new tab (a prompt that is not a link) and tells the page. */
|
|
2455
|
+
openUpgrade(what) {
|
|
2456
|
+
const href = view.upgradeHref(what);
|
|
2457
|
+
upgradeEvent("upgrade", what, href);
|
|
2458
|
+
global.open(href, "_blank", "noopener");
|
|
2459
|
+
},
|
|
2411
2460
|
call,
|
|
2412
2461
|
api: null,
|
|
2413
2462
|
applySetting: null,
|
|
@@ -2530,6 +2579,7 @@ ${apiKey || ""}`, hit = symbolsAnswers.get(k);
|
|
|
2530
2579
|
on,
|
|
2531
2580
|
lockedPlan,
|
|
2532
2581
|
upgradeHref: view.upgradeHref,
|
|
2582
|
+
openUpgrade: view.openUpgrade,
|
|
2533
2583
|
/** True for a layer that is on but hidden with the legend's 👁 (on() is false for it): e.g. keep its pane, empty. */
|
|
2534
2584
|
hidden: hiddenLayer,
|
|
2535
2585
|
/** True when the last load's answer gave API layer `apiLayer` as status "gated" (the key's plan does not include it). */
|
|
@@ -3206,8 +3256,13 @@ ${apiKey || ""}`, hit = symbolsAnswers.get(k);
|
|
|
3206
3256
|
const stale = Date.now() - newest > Math.max(2 * (RES_SECONDS[state.res] || 60) * 1e3, 12e4);
|
|
3207
3257
|
if (lr.to > data.bars.length - 1 - EDGE / 2 && stale && Date.now() - lazy.newerAt > 6e4) loadNewer();
|
|
3208
3258
|
});
|
|
3259
|
+
const announce = () => container.dispatchEvent(new CustomEvent("flashalpha:change", {
|
|
3260
|
+
bubbles: true,
|
|
3261
|
+
detail: { symbol: state.symbol, resolution: state.res, range: state.days, session: o.session, layers: [...state.layers] }
|
|
3262
|
+
}));
|
|
3209
3263
|
const changed = (p) => {
|
|
3210
3264
|
if (hooks.changed) hooks.changed(api);
|
|
3265
|
+
announce();
|
|
3211
3266
|
return p;
|
|
3212
3267
|
};
|
|
3213
3268
|
const api = {
|
|
@@ -3216,6 +3271,7 @@ ${apiKey || ""}`, hit = symbolsAnswers.get(k);
|
|
|
3216
3271
|
toolbar.render();
|
|
3217
3272
|
const p = load();
|
|
3218
3273
|
if (hooks.symbol) hooks.symbol(x, api);
|
|
3274
|
+
announce();
|
|
3219
3275
|
return p;
|
|
3220
3276
|
},
|
|
3221
3277
|
setResolution(r) {
|
|
@@ -3277,7 +3333,9 @@ ${apiKey || ""}`, hit = symbolsAnswers.get(k);
|
|
|
3277
3333
|
/** For a chart group: the toolbar, time bar and credit line, and where they are now (see `outside`). */
|
|
3278
3334
|
_parts: () => ({ bar: root.querySelector(".fac-bar"), time: root.querySelector(".fac-timebar"), credit: root.querySelector(".fac-credit") }),
|
|
3279
3335
|
_outside(list) {
|
|
3336
|
+
outside.forEach((el) => el.removeEventListener("click", ctaClick, true));
|
|
3280
3337
|
outside = list.filter(Boolean);
|
|
3338
|
+
outside.forEach((el) => el.addEventListener("click", ctaClick, true));
|
|
3281
3339
|
},
|
|
3282
3340
|
_closeMenus: () => view.closeMenus(),
|
|
3283
3341
|
/** The key's plan from the last answer ('free', 'basic', ...), or null before it / without auth. */
|
|
@@ -3619,7 +3677,7 @@ ${apiKey || ""}`, hit = symbolsAnswers.get(k);
|
|
|
3619
3677
|
|
|
3620
3678
|
// src/index.js
|
|
3621
3679
|
var plans = PLANS;
|
|
3622
|
-
var version = true ? "1.
|
|
3680
|
+
var version = true ? "1.2.0" : "0.0.0-dev";
|
|
3623
3681
|
var FlashAlphaChart = {
|
|
3624
3682
|
mount,
|
|
3625
3683
|
chartEngineSource,
|