@tradecanvas/core 0.2.0 → 0.3.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/dist/finance/BaseFinanceChart.d.ts.map +1 -1
- package/dist/finance/GaugeRenderer.d.ts +3 -0
- package/dist/finance/GaugeRenderer.d.ts.map +1 -0
- package/dist/finance/WaterfallRenderer.d.ts +8 -0
- package/dist/finance/WaterfallRenderer.d.ts.map +1 -0
- package/dist/finance/index.d.ts +2 -0
- package/dist/finance/index.d.ts.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +464 -202
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1372,7 +1372,7 @@ var j = class {
|
|
|
1372
1372
|
}
|
|
1373
1373
|
this.drawBand(e, s, l, _(r.colors[0], .08)), this.drawLine(e, s, r.colors[0], r.lineWidths[0]), this.drawLine(e, c, r.colors[1] ?? "#787B86", 1), this.drawLine(e, l, r.colors[0], r.lineWidths[0]);
|
|
1374
1374
|
}
|
|
1375
|
-
},
|
|
1375
|
+
}, ve = class extends j {
|
|
1376
1376
|
descriptor = {
|
|
1377
1377
|
id: "rsi",
|
|
1378
1378
|
name: "Relative Strength Index",
|
|
@@ -1423,7 +1423,7 @@ var j = class {
|
|
|
1423
1423
|
}
|
|
1424
1424
|
e.stroke();
|
|
1425
1425
|
}
|
|
1426
|
-
},
|
|
1426
|
+
}, ye = class extends j {
|
|
1427
1427
|
descriptor = {
|
|
1428
1428
|
id: "macd",
|
|
1429
1429
|
name: "MACD",
|
|
@@ -1490,7 +1490,7 @@ var j = class {
|
|
|
1490
1490
|
}
|
|
1491
1491
|
e.fillStyle = m, e.fill(v), e.fillStyle = h, e.fill(y), e.strokeStyle = g, e.lineWidth = r.lineWidths[0], e.lineJoin = "round", e.stroke(C), e.strokeStyle = _, e.stroke(w);
|
|
1492
1492
|
}
|
|
1493
|
-
},
|
|
1493
|
+
}, be = class extends j {
|
|
1494
1494
|
descriptor = {
|
|
1495
1495
|
id: "stochastic",
|
|
1496
1496
|
name: "Stochastic Oscillator",
|
|
@@ -1565,7 +1565,7 @@ var j = class {
|
|
|
1565
1565
|
};
|
|
1566
1566
|
l("k", r.colors[0]), l("d", r.colors[1] ?? "#FF9800");
|
|
1567
1567
|
}
|
|
1568
|
-
},
|
|
1568
|
+
}, xe = class extends j {
|
|
1569
1569
|
descriptor = {
|
|
1570
1570
|
id: "atr",
|
|
1571
1571
|
name: "Average True Range",
|
|
@@ -1619,7 +1619,7 @@ var j = class {
|
|
|
1619
1619
|
}
|
|
1620
1620
|
e.stroke();
|
|
1621
1621
|
}
|
|
1622
|
-
},
|
|
1622
|
+
}, Se = class extends j {
|
|
1623
1623
|
descriptor = {
|
|
1624
1624
|
id: "adx",
|
|
1625
1625
|
name: "Average Directional Index",
|
|
@@ -1692,7 +1692,7 @@ var j = class {
|
|
|
1692
1692
|
};
|
|
1693
1693
|
l("adx", r.colors[0]), l("plusDI", r.colors[1] ?? "#26A69A"), l("minusDI", r.colors[2] ?? "#EF5350");
|
|
1694
1694
|
}
|
|
1695
|
-
},
|
|
1695
|
+
}, Ce = class extends j {
|
|
1696
1696
|
descriptor = {
|
|
1697
1697
|
id: "obv",
|
|
1698
1698
|
name: "On Balance Volume",
|
|
@@ -1738,7 +1738,7 @@ var j = class {
|
|
|
1738
1738
|
}
|
|
1739
1739
|
e.stroke();
|
|
1740
1740
|
}
|
|
1741
|
-
},
|
|
1741
|
+
}, we = class extends j {
|
|
1742
1742
|
descriptor = {
|
|
1743
1743
|
id: "williamsR",
|
|
1744
1744
|
name: "Williams %R",
|
|
@@ -1778,7 +1778,7 @@ var j = class {
|
|
|
1778
1778
|
}
|
|
1779
1779
|
e.stroke();
|
|
1780
1780
|
}
|
|
1781
|
-
},
|
|
1781
|
+
}, Te = class extends j {
|
|
1782
1782
|
descriptor = {
|
|
1783
1783
|
id: "cci",
|
|
1784
1784
|
name: "Commodity Channel Index",
|
|
@@ -1833,7 +1833,7 @@ var j = class {
|
|
|
1833
1833
|
}
|
|
1834
1834
|
e.stroke();
|
|
1835
1835
|
}
|
|
1836
|
-
},
|
|
1836
|
+
}, Ee = class extends j {
|
|
1837
1837
|
descriptor = {
|
|
1838
1838
|
id: "mfi",
|
|
1839
1839
|
name: "Money Flow Index",
|
|
@@ -1878,7 +1878,7 @@ var j = class {
|
|
|
1878
1878
|
}
|
|
1879
1879
|
e.stroke();
|
|
1880
1880
|
}
|
|
1881
|
-
},
|
|
1881
|
+
}, De = class extends j {
|
|
1882
1882
|
descriptor = {
|
|
1883
1883
|
id: "aroon",
|
|
1884
1884
|
name: "Aroon",
|
|
@@ -1920,7 +1920,7 @@ var j = class {
|
|
|
1920
1920
|
};
|
|
1921
1921
|
l("up", r.colors[0]), l("down", r.colors[1] ?? "#EF5350");
|
|
1922
1922
|
}
|
|
1923
|
-
},
|
|
1923
|
+
}, Oe = class extends j {
|
|
1924
1924
|
descriptor = {
|
|
1925
1925
|
id: "roc",
|
|
1926
1926
|
name: "Rate of Change",
|
|
@@ -1964,7 +1964,7 @@ var j = class {
|
|
|
1964
1964
|
}
|
|
1965
1965
|
e.stroke();
|
|
1966
1966
|
}
|
|
1967
|
-
},
|
|
1967
|
+
}, ke = class extends j {
|
|
1968
1968
|
descriptor = {
|
|
1969
1969
|
id: "tsi",
|
|
1970
1970
|
name: "True Strength Index",
|
|
@@ -2033,7 +2033,7 @@ var j = class {
|
|
|
2033
2033
|
};
|
|
2034
2034
|
h("tsi", r.colors[0]), h("signal", r.colors[1] ?? "#FF9800");
|
|
2035
2035
|
}
|
|
2036
|
-
},
|
|
2036
|
+
}, Ae = class extends j {
|
|
2037
2037
|
descriptor = {
|
|
2038
2038
|
id: "cmf",
|
|
2039
2039
|
name: "Chaikin Money Flow",
|
|
@@ -2078,7 +2078,7 @@ var j = class {
|
|
|
2078
2078
|
}
|
|
2079
2079
|
}
|
|
2080
2080
|
}
|
|
2081
|
-
},
|
|
2081
|
+
}, je = class extends j {
|
|
2082
2082
|
descriptor = {
|
|
2083
2083
|
id: "stddev",
|
|
2084
2084
|
name: "Standard Deviation",
|
|
@@ -2124,7 +2124,7 @@ var j = class {
|
|
|
2124
2124
|
}
|
|
2125
2125
|
e.stroke();
|
|
2126
2126
|
}
|
|
2127
|
-
},
|
|
2127
|
+
}, Me = class extends j {
|
|
2128
2128
|
descriptor = {
|
|
2129
2129
|
id: "volumeProfile",
|
|
2130
2130
|
name: "Volume Profile",
|
|
@@ -2174,7 +2174,7 @@ var j = class {
|
|
|
2174
2174
|
e.fillStyle = l[t] > u * .7 ? r.colors[1] ?? "rgba(255, 152, 0, 0.5)" : r.colors[0] ?? "rgba(33, 150, 243, 0.3)", e.fillRect(i.x, s - d / 2, p, Math.max(d - 1, 1));
|
|
2175
2175
|
}
|
|
2176
2176
|
}
|
|
2177
|
-
},
|
|
2177
|
+
}, Ne = class extends j {
|
|
2178
2178
|
descriptor = {
|
|
2179
2179
|
id: "ad",
|
|
2180
2180
|
name: "Accumulation/Distribution",
|
|
@@ -2220,7 +2220,7 @@ var j = class {
|
|
|
2220
2220
|
}
|
|
2221
2221
|
e.stroke();
|
|
2222
2222
|
}
|
|
2223
|
-
},
|
|
2223
|
+
}, Pe = class extends j {
|
|
2224
2224
|
descriptor = {
|
|
2225
2225
|
id: "vroc",
|
|
2226
2226
|
name: "Volume Rate of Change",
|
|
@@ -2262,12 +2262,12 @@ var j = class {
|
|
|
2262
2262
|
};
|
|
2263
2263
|
//#endregion
|
|
2264
2264
|
//#region src/indicators/registry.ts
|
|
2265
|
-
function
|
|
2266
|
-
e.register(new M()), e.register(new N()), e.register(new P()), e.register(new F()), e.register(new I()), e.register(new L()), e.register(new R()), e.register(new z()), e.register(new B()), e.register(new
|
|
2265
|
+
function Fe(e) {
|
|
2266
|
+
e.register(new M()), e.register(new N()), e.register(new P()), e.register(new F()), e.register(new I()), e.register(new L()), e.register(new R()), e.register(new z()), e.register(new B()), e.register(new ve()), e.register(new ye()), e.register(new be()), e.register(new xe()), e.register(new Se()), e.register(new Ce()), e.register(new we()), e.register(new Te()), e.register(new Ee()), e.register(new De()), e.register(new Oe()), e.register(new ke()), e.register(new Ae()), e.register(new je()), e.register(new Me()), e.register(new Ne()), e.register(new Pe());
|
|
2267
2267
|
}
|
|
2268
2268
|
//#endregion
|
|
2269
2269
|
//#region src/axis/GridRenderer.ts
|
|
2270
|
-
var
|
|
2270
|
+
var Ie = class {
|
|
2271
2271
|
visible = !0;
|
|
2272
2272
|
setVisible(e) {
|
|
2273
2273
|
this.visible = e;
|
|
@@ -2296,7 +2296,7 @@ var Pe = class {
|
|
|
2296
2296
|
}
|
|
2297
2297
|
e.stroke();
|
|
2298
2298
|
}
|
|
2299
|
-
},
|
|
2299
|
+
}, Le = class {
|
|
2300
2300
|
render(e, t, n) {
|
|
2301
2301
|
let { chartRect: r, priceRange: i } = t, a = r.x + r.width, o = i.max - i.min;
|
|
2302
2302
|
if (o <= 0) return;
|
|
@@ -2315,7 +2315,7 @@ var Pe = class {
|
|
|
2315
2315
|
e.fillStyle = n.axisLabel;
|
|
2316
2316
|
for (let { y: t, text: n } of h) e.fillText(n, a + 5, t);
|
|
2317
2317
|
}
|
|
2318
|
-
},
|
|
2318
|
+
}, V = /* @__PURE__ */ new Date(), Re = (e) => e < 10 ? "0" + e : "" + e, ze = -(/* @__PURE__ */ new Date()).getTimezoneOffset() / 60, Be = `UTC${ze >= 0 ? "+" : ""}${ze}`, Ve = class {
|
|
2319
2319
|
render(e, t, n, r, i) {
|
|
2320
2320
|
let { chartRect: a } = t, o = i ?? a.y + a.height;
|
|
2321
2321
|
e.strokeStyle = n.axisLine, e.lineWidth = 1, e.beginPath(), e.moveTo(a.x, o + .5), e.lineTo(a.x + a.width, o + .5), e.stroke();
|
|
@@ -2325,14 +2325,14 @@ var Pe = class {
|
|
|
2325
2325
|
for (let t = l; t <= u && t < r.length; t++) {
|
|
2326
2326
|
if (t % c !== 0) continue;
|
|
2327
2327
|
let n = t * s + d, i = r[t].time, a = i > 0xe8d4a51000 ? i : i * 1e3;
|
|
2328
|
-
|
|
2329
|
-
let l =
|
|
2330
|
-
l === f ? h = `${
|
|
2328
|
+
V.setTime(a);
|
|
2329
|
+
let l = V.getDate(), u = V.getMonth() + 1, p = V.getHours(), m = V.getMinutes(), h;
|
|
2330
|
+
l === f ? h = `${Re(p)}:${Re(m)}` : (h = `${u}/${l}`, f = l), e.fillText(h, n, o + 5);
|
|
2331
2331
|
}
|
|
2332
2332
|
let p = a.x + a.width - 4, m = o + 4;
|
|
2333
|
-
e.font = `${n.font.sizeSmall - 1}px ${n.font.family}`, e.textAlign = "right", e.textBaseline = "top", e.fillStyle = n.textSecondary, e.fillText(
|
|
2333
|
+
e.font = `${n.font.sizeSmall - 1}px ${n.font.family}`, e.textAlign = "right", e.textBaseline = "top", e.fillStyle = n.textSecondary, e.fillText(Be, p, m);
|
|
2334
2334
|
}
|
|
2335
|
-
},
|
|
2335
|
+
}, He = class {
|
|
2336
2336
|
panHandler = null;
|
|
2337
2337
|
zoomHandler = null;
|
|
2338
2338
|
crosshairHandler = null;
|
|
@@ -2452,7 +2452,7 @@ var Pe = class {
|
|
|
2452
2452
|
y: (e.clientY + t.clientY) / 2 - n.top
|
|
2453
2453
|
};
|
|
2454
2454
|
}
|
|
2455
|
-
},
|
|
2455
|
+
}, Ue = class {
|
|
2456
2456
|
dragging = !1;
|
|
2457
2457
|
lastX = 0;
|
|
2458
2458
|
lastTime = 0;
|
|
@@ -2488,7 +2488,7 @@ var Pe = class {
|
|
|
2488
2488
|
stopMomentum() {
|
|
2489
2489
|
this.momentumId &&= (cancelAnimationFrame(this.momentumId), 0);
|
|
2490
2490
|
}
|
|
2491
|
-
},
|
|
2491
|
+
}, We = class {
|
|
2492
2492
|
callback;
|
|
2493
2493
|
sensitivity;
|
|
2494
2494
|
pendingDelta = 0;
|
|
@@ -2507,7 +2507,7 @@ var Pe = class {
|
|
|
2507
2507
|
dispose() {
|
|
2508
2508
|
this.rafId &&= (cancelAnimationFrame(this.rafId), 0);
|
|
2509
2509
|
}
|
|
2510
|
-
},
|
|
2510
|
+
}, Ge = class {
|
|
2511
2511
|
position = null;
|
|
2512
2512
|
callback = null;
|
|
2513
2513
|
data = [];
|
|
@@ -2565,7 +2565,7 @@ var Pe = class {
|
|
|
2565
2565
|
flushCallback(e, t) {
|
|
2566
2566
|
this.callback?.(e, t);
|
|
2567
2567
|
}
|
|
2568
|
-
},
|
|
2568
|
+
}, Ke = class {
|
|
2569
2569
|
callbacks;
|
|
2570
2570
|
enabled = !0;
|
|
2571
2571
|
constructor(e) {
|
|
@@ -2591,7 +2591,7 @@ var Pe = class {
|
|
|
2591
2591
|
default: return !1;
|
|
2592
2592
|
}
|
|
2593
2593
|
}
|
|
2594
|
-
},
|
|
2594
|
+
}, qe = class {
|
|
2595
2595
|
el = null;
|
|
2596
2596
|
visible = !1;
|
|
2597
2597
|
timeEl;
|
|
@@ -2630,8 +2630,8 @@ var Pe = class {
|
|
|
2630
2630
|
this.changeEl.textContent = `${l}${a(s)} (${l}${c.toFixed(2)}%)`, this.changeEl.style.color = i;
|
|
2631
2631
|
let u = t.volume;
|
|
2632
2632
|
this.volEl.textContent = `Vol ${u >= 1e6 ? (u / 1e6).toFixed(1) + "M" : u >= 1e3 ? (u / 1e3).toFixed(1) + "K" : u.toFixed(0)}`, this.volEl.style.color = n.textSecondary;
|
|
2633
|
-
let d =
|
|
2634
|
-
this.el.style.background = d ?
|
|
2633
|
+
let d = Je(n.background);
|
|
2634
|
+
this.el.style.background = d ? Ye(n.background, .95) : Ye(n.background, .97), this.el.style.border = `1px solid ${n.axisLine}`, this.el.style.boxShadow = d ? "0 4px 12px rgba(0,0,0,0.5)" : "0 4px 12px rgba(0,0,0,0.15)", this.el.style.color = n.text, this.el.style.backdropFilter = "blur(8px)", !this.measured && this.visible && (this.measuredWidth = this.el.offsetWidth, this.measuredHeight = this.el.offsetHeight, this.measured = !0);
|
|
2635
2635
|
let f = e.x + 16, p = e.y - 40;
|
|
2636
2636
|
f + this.measuredWidth > r.width - 80 && (f = e.x - this.measuredWidth - 16), p < 4 && (p = 4), p + this.measuredHeight > r.height && (p = r.height - this.measuredHeight - 4), this.el.style.transform = `translate(${Math.round(f)}px, ${Math.round(p)}px)`, this.el.style.left = "0", this.el.style.top = "0", this.visible ||= (this.el.style.display = "block", !0);
|
|
2637
2637
|
}
|
|
@@ -2656,7 +2656,7 @@ var Pe = class {
|
|
|
2656
2656
|
return document.createElement("span");
|
|
2657
2657
|
}
|
|
2658
2658
|
};
|
|
2659
|
-
function
|
|
2659
|
+
function Je(e) {
|
|
2660
2660
|
if (e.startsWith("#")) {
|
|
2661
2661
|
let t = e.slice(1), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t.slice(0, 6), r = parseInt(n.slice(0, 2), 16), i = parseInt(n.slice(2, 4), 16), a = parseInt(n.slice(4, 6), 16);
|
|
2662
2662
|
return (.299 * r + .587 * i + .114 * a) / 255 < .5;
|
|
@@ -2668,7 +2668,7 @@ function Ke(e) {
|
|
|
2668
2668
|
}
|
|
2669
2669
|
return !0;
|
|
2670
2670
|
}
|
|
2671
|
-
function
|
|
2671
|
+
function Ye(e, t) {
|
|
2672
2672
|
if (e.startsWith("#")) {
|
|
2673
2673
|
let n = e.slice(1), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n.slice(0, 6);
|
|
2674
2674
|
return `rgba(${parseInt(r.slice(0, 2), 16)}, ${parseInt(r.slice(2, 4), 16)}, ${parseInt(r.slice(4, 6), 16)}, ${t})`;
|
|
@@ -2677,7 +2677,7 @@ function qe(e, t) {
|
|
|
2677
2677
|
}
|
|
2678
2678
|
//#endregion
|
|
2679
2679
|
//#region src/events/EventBus.ts
|
|
2680
|
-
var
|
|
2680
|
+
var Xe = class {
|
|
2681
2681
|
listeners = /* @__PURE__ */ new Map();
|
|
2682
2682
|
tauriBridge = null;
|
|
2683
2683
|
on(e, t) {
|
|
@@ -2708,7 +2708,7 @@ var Je = class {
|
|
|
2708
2708
|
destroy() {
|
|
2709
2709
|
this.listeners.clear(), this.tauriBridge = null;
|
|
2710
2710
|
}
|
|
2711
|
-
},
|
|
2711
|
+
}, H = class {
|
|
2712
2712
|
hitTestAnchor(e, t, n, r) {
|
|
2713
2713
|
for (let i = 0; i < t.anchors.length; i++) {
|
|
2714
2714
|
let a = this.anchorToPixel(t.anchors[i], n);
|
|
@@ -2763,7 +2763,7 @@ var Je = class {
|
|
|
2763
2763
|
let r = n.x - t.x, i = n.y - t.y, a = Math.hypot(r, i);
|
|
2764
2764
|
return a === 0 ? Math.hypot(e.x - t.x, e.y - t.y) : Math.abs(r * (t.y - e.y) - i * (t.x - e.x)) / a;
|
|
2765
2765
|
}
|
|
2766
|
-
},
|
|
2766
|
+
}, Ze = 1, Qe = class {
|
|
2767
2767
|
registry = /* @__PURE__ */ new Map();
|
|
2768
2768
|
drawings = [];
|
|
2769
2769
|
state = "idle";
|
|
@@ -2968,7 +2968,7 @@ var Je = class {
|
|
|
2968
2968
|
let t = this.drawings.find((t) => t.id === e);
|
|
2969
2969
|
if (!t) return null;
|
|
2970
2970
|
let n = structuredClone(t);
|
|
2971
|
-
return n.id = `tc_drawing_${
|
|
2971
|
+
return n.id = `tc_drawing_${Ze++}`, n.anchors = n.anchors.map((e) => ({
|
|
2972
2972
|
...e,
|
|
2973
2973
|
time: e.time + 3
|
|
2974
2974
|
})), n.locked = !1, this.drawings.push(n), this.undoRedo?.push({
|
|
@@ -3010,7 +3010,7 @@ var Je = class {
|
|
|
3010
3010
|
if (!n) return !1;
|
|
3011
3011
|
let r = w(e.x, t), i = T(e.y, t), a = this.snapToOHLC(r, i, t);
|
|
3012
3012
|
return this.creatingDrawing ? (this.creatingDrawing.anchors.push(a), this.committedAnchors++, this.previewAnchor = null, this.committedAnchors >= n.descriptor.requiredAnchors && this.finalizeCreation(), this.requestRender?.(), !0) : (this.creatingDrawing = {
|
|
3013
|
-
id: `tc_drawing_${
|
|
3013
|
+
id: `tc_drawing_${Ze++}`,
|
|
3014
3014
|
type: this.activeTool,
|
|
3015
3015
|
anchors: [a],
|
|
3016
3016
|
style: { ...this.activeStyle },
|
|
@@ -3061,14 +3061,14 @@ var Je = class {
|
|
|
3061
3061
|
price: T(e.y, t)
|
|
3062
3062
|
}, this.requestRender?.(), !0);
|
|
3063
3063
|
}
|
|
3064
|
-
},
|
|
3064
|
+
}, $e = class {
|
|
3065
3065
|
constructor(e) {
|
|
3066
3066
|
this.manager = e;
|
|
3067
3067
|
}
|
|
3068
3068
|
render(e, t) {
|
|
3069
3069
|
this.manager.render(e, t);
|
|
3070
3070
|
}
|
|
3071
|
-
},
|
|
3071
|
+
}, et = class extends H {
|
|
3072
3072
|
descriptor = {
|
|
3073
3073
|
type: "trendLine",
|
|
3074
3074
|
name: "Trend Line",
|
|
@@ -3084,7 +3084,7 @@ var Je = class {
|
|
|
3084
3084
|
let i = this.anchorToPixel(t.anchors[0], n), a = this.anchorToPixel(t.anchors[1], n);
|
|
3085
3085
|
return this.distanceToLine(e, i, a) <= r;
|
|
3086
3086
|
}
|
|
3087
|
-
},
|
|
3087
|
+
}, tt = class extends H {
|
|
3088
3088
|
descriptor = {
|
|
3089
3089
|
type: "horizontalLine",
|
|
3090
3090
|
name: "Horizontal Line",
|
|
@@ -3100,7 +3100,7 @@ var Je = class {
|
|
|
3100
3100
|
let i = C(t.anchors[0].price, n);
|
|
3101
3101
|
return Math.abs(e.y - i) <= r && e.x >= n.chartRect.x && e.x <= n.chartRect.x + n.chartRect.width;
|
|
3102
3102
|
}
|
|
3103
|
-
},
|
|
3103
|
+
}, nt = class extends H {
|
|
3104
3104
|
descriptor = {
|
|
3105
3105
|
type: "verticalLine",
|
|
3106
3106
|
name: "Vertical Line",
|
|
@@ -3116,7 +3116,7 @@ var Je = class {
|
|
|
3116
3116
|
let i = this.anchorToPixel(t.anchors[0], n), { chartRect: a } = n;
|
|
3117
3117
|
return Math.abs(e.x - i.x) <= r && e.y >= a.y && e.y <= a.y + a.height;
|
|
3118
3118
|
}
|
|
3119
|
-
},
|
|
3119
|
+
}, rt = class extends H {
|
|
3120
3120
|
descriptor = {
|
|
3121
3121
|
type: "ray",
|
|
3122
3122
|
name: "Ray",
|
|
@@ -3134,7 +3134,7 @@ var Je = class {
|
|
|
3134
3134
|
let i = this.anchorToPixel(t.anchors[0], n), a = this.anchorToPixel(t.anchors[1], n), o = a.x - i.x, s = a.y - i.y;
|
|
3135
3135
|
return ((e.x - i.x) * o + (e.y - i.y) * s) / (o * o + s * s) < 0 ? !1 : this.distanceToInfiniteLine(e, i, a) <= r;
|
|
3136
3136
|
}
|
|
3137
|
-
},
|
|
3137
|
+
}, it = class extends H {
|
|
3138
3138
|
descriptor = {
|
|
3139
3139
|
type: "extendedLine",
|
|
3140
3140
|
name: "Extended Line",
|
|
@@ -3152,7 +3152,7 @@ var Je = class {
|
|
|
3152
3152
|
let i = this.anchorToPixel(t.anchors[0], n), a = this.anchorToPixel(t.anchors[1], n);
|
|
3153
3153
|
return this.distanceToInfiniteLine(e, i, a) <= r;
|
|
3154
3154
|
}
|
|
3155
|
-
},
|
|
3155
|
+
}, at = class extends H {
|
|
3156
3156
|
descriptor = {
|
|
3157
3157
|
type: "parallelChannel",
|
|
3158
3158
|
name: "Parallel Channel",
|
|
@@ -3189,7 +3189,7 @@ var Je = class {
|
|
|
3189
3189
|
}
|
|
3190
3190
|
return !1;
|
|
3191
3191
|
}
|
|
3192
|
-
},
|
|
3192
|
+
}, ot = class extends H {
|
|
3193
3193
|
descriptor = {
|
|
3194
3194
|
type: "regressionChannel",
|
|
3195
3195
|
name: "Regression Channel",
|
|
@@ -3212,7 +3212,7 @@ var Je = class {
|
|
|
3212
3212
|
let i = this.anchorToPixel(t.anchors[0], n), a = this.anchorToPixel(t.anchors[1], n), o = Math.hypot(a.x - i.x, a.y - i.y), s = Math.max(10, Math.min(o * .2, 100));
|
|
3213
3213
|
return this.distanceToLine(e, i, a) <= r + s;
|
|
3214
3214
|
}
|
|
3215
|
-
},
|
|
3215
|
+
}, U = [
|
|
3216
3216
|
0,
|
|
3217
3217
|
.236,
|
|
3218
3218
|
.382,
|
|
@@ -3220,7 +3220,7 @@ var Je = class {
|
|
|
3220
3220
|
.618,
|
|
3221
3221
|
.786,
|
|
3222
3222
|
1
|
|
3223
|
-
],
|
|
3223
|
+
], st = class extends H {
|
|
3224
3224
|
descriptor = {
|
|
3225
3225
|
type: "fibRetracement",
|
|
3226
3226
|
name: "Fibonacci Retracement",
|
|
@@ -3230,13 +3230,13 @@ var Je = class {
|
|
|
3230
3230
|
if (t.anchors.length < 2) return;
|
|
3231
3231
|
let { chartRect: i } = n, a = t.anchors[0].price, o = t.anchors[1].price, s = a - o;
|
|
3232
3232
|
e.font = "11px sans-serif", e.textBaseline = "middle";
|
|
3233
|
-
for (let r of
|
|
3233
|
+
for (let r of U) {
|
|
3234
3234
|
let a = o + s * (1 - r), c = C(a, n);
|
|
3235
3235
|
this.applyLineStyle(e, t.style), e.globalAlpha = r === 0 || r === 1 ? 1 : .7, e.beginPath(), e.moveTo(i.x, c), e.lineTo(i.x + i.width, c), e.stroke(), e.fillStyle = t.style.color, e.textAlign = "left", e.fillText(`${(r * 100).toFixed(1)}% (${a.toFixed(2)})`, i.x + 4, c - 2);
|
|
3236
3236
|
}
|
|
3237
3237
|
if (e.globalAlpha = 1, t.style.fillColor) {
|
|
3238
|
-
for (let r = 0; r <
|
|
3239
|
-
let a = o + s * (1 -
|
|
3238
|
+
for (let r = 0; r < U.length - 1; r++) {
|
|
3239
|
+
let a = o + s * (1 - U[r]), c = o + s * (1 - U[r + 1]), l = C(a, n), u = C(c, n);
|
|
3240
3240
|
e.fillStyle = t.style.fillColor, e.globalAlpha = .05 + r * .02, e.fillRect(i.x, Math.min(l, u), i.width, Math.abs(u - l));
|
|
3241
3241
|
}
|
|
3242
3242
|
e.globalAlpha = 1;
|
|
@@ -3248,13 +3248,13 @@ var Je = class {
|
|
|
3248
3248
|
let { chartRect: i } = n;
|
|
3249
3249
|
if (e.x < i.x - r || e.x > i.x + i.width + r) return !1;
|
|
3250
3250
|
let a = t.anchors[0].price, o = t.anchors[1].price, s = a - o;
|
|
3251
|
-
for (let t of
|
|
3251
|
+
for (let t of U) {
|
|
3252
3252
|
let i = C(o + s * (1 - t), n);
|
|
3253
3253
|
if (Math.abs(e.y - i) <= r) return !0;
|
|
3254
3254
|
}
|
|
3255
3255
|
return !1;
|
|
3256
3256
|
}
|
|
3257
|
-
},
|
|
3257
|
+
}, ct = [
|
|
3258
3258
|
0,
|
|
3259
3259
|
.618,
|
|
3260
3260
|
1,
|
|
@@ -3263,7 +3263,7 @@ var Je = class {
|
|
|
3263
3263
|
2.618,
|
|
3264
3264
|
3.618,
|
|
3265
3265
|
4.236
|
|
3266
|
-
],
|
|
3266
|
+
], lt = class extends H {
|
|
3267
3267
|
descriptor = {
|
|
3268
3268
|
type: "fibExtension",
|
|
3269
3269
|
name: "Fibonacci Extension",
|
|
@@ -3279,7 +3279,7 @@ var Je = class {
|
|
|
3279
3279
|
}
|
|
3280
3280
|
let { chartRect: i } = n, a = t.anchors[0].price, o = t.anchors[1].price, s = t.anchors[2].price, c = a - o;
|
|
3281
3281
|
e.font = "11px sans-serif", e.textBaseline = "middle", e.textAlign = "left";
|
|
3282
|
-
for (let r of
|
|
3282
|
+
for (let r of ct) {
|
|
3283
3283
|
let a = C(s + c * r, n);
|
|
3284
3284
|
this.applyLineStyle(e, t.style), e.globalAlpha = r === 0 || r === 1 ? 1 : .6, e.beginPath(), e.moveTo(i.x, a), e.lineTo(i.x + i.width, a), e.stroke(), e.fillStyle = t.style.color, e.fillText(`${(r * 100).toFixed(1)}%`, i.x + 4, a - 2);
|
|
3285
3285
|
}
|
|
@@ -3290,13 +3290,13 @@ var Je = class {
|
|
|
3290
3290
|
let { chartRect: i } = n;
|
|
3291
3291
|
if (e.x < i.x - r || e.x > i.x + i.width + r) return !1;
|
|
3292
3292
|
let a = t.anchors[0].price - t.anchors[1].price;
|
|
3293
|
-
for (let i of
|
|
3293
|
+
for (let i of ct) {
|
|
3294
3294
|
let o = C(t.anchors[2].price + a * i, n);
|
|
3295
3295
|
if (Math.abs(e.y - o) <= r) return !0;
|
|
3296
3296
|
}
|
|
3297
3297
|
return !1;
|
|
3298
3298
|
}
|
|
3299
|
-
},
|
|
3299
|
+
}, ut = class extends H {
|
|
3300
3300
|
descriptor = {
|
|
3301
3301
|
type: "rectangle",
|
|
3302
3302
|
name: "Rectangle",
|
|
@@ -3314,7 +3314,7 @@ var Je = class {
|
|
|
3314
3314
|
let u = Math.min(i.x, a.x) + r, d = Math.min(i.y, a.y) + r, f = Math.max(i.x, a.x) - r, p = Math.max(i.y, a.y) - r;
|
|
3315
3315
|
return !(e.x > u && e.x < f && e.y > d && e.y < p) || !!t.style.fillColor;
|
|
3316
3316
|
}
|
|
3317
|
-
},
|
|
3317
|
+
}, dt = class extends H {
|
|
3318
3318
|
descriptor = {
|
|
3319
3319
|
type: "ellipse",
|
|
3320
3320
|
name: "Ellipse",
|
|
@@ -3330,7 +3330,7 @@ var Je = class {
|
|
|
3330
3330
|
let i = this.anchorToPixel(t.anchors[0], n), a = this.anchorToPixel(t.anchors[1], n), o = (i.x + a.x) / 2, s = (i.y + a.y) / 2, c = Math.max(Math.abs(a.x - i.x) / 2, 1), l = Math.max(Math.abs(a.y - i.y) / 2, 1), u = (e.x - o) / c, d = (e.y - s) / l, f = Math.sqrt(u * u + d * d), p = r / Math.max(Math.min(c, l), 4);
|
|
3331
3331
|
return t.style.fillColor ? f <= 1 + p : Math.abs(f - 1) <= p;
|
|
3332
3332
|
}
|
|
3333
|
-
},
|
|
3333
|
+
}, ft = class extends H {
|
|
3334
3334
|
descriptor = {
|
|
3335
3335
|
type: "triangle",
|
|
3336
3336
|
name: "Triangle",
|
|
@@ -3356,7 +3356,7 @@ var Je = class {
|
|
|
3356
3356
|
}
|
|
3357
3357
|
return !1;
|
|
3358
3358
|
}
|
|
3359
|
-
},
|
|
3359
|
+
}, pt = class extends H {
|
|
3360
3360
|
descriptor = {
|
|
3361
3361
|
type: "pitchfork",
|
|
3362
3362
|
name: "Andrews' Pitchfork",
|
|
@@ -3392,7 +3392,7 @@ var Je = class {
|
|
|
3392
3392
|
};
|
|
3393
3393
|
return this.distanceToInfiniteLine(e, a, u) <= r || this.distanceToInfiniteLine(e, o, d) <= r;
|
|
3394
3394
|
}
|
|
3395
|
-
},
|
|
3395
|
+
}, mt = [
|
|
3396
3396
|
"1",
|
|
3397
3397
|
"2",
|
|
3398
3398
|
"3",
|
|
@@ -3401,7 +3401,7 @@ var Je = class {
|
|
|
3401
3401
|
"A",
|
|
3402
3402
|
"B",
|
|
3403
3403
|
"C"
|
|
3404
|
-
],
|
|
3404
|
+
], ht = class extends H {
|
|
3405
3405
|
descriptor = {
|
|
3406
3406
|
type: "elliottWave",
|
|
3407
3407
|
name: "Elliott Wave",
|
|
@@ -3413,9 +3413,9 @@ var Je = class {
|
|
|
3413
3413
|
this.applyLineStyle(e, t.style), e.beginPath(), e.moveTo(i[0].x, i[0].y);
|
|
3414
3414
|
for (let t = 1; t < i.length; t++) e.lineTo(i[t].x, i[t].y);
|
|
3415
3415
|
e.stroke(), this.resetLineStyle(e), e.font = "bold 12px sans-serif", e.fillStyle = t.style.color, e.textAlign = "center";
|
|
3416
|
-
for (let t = 0; t < i.length && t <
|
|
3416
|
+
for (let t = 0; t < i.length && t < mt.length; t++) {
|
|
3417
3417
|
let n = t % 2 == 0 ? -12 : 12;
|
|
3418
|
-
e.textBaseline = n < 0 ? "bottom" : "top", e.fillText(
|
|
3418
|
+
e.textBaseline = n < 0 ? "bottom" : "top", e.fillText(mt[t], i[t].x, i[t].y + n);
|
|
3419
3419
|
}
|
|
3420
3420
|
r && this.renderAnchorHandles(e, t, n);
|
|
3421
3421
|
}
|
|
@@ -3425,7 +3425,7 @@ var Je = class {
|
|
|
3425
3425
|
for (let t = 0; t < i.length - 1; t++) if (this.distanceToLine(e, i[t], i[t + 1]) <= r) return !0;
|
|
3426
3426
|
return !1;
|
|
3427
3427
|
}
|
|
3428
|
-
},
|
|
3428
|
+
}, gt = class extends H {
|
|
3429
3429
|
descriptor = {
|
|
3430
3430
|
type: "priceRange",
|
|
3431
3431
|
name: "Price Range",
|
|
@@ -3443,7 +3443,7 @@ var Je = class {
|
|
|
3443
3443
|
let i = this.anchorToPixel(t.anchors[0], n), a = this.anchorToPixel(t.anchors[1], n), o = Math.min(i.x, a.x), s = Math.max(i.x, a.x), c = Math.min(i.y, a.y), l = Math.max(i.y, a.y);
|
|
3444
3444
|
return e.x >= o - r && e.x <= s + r && e.y >= c - r && e.y <= l + r;
|
|
3445
3445
|
}
|
|
3446
|
-
},
|
|
3446
|
+
}, _t = class extends H {
|
|
3447
3447
|
descriptor = {
|
|
3448
3448
|
type: "dateRange",
|
|
3449
3449
|
name: "Date Range",
|
|
@@ -3461,7 +3461,7 @@ var Je = class {
|
|
|
3461
3461
|
let i = this.anchorToPixel(t.anchors[0], n), a = this.anchorToPixel(t.anchors[1], n), { chartRect: o } = n, s = Math.min(i.x, a.x), c = Math.max(i.x, a.x);
|
|
3462
3462
|
return e.x >= s - r && e.x <= c + r && e.y >= o.y && e.y <= o.y + o.height;
|
|
3463
3463
|
}
|
|
3464
|
-
},
|
|
3464
|
+
}, vt = class extends H {
|
|
3465
3465
|
descriptor = {
|
|
3466
3466
|
type: "measure",
|
|
3467
3467
|
name: "Measure",
|
|
@@ -3483,7 +3483,7 @@ var Je = class {
|
|
|
3483
3483
|
let i = this.anchorToPixel(t.anchors[0], n), a = this.anchorToPixel(t.anchors[1], n);
|
|
3484
3484
|
return this.distanceToLine(e, i, a) <= r;
|
|
3485
3485
|
}
|
|
3486
|
-
},
|
|
3486
|
+
}, yt = class extends H {
|
|
3487
3487
|
descriptor = {
|
|
3488
3488
|
type: "text",
|
|
3489
3489
|
name: "Text",
|
|
@@ -3503,7 +3503,7 @@ var Je = class {
|
|
|
3503
3503
|
let i = this.anchorToPixel(t.anchors[0], n), a = t.style.fontSize || 14;
|
|
3504
3504
|
return e.x >= i.x - r && e.x <= i.x + 80 + r && e.y >= i.y - r && e.y <= i.y + a + r;
|
|
3505
3505
|
}
|
|
3506
|
-
},
|
|
3506
|
+
}, bt = class extends H {
|
|
3507
3507
|
descriptor = {
|
|
3508
3508
|
type: "arrow",
|
|
3509
3509
|
name: "Arrow",
|
|
@@ -3521,7 +3521,7 @@ var Je = class {
|
|
|
3521
3521
|
let i = this.anchorToPixel(t.anchors[0], n), a = this.anchorToPixel(t.anchors[1], n);
|
|
3522
3522
|
return this.distanceToLine(e, i, a) <= r;
|
|
3523
3523
|
}
|
|
3524
|
-
},
|
|
3524
|
+
}, xt = [
|
|
3525
3525
|
{
|
|
3526
3526
|
label: "8x1",
|
|
3527
3527
|
ratio: 8
|
|
@@ -3558,7 +3558,7 @@ var Je = class {
|
|
|
3558
3558
|
label: "1x8",
|
|
3559
3559
|
ratio: .125
|
|
3560
3560
|
}
|
|
3561
|
-
],
|
|
3561
|
+
], W = class extends H {
|
|
3562
3562
|
descriptor = {
|
|
3563
3563
|
type: "gannFan",
|
|
3564
3564
|
name: "Gann Fan",
|
|
@@ -3570,7 +3570,7 @@ var Je = class {
|
|
|
3570
3570
|
if (Math.abs(o) < 1) return;
|
|
3571
3571
|
let c = s / o, l = o > 0 ? 1 : -1, { chartRect: u } = n, d = l > 0 ? u.x + u.width : u.x;
|
|
3572
3572
|
this.applyLineStyle(e, t.style);
|
|
3573
|
-
for (let { label: n, ratio: r } of
|
|
3573
|
+
for (let { label: n, ratio: r } of xt) {
|
|
3574
3574
|
let a = c * r, o = d, s = i.y + a * (o - i.x);
|
|
3575
3575
|
e.globalAlpha = r === 1 ? 1 : .5, e.lineWidth = r === 1 ? t.style.lineWidth : Math.max(.5, t.style.lineWidth * .7), e.beginPath(), e.moveTo(i.x, i.y), e.lineTo(o, s), e.stroke();
|
|
3576
3576
|
let f = o - l * 4, p = s;
|
|
@@ -3583,7 +3583,7 @@ var Je = class {
|
|
|
3583
3583
|
let i = this.anchorToPixel(t.anchors[0], n), a = this.anchorToPixel(t.anchors[1], n), o = a.x - i.x, s = a.y - i.y;
|
|
3584
3584
|
if (Math.abs(o) < 1) return !1;
|
|
3585
3585
|
let c = s / o, l = o > 0 ? 1 : -1, { chartRect: u } = n, d = l > 0 ? u.x + u.width : u.x;
|
|
3586
|
-
for (let { ratio: t } of
|
|
3586
|
+
for (let { ratio: t } of xt) {
|
|
3587
3587
|
let n = c * t, a = d, o = i.y + n * (a - i.x);
|
|
3588
3588
|
if (this.distanceToLine(e, i, {
|
|
3589
3589
|
x: a,
|
|
@@ -3592,7 +3592,7 @@ var Je = class {
|
|
|
3592
3592
|
}
|
|
3593
3593
|
return !1;
|
|
3594
3594
|
}
|
|
3595
|
-
},
|
|
3595
|
+
}, G = [
|
|
3596
3596
|
0,
|
|
3597
3597
|
.25,
|
|
3598
3598
|
.333,
|
|
@@ -3600,7 +3600,7 @@ var Je = class {
|
|
|
3600
3600
|
.667,
|
|
3601
3601
|
.75,
|
|
3602
3602
|
1
|
|
3603
|
-
],
|
|
3603
|
+
], St = class extends H {
|
|
3604
3604
|
descriptor = {
|
|
3605
3605
|
type: "gannBox",
|
|
3606
3606
|
name: "Gann Box",
|
|
@@ -3611,18 +3611,18 @@ var Je = class {
|
|
|
3611
3611
|
let i = this.anchorToPixel(t.anchors[0], n), a = this.anchorToPixel(t.anchors[1], n), o = Math.min(i.x, a.x), s = Math.max(i.x, a.x), c = Math.min(i.y, a.y), l = Math.max(i.y, a.y), u = s - o, d = l - c;
|
|
3612
3612
|
if (!(u < 2 || d < 2)) {
|
|
3613
3613
|
this.applyLineStyle(e, t.style), e.strokeRect(o, c, u, d), e.save(), e.globalAlpha = .35;
|
|
3614
|
-
for (let t of
|
|
3614
|
+
for (let t of G) {
|
|
3615
3615
|
if (t === 0 || t === 1) continue;
|
|
3616
3616
|
let n = c + d * t;
|
|
3617
3617
|
e.beginPath(), e.moveTo(o, n), e.lineTo(s, n), e.stroke();
|
|
3618
3618
|
}
|
|
3619
|
-
for (let t of
|
|
3619
|
+
for (let t of G) {
|
|
3620
3620
|
if (t === 0 || t === 1) continue;
|
|
3621
3621
|
let n = o + u * t;
|
|
3622
3622
|
e.beginPath(), e.moveTo(n, c), e.lineTo(n, l), e.stroke();
|
|
3623
3623
|
}
|
|
3624
3624
|
e.globalAlpha = .5, e.setLineDash([4, 3]), e.beginPath(), e.moveTo(o, c), e.lineTo(s, l), e.stroke(), e.beginPath(), e.moveTo(s, c), e.lineTo(o, l), e.stroke(), e.restore(), this.resetLineStyle(e), e.fillStyle = t.style.color, e.font = "8px sans-serif", e.globalAlpha = .6, e.textBaseline = "bottom", e.textAlign = "right";
|
|
3625
|
-
for (let t of
|
|
3625
|
+
for (let t of G) {
|
|
3626
3626
|
if (t === 0 || t === 1) continue;
|
|
3627
3627
|
let n = c + d * t;
|
|
3628
3628
|
e.fillText(`${(t * 100).toFixed(0)}%`, o - 3, n);
|
|
@@ -3647,7 +3647,7 @@ var Je = class {
|
|
|
3647
3647
|
y: l
|
|
3648
3648
|
}) <= r;
|
|
3649
3649
|
}
|
|
3650
|
-
},
|
|
3650
|
+
}, Ct = class extends H {
|
|
3651
3651
|
descriptor = {
|
|
3652
3652
|
type: "anchoredVWAP",
|
|
3653
3653
|
name: "Anchored VWAP",
|
|
@@ -3719,7 +3719,7 @@ var Je = class {
|
|
|
3719
3719
|
}
|
|
3720
3720
|
return !1;
|
|
3721
3721
|
}
|
|
3722
|
-
},
|
|
3722
|
+
}, wt = class extends H {
|
|
3723
3723
|
descriptor = {
|
|
3724
3724
|
type: "volumeProfileRange",
|
|
3725
3725
|
name: "Volume Profile (Range)",
|
|
@@ -3764,12 +3764,12 @@ var Je = class {
|
|
|
3764
3764
|
};
|
|
3765
3765
|
//#endregion
|
|
3766
3766
|
//#region src/drawings/tools/index.ts
|
|
3767
|
-
function
|
|
3768
|
-
e.register(new
|
|
3767
|
+
function Tt(e) {
|
|
3768
|
+
e.register(new et()), e.register(new tt()), e.register(new nt()), e.register(new rt()), e.register(new it()), e.register(new at()), e.register(new ot()), e.register(new st()), e.register(new lt()), e.register(new ut()), e.register(new dt()), e.register(new ft()), e.register(new pt()), e.register(new ht()), e.register(new gt()), e.register(new _t()), e.register(new vt()), e.register(new yt()), e.register(new bt()), e.register(new W()), e.register(new St()), e.register(new Ct()), e.register(new wt());
|
|
3769
3769
|
}
|
|
3770
3770
|
//#endregion
|
|
3771
3771
|
//#region src/trading/OrderRenderer.ts
|
|
3772
|
-
var
|
|
3772
|
+
var Et = class {
|
|
3773
3773
|
render(e, t, n, r, i, a) {
|
|
3774
3774
|
let o = i.orderColors?.buy ?? "#26A69A", s = i.orderColors?.sell ?? "#EF5350", { chartRect: c } = n;
|
|
3775
3775
|
for (let i of t) {
|
|
@@ -3807,7 +3807,7 @@ var Tt = class {
|
|
|
3807
3807
|
}
|
|
3808
3808
|
return null;
|
|
3809
3809
|
}
|
|
3810
|
-
},
|
|
3810
|
+
}, Dt = class {
|
|
3811
3811
|
render(e, t, n, r, i, a) {
|
|
3812
3812
|
let { chartRect: o } = r, s = a.positionColors?.profit ?? "#26A69A", c = a.positionColors?.loss ?? "#EF5350", l = a.positionColors?.entry ?? "#2196F3", u = a.pricePrecision ?? 2;
|
|
3813
3813
|
for (let a of t) {
|
|
@@ -3840,7 +3840,7 @@ var Tt = class {
|
|
|
3840
3840
|
e.fillStyle = o, e.fillRect(l, t - 9, c - 2, 18), e.fillStyle = "#FFFFFF", e.font = `11px ${r.font.family}`, e.textAlign = "left", e.textBaseline = "middle", e.fillText(i.entryPrice.toFixed(s), l + 5, t);
|
|
3841
3841
|
}
|
|
3842
3842
|
}
|
|
3843
|
-
},
|
|
3843
|
+
}, Ot = class {
|
|
3844
3844
|
render(e, t, n, r) {
|
|
3845
3845
|
if (!r.depthOverlay?.enabled) return;
|
|
3846
3846
|
let { chartRect: i } = n, a = r.depthOverlay.bidColor ?? "rgba(38,166,154,0.15)", o = r.depthOverlay.askColor ?? "rgba(239,83,80,0.15)", s = r.depthOverlay.maxWidth ?? 100, c = 0, l = [], u = 0;
|
|
@@ -3871,7 +3871,7 @@ var Tt = class {
|
|
|
3871
3871
|
e.fillRect(p - o, a - f / 2, o, f);
|
|
3872
3872
|
}
|
|
3873
3873
|
}
|
|
3874
|
-
},
|
|
3874
|
+
}, kt = class {
|
|
3875
3875
|
dragState = null;
|
|
3876
3876
|
startY = 0;
|
|
3877
3877
|
dragging = !1;
|
|
@@ -3935,7 +3935,7 @@ var Tt = class {
|
|
|
3935
3935
|
isActive() {
|
|
3936
3936
|
return this.dragState !== null;
|
|
3937
3937
|
}
|
|
3938
|
-
},
|
|
3938
|
+
}, At = class {
|
|
3939
3939
|
menuElement = null;
|
|
3940
3940
|
removeHandler = null;
|
|
3941
3941
|
onItemSelect = null;
|
|
@@ -4019,17 +4019,17 @@ var Tt = class {
|
|
|
4019
4019
|
destroy() {
|
|
4020
4020
|
this.hide(), this.onItemSelect = null;
|
|
4021
4021
|
}
|
|
4022
|
-
},
|
|
4022
|
+
}, jt = class {
|
|
4023
4023
|
orders = [];
|
|
4024
4024
|
positions = [];
|
|
4025
4025
|
depthData = null;
|
|
4026
4026
|
currentPrice = null;
|
|
4027
4027
|
config;
|
|
4028
|
-
orderRenderer = new
|
|
4029
|
-
positionRenderer = new
|
|
4030
|
-
depthOverlay = new
|
|
4028
|
+
orderRenderer = new Et();
|
|
4029
|
+
positionRenderer = new Dt();
|
|
4030
|
+
depthOverlay = new Ot();
|
|
4031
4031
|
dragHandler;
|
|
4032
|
-
contextMenu = new
|
|
4032
|
+
contextMenu = new At();
|
|
4033
4033
|
requestRender = null;
|
|
4034
4034
|
eventCallback = null;
|
|
4035
4035
|
container = null;
|
|
@@ -4037,7 +4037,7 @@ var Tt = class {
|
|
|
4037
4037
|
this.config = {
|
|
4038
4038
|
...a,
|
|
4039
4039
|
...e
|
|
4040
|
-
}, this.dragHandler = new
|
|
4040
|
+
}, this.dragHandler = new kt(this.config.dragThreshold), this.contextMenu.onItemSelect = (e) => {
|
|
4041
4041
|
this.eventCallback?.("orderPlace", e);
|
|
4042
4042
|
};
|
|
4043
4043
|
}
|
|
@@ -4098,7 +4098,7 @@ var Tt = class {
|
|
|
4098
4098
|
destroy() {
|
|
4099
4099
|
this.contextMenu.destroy();
|
|
4100
4100
|
}
|
|
4101
|
-
},
|
|
4101
|
+
}, Mt = class {
|
|
4102
4102
|
constructor(e) {
|
|
4103
4103
|
this.manager = e;
|
|
4104
4104
|
}
|
|
@@ -4108,7 +4108,7 @@ var Tt = class {
|
|
|
4108
4108
|
renderAxisBadges(e, t, n) {
|
|
4109
4109
|
this.manager.renderAxisBadges(e, t, n);
|
|
4110
4110
|
}
|
|
4111
|
-
},
|
|
4111
|
+
}, K = class {
|
|
4112
4112
|
listeners = /* @__PURE__ */ new Map();
|
|
4113
4113
|
on(e, t) {
|
|
4114
4114
|
let n = this.listeners.get(e);
|
|
@@ -4130,7 +4130,7 @@ var Tt = class {
|
|
|
4130
4130
|
removeAllListeners() {
|
|
4131
4131
|
this.listeners.clear();
|
|
4132
4132
|
}
|
|
4133
|
-
},
|
|
4133
|
+
}, Nt = class extends K {
|
|
4134
4134
|
currentBar = null;
|
|
4135
4135
|
timeframeMs;
|
|
4136
4136
|
tickRing;
|
|
@@ -4192,7 +4192,7 @@ var Tt = class {
|
|
|
4192
4192
|
alignToTimeframe(e) {
|
|
4193
4193
|
return Math.floor(e / this.timeframeMs) * this.timeframeMs;
|
|
4194
4194
|
}
|
|
4195
|
-
},
|
|
4195
|
+
}, q = class extends K {
|
|
4196
4196
|
config;
|
|
4197
4197
|
attempt = 0;
|
|
4198
4198
|
timer = null;
|
|
@@ -4239,7 +4239,7 @@ var Tt = class {
|
|
|
4239
4239
|
let e = this.config.baseDelay, t = this.config.backoffMultiplier ** (this.attempt - 1), n = Math.min(e * t, this.config.maxDelay), r = n * .25 * (Math.random() * 2 - 1);
|
|
4240
4240
|
return Math.max(0, Math.round(n + r));
|
|
4241
4241
|
}
|
|
4242
|
-
},
|
|
4242
|
+
}, Pt = class {
|
|
4243
4243
|
price = null;
|
|
4244
4244
|
previousClose = null;
|
|
4245
4245
|
visible = !0;
|
|
@@ -4270,12 +4270,12 @@ var Tt = class {
|
|
|
4270
4270
|
let f = s - 5;
|
|
4271
4271
|
e.beginPath(), e.moveTo(f, r), e.lineTo(f + 5, r - 5), e.lineTo(f + 5, r + 5), e.closePath(), e.fill(), e.fillStyle = "#FFFFFF", e.textBaseline = "middle", e.textAlign = "left", e.fillText(l, s + 5, r);
|
|
4272
4272
|
}
|
|
4273
|
-
},
|
|
4273
|
+
}, Ft = class extends K {
|
|
4274
4274
|
config = null;
|
|
4275
4275
|
adapter = null;
|
|
4276
4276
|
aggregator = null;
|
|
4277
4277
|
reconnector;
|
|
4278
|
-
priceLine = new
|
|
4278
|
+
priceLine = new Pt();
|
|
4279
4279
|
state = "disconnected";
|
|
4280
4280
|
lastPrice = null;
|
|
4281
4281
|
previousClose = null;
|
|
@@ -4283,13 +4283,13 @@ var Tt = class {
|
|
|
4283
4283
|
heartbeatTimer = null;
|
|
4284
4284
|
lastMessageTime = 0;
|
|
4285
4285
|
constructor() {
|
|
4286
|
-
super(), this.reconnector = new
|
|
4286
|
+
super(), this.reconnector = new q(), this.wireReconnector();
|
|
4287
4287
|
}
|
|
4288
4288
|
async connect(e) {
|
|
4289
4289
|
this.disconnect(), this.config = {
|
|
4290
4290
|
...i,
|
|
4291
4291
|
...e
|
|
4292
|
-
}, this.adapter = e.adapter, this.aggregator = new
|
|
4292
|
+
}, this.adapter = e.adapter, this.aggregator = new Nt(e.timeframe), this.reconnector.removeAllListeners(), this.reconnector.stop(), this.reconnector = new q(e.reconnect ?? r), this.wireReconnector(), this.aggregator.on("bar", (e) => {
|
|
4293
4293
|
this.emit("barUpdate", e), this.updatePrice(e.close);
|
|
4294
4294
|
}), this.aggregator.on("barClose", (e) => {
|
|
4295
4295
|
this.previousClose = e.close, this.emit("barClose", e);
|
|
@@ -4391,7 +4391,7 @@ var Tt = class {
|
|
|
4391
4391
|
dispose() {
|
|
4392
4392
|
this.disconnect(), this.removeAllListeners();
|
|
4393
4393
|
}
|
|
4394
|
-
},
|
|
4394
|
+
}, It = {
|
|
4395
4395
|
"1s": "1s",
|
|
4396
4396
|
"1m": "1m",
|
|
4397
4397
|
"3m": "3m",
|
|
@@ -4408,7 +4408,7 @@ var Tt = class {
|
|
|
4408
4408
|
"3d": "3d",
|
|
4409
4409
|
"1w": "1w",
|
|
4410
4410
|
"1M": "1M"
|
|
4411
|
-
},
|
|
4411
|
+
}, Lt = class {
|
|
4412
4412
|
name = "binance";
|
|
4413
4413
|
ws = null;
|
|
4414
4414
|
state = "disconnected";
|
|
@@ -4429,7 +4429,7 @@ var Tt = class {
|
|
|
4429
4429
|
return this.state;
|
|
4430
4430
|
}
|
|
4431
4431
|
async fetchHistory(e, t, n = 500) {
|
|
4432
|
-
let r =
|
|
4432
|
+
let r = It[t] ?? "15m", i = `${this.restBase}/klines?symbol=${e}&interval=${r}&limit=${n}`, a = await fetch(i);
|
|
4433
4433
|
if (!a.ok) throw Error(`Binance REST error: ${a.status}`);
|
|
4434
4434
|
return (await a.json()).map((e) => ({
|
|
4435
4435
|
time: e[0],
|
|
@@ -4452,7 +4452,7 @@ var Tt = class {
|
|
|
4452
4452
|
}
|
|
4453
4453
|
connectWs() {
|
|
4454
4454
|
if (!this.config) return;
|
|
4455
|
-
let e = `${this.config.symbol.toLowerCase()}@kline_${
|
|
4455
|
+
let e = `${this.config.symbol.toLowerCase()}@kline_${It[this.config.timeframe] ?? "15m"}`, t = `${this.wsBase}/${e}`;
|
|
4456
4456
|
this.setState("connecting");
|
|
4457
4457
|
try {
|
|
4458
4458
|
this.ws = new WebSocket(t);
|
|
@@ -4505,7 +4505,7 @@ var Tt = class {
|
|
|
4505
4505
|
for (let e of n) e(r);
|
|
4506
4506
|
}
|
|
4507
4507
|
}
|
|
4508
|
-
},
|
|
4508
|
+
}, Rt = class {
|
|
4509
4509
|
name = "mock";
|
|
4510
4510
|
state = "disconnected";
|
|
4511
4511
|
listeners = /* @__PURE__ */ new Map();
|
|
@@ -4600,7 +4600,7 @@ var Tt = class {
|
|
|
4600
4600
|
for (let e of n) e(r);
|
|
4601
4601
|
}
|
|
4602
4602
|
}
|
|
4603
|
-
},
|
|
4603
|
+
}, zt = {
|
|
4604
4604
|
visible: !0,
|
|
4605
4605
|
showSymbol: !0,
|
|
4606
4606
|
showOHLC: !0,
|
|
@@ -4608,8 +4608,8 @@ var Tt = class {
|
|
|
4608
4608
|
showVolume: !0,
|
|
4609
4609
|
position: "top-left",
|
|
4610
4610
|
fontSize: 12
|
|
4611
|
-
},
|
|
4612
|
-
config = { ...
|
|
4611
|
+
}, Bt = class {
|
|
4612
|
+
config = { ...zt };
|
|
4613
4613
|
symbol = "";
|
|
4614
4614
|
timeframe = "";
|
|
4615
4615
|
hoverBar = null;
|
|
@@ -4696,7 +4696,7 @@ var Tt = class {
|
|
|
4696
4696
|
}
|
|
4697
4697
|
}
|
|
4698
4698
|
}
|
|
4699
|
-
},
|
|
4699
|
+
}, Vt = class {
|
|
4700
4700
|
static toDataURL(e, t) {
|
|
4701
4701
|
let n = e.querySelectorAll("canvas");
|
|
4702
4702
|
if (n.length === 0) return "";
|
|
@@ -4718,7 +4718,7 @@ var Tt = class {
|
|
|
4718
4718
|
let i = document.createElement("a");
|
|
4719
4719
|
i.href = r, i.download = t, document.body.appendChild(i), i.click(), document.body.removeChild(i);
|
|
4720
4720
|
}
|
|
4721
|
-
},
|
|
4721
|
+
}, Ht = class {
|
|
4722
4722
|
config = null;
|
|
4723
4723
|
setConfig(e) {
|
|
4724
4724
|
this.config = e;
|
|
@@ -4728,7 +4728,7 @@ var Tt = class {
|
|
|
4728
4728
|
let { chartRect: r } = t, i = this.config.fontSize ?? 48, a = this.config.color ?? n.textSecondary;
|
|
4729
4729
|
e.save(), e.globalAlpha = .07, e.font = `bold ${i}px ${n.font.family}`, e.fillStyle = a, e.textAlign = "center", e.textBaseline = "middle", e.fillText(this.config.text, r.x + r.width / 2, r.y + r.height / 2), e.restore();
|
|
4730
4730
|
}
|
|
4731
|
-
},
|
|
4731
|
+
}, Ut = class {
|
|
4732
4732
|
visible = !0;
|
|
4733
4733
|
timeframeMs = 0;
|
|
4734
4734
|
setVisible(e) {
|
|
@@ -4751,7 +4751,7 @@ var Tt = class {
|
|
|
4751
4751
|
let t = Math.ceil(e / 1e3), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
|
|
4752
4752
|
return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
|
|
4753
4753
|
}
|
|
4754
|
-
},
|
|
4754
|
+
}, Wt = class {
|
|
4755
4755
|
config = { visible: !1 };
|
|
4756
4756
|
cachedBreaks = [];
|
|
4757
4757
|
lastDataLength = 0;
|
|
@@ -4795,7 +4795,7 @@ var Tt = class {
|
|
|
4795
4795
|
invalidateCache() {
|
|
4796
4796
|
this.lastDataLength = 0, this.cachedBreaks = [];
|
|
4797
4797
|
}
|
|
4798
|
-
},
|
|
4798
|
+
}, Gt = 1, Kt = class extends K {
|
|
4799
4799
|
alerts = [];
|
|
4800
4800
|
lastPrice = null;
|
|
4801
4801
|
requestRender = null;
|
|
@@ -4807,7 +4807,7 @@ var Tt = class {
|
|
|
4807
4807
|
this.pricePrecision = e;
|
|
4808
4808
|
}
|
|
4809
4809
|
addAlert(e, t = "crossing", n, r = !1) {
|
|
4810
|
-
let i = `tc_alert_${
|
|
4810
|
+
let i = `tc_alert_${Gt++}`, a = {
|
|
4811
4811
|
id: i,
|
|
4812
4812
|
price: e,
|
|
4813
4813
|
condition: t,
|
|
@@ -4887,7 +4887,7 @@ var Tt = class {
|
|
|
4887
4887
|
e.fillText(s, r.x + r.width - 4, a - 2);
|
|
4888
4888
|
}
|
|
4889
4889
|
}
|
|
4890
|
-
},
|
|
4890
|
+
}, qt = class extends K {
|
|
4891
4891
|
data = [];
|
|
4892
4892
|
currentIndex = 0;
|
|
4893
4893
|
timer = null;
|
|
@@ -4941,10 +4941,10 @@ var Tt = class {
|
|
|
4941
4941
|
dispose() {
|
|
4942
4942
|
this.stop(), this.removeAllListeners(), this.data = [];
|
|
4943
4943
|
}
|
|
4944
|
-
},
|
|
4944
|
+
}, J = 1, Jt = class {
|
|
4945
4945
|
static capture(e, t) {
|
|
4946
4946
|
return {
|
|
4947
|
-
version:
|
|
4947
|
+
version: J,
|
|
4948
4948
|
timestamp: Date.now(),
|
|
4949
4949
|
chartType: t?.chartType ?? "candlestick",
|
|
4950
4950
|
symbol: t?.symbol,
|
|
@@ -4967,7 +4967,7 @@ var Tt = class {
|
|
|
4967
4967
|
}
|
|
4968
4968
|
static deserialize(e) {
|
|
4969
4969
|
let t = JSON.parse(e);
|
|
4970
|
-
return t.version !==
|
|
4970
|
+
return t.version !== J && console.warn(`Chart state version mismatch: ${t.version} vs ${J}`), t;
|
|
4971
4971
|
}
|
|
4972
4972
|
static saveToStorage(e, t) {
|
|
4973
4973
|
localStorage.setItem(e, this.serialize(t));
|
|
@@ -4994,7 +4994,7 @@ var Tt = class {
|
|
|
4994
4994
|
}, n.click();
|
|
4995
4995
|
});
|
|
4996
4996
|
}
|
|
4997
|
-
},
|
|
4997
|
+
}, Yt = class {
|
|
4998
4998
|
undoStack = [];
|
|
4999
4999
|
redoStack = [];
|
|
5000
5000
|
maxHistory = 50;
|
|
@@ -5030,7 +5030,7 @@ var Tt = class {
|
|
|
5030
5030
|
redoCount: this.redoStack.length
|
|
5031
5031
|
};
|
|
5032
5032
|
}
|
|
5033
|
-
},
|
|
5033
|
+
}, Xt = class {
|
|
5034
5034
|
static toCSV(e) {
|
|
5035
5035
|
return ["Time,Open,High,Low,Close,Volume", ...e.map((e) => `${new Date(e.time).toISOString()},${e.open},${e.high},${e.low},${e.close},${e.volume}`)].join("\n");
|
|
5036
5036
|
}
|
|
@@ -5048,7 +5048,7 @@ var Tt = class {
|
|
|
5048
5048
|
let r = new Blob([e], { type: n }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
5049
5049
|
a.href = i, a.download = t, document.body.appendChild(a), a.click(), document.body.removeChild(a), URL.revokeObjectURL(i);
|
|
5050
5050
|
}
|
|
5051
|
-
},
|
|
5051
|
+
}, Zt = {
|
|
5052
5052
|
linear: (e) => e,
|
|
5053
5053
|
easeOutCubic: (e) => 1 - (1 - e) ** 3,
|
|
5054
5054
|
easeOutQuart: (e) => 1 - (1 - e) ** 4,
|
|
@@ -5056,7 +5056,7 @@ var Tt = class {
|
|
|
5056
5056
|
easeOutExpo: (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e),
|
|
5057
5057
|
easeOutElastic: (e) => e === 0 || e === 1 ? e : 2 ** (-10 * e) * Math.sin((e * 10 - .75) * (2 * Math.PI / 3)) + 1,
|
|
5058
5058
|
spring: (e) => 1 - Math.E ** (-6 * e) * Math.cos(8 * e)
|
|
5059
|
-
},
|
|
5059
|
+
}, Qt = class {
|
|
5060
5060
|
animations = /* @__PURE__ */ new Map();
|
|
5061
5061
|
frameId = 0;
|
|
5062
5062
|
running = !1;
|
|
@@ -5064,7 +5064,7 @@ var Tt = class {
|
|
|
5064
5064
|
this.animations.set(e, {
|
|
5065
5065
|
startTime: -1,
|
|
5066
5066
|
duration: t.duration,
|
|
5067
|
-
easing: t.easing ??
|
|
5067
|
+
easing: t.easing ?? Zt.easeOutCubic,
|
|
5068
5068
|
onUpdate: t.onUpdate,
|
|
5069
5069
|
onComplete: t.onComplete
|
|
5070
5070
|
}), this.running || (this.running = !0, this.tick());
|
|
@@ -5099,10 +5099,10 @@ var Tt = class {
|
|
|
5099
5099
|
};
|
|
5100
5100
|
//#endregion
|
|
5101
5101
|
//#region src/finance/BaseFinanceChart.ts
|
|
5102
|
-
function
|
|
5102
|
+
function $t(t) {
|
|
5103
5103
|
return !t || t === "dark" ? e : t === "light" ? o : t;
|
|
5104
5104
|
}
|
|
5105
|
-
var
|
|
5105
|
+
var en = class {
|
|
5106
5106
|
canvas;
|
|
5107
5107
|
ctx;
|
|
5108
5108
|
container;
|
|
@@ -5113,12 +5113,14 @@ var $t = class {
|
|
|
5113
5113
|
frameId = null;
|
|
5114
5114
|
resizeObserver;
|
|
5115
5115
|
constructor(e, t) {
|
|
5116
|
-
this.container = e, this.theme =
|
|
5116
|
+
this.container = e, this.theme = $t(t), this.canvas = document.createElement("canvas"), this.canvas.style.width = "100%", this.canvas.style.height = "100%", this.canvas.style.display = "block", e.appendChild(this.canvas), this.ctx = this.canvas.getContext("2d"), this.dpr = window.devicePixelRatio || 1, this.updateSize(), this.resizeObserver = new ResizeObserver(() => {
|
|
5117
5117
|
this.updateSize(), this.requestRender();
|
|
5118
5118
|
}), this.resizeObserver.observe(e);
|
|
5119
5119
|
}
|
|
5120
5120
|
updateSize() {
|
|
5121
|
-
this.dpr = window.devicePixelRatio || 1
|
|
5121
|
+
this.dpr = window.devicePixelRatio || 1;
|
|
5122
|
+
let e = this.container.getBoundingClientRect();
|
|
5123
|
+
this.width = e.width || this.container.clientWidth, this.height = e.height || this.container.clientHeight, this.canvas.width = Math.max(1, Math.floor(this.width * this.dpr)), this.canvas.height = Math.max(1, Math.floor(this.height * this.dpr));
|
|
5122
5124
|
}
|
|
5123
5125
|
requestRender() {
|
|
5124
5126
|
this.frameId === null && (this.frameId = requestAnimationFrame(() => {
|
|
@@ -5126,12 +5128,12 @@ var $t = class {
|
|
|
5126
5128
|
}));
|
|
5127
5129
|
}
|
|
5128
5130
|
setTheme(e) {
|
|
5129
|
-
this.theme =
|
|
5131
|
+
this.theme = $t(e), this.requestRender();
|
|
5130
5132
|
}
|
|
5131
5133
|
destroy() {
|
|
5132
5134
|
this.frameId !== null && cancelAnimationFrame(this.frameId), this.resizeObserver.disconnect(), this.canvas.remove();
|
|
5133
5135
|
}
|
|
5134
|
-
},
|
|
5136
|
+
}, tn = class {
|
|
5135
5137
|
pos = null;
|
|
5136
5138
|
canvas;
|
|
5137
5139
|
onUpdate;
|
|
@@ -5163,7 +5165,7 @@ var $t = class {
|
|
|
5163
5165
|
};
|
|
5164
5166
|
//#endregion
|
|
5165
5167
|
//#region src/finance/SparklineRenderer.ts
|
|
5166
|
-
function
|
|
5168
|
+
function nn(e, t, n, r, i) {
|
|
5167
5169
|
let { data: a, mode: o = "area", lineWidth: s = 1.5, showLastPoint: c = !1, showMinMax: l = !1 } = r;
|
|
5168
5170
|
if (a.length < 2 || t <= 0 || n <= 0) return;
|
|
5169
5171
|
let u = r.color ?? i.lineColor, d = r.fillColor ?? u, f = t - 4, p = n - 4, m = Infinity, h = -Infinity, g = 0, _ = 0;
|
|
@@ -5188,8 +5190,8 @@ function tn(e, t, n, r, i) {
|
|
|
5188
5190
|
}
|
|
5189
5191
|
//#endregion
|
|
5190
5192
|
//#region src/finance/DepthChartRenderer.ts
|
|
5191
|
-
var
|
|
5192
|
-
function
|
|
5193
|
+
var rn = 50, an = 60, Y = 20, on = .2;
|
|
5194
|
+
function sn(e) {
|
|
5193
5195
|
let t = [...e].sort((e, t) => t.price - e.price), n = [], r = 0;
|
|
5194
5196
|
for (let e of t) r += e.volume, n.push({
|
|
5195
5197
|
price: e.price,
|
|
@@ -5197,7 +5199,7 @@ function on(e) {
|
|
|
5197
5199
|
});
|
|
5198
5200
|
return n;
|
|
5199
5201
|
}
|
|
5200
|
-
function
|
|
5202
|
+
function cn(e) {
|
|
5201
5203
|
let t = [...e].sort((e, t) => e.price - t.price), n = [], r = 0;
|
|
5202
5204
|
for (let e of t) r += e.volume, n.push({
|
|
5203
5205
|
price: e.price,
|
|
@@ -5205,20 +5207,20 @@ function sn(e) {
|
|
|
5205
5207
|
});
|
|
5206
5208
|
return n;
|
|
5207
5209
|
}
|
|
5208
|
-
function
|
|
5210
|
+
function ln(e, t) {
|
|
5209
5211
|
return {
|
|
5210
|
-
left:
|
|
5211
|
-
right: e -
|
|
5212
|
-
top:
|
|
5213
|
-
bottom: t -
|
|
5214
|
-
plotWidth: e -
|
|
5215
|
-
plotHeight: t -
|
|
5212
|
+
left: rn,
|
|
5213
|
+
right: e - an,
|
|
5214
|
+
top: Y,
|
|
5215
|
+
bottom: t - Y,
|
|
5216
|
+
plotWidth: e - rn - an,
|
|
5217
|
+
plotHeight: t - Y * 2
|
|
5216
5218
|
};
|
|
5217
5219
|
}
|
|
5218
|
-
function
|
|
5220
|
+
function un(e, t, n, r) {
|
|
5219
5221
|
e.fillStyle = r, e.fillRect(0, 0, t, n);
|
|
5220
5222
|
}
|
|
5221
|
-
function
|
|
5223
|
+
function dn(e, t, n, r, i, a, o, s) {
|
|
5222
5224
|
let { left: c, right: l, top: u, bottom: d, plotWidth: p, plotHeight: m } = t;
|
|
5223
5225
|
e.save(), e.strokeStyle = a.grid, e.lineWidth = .5, e.fillStyle = a.axisLabel, e.font = `${a.font.sizeSmall}px ${a.font.family}`;
|
|
5224
5226
|
let h = f(0, i, 5);
|
|
@@ -5233,7 +5235,7 @@ function un(e, t, n, r, i, a, o, s) {
|
|
|
5233
5235
|
}
|
|
5234
5236
|
e.restore();
|
|
5235
5237
|
}
|
|
5236
|
-
function
|
|
5238
|
+
function fn(e, t, n, r, i, a, o, s, c) {
|
|
5237
5239
|
if (t.length === 0) return;
|
|
5238
5240
|
let { left: l, bottom: u, plotWidth: d, plotHeight: f } = n, p = (e) => l + (e - r) / i * d, m = (e) => u - e / a * f;
|
|
5239
5241
|
if (e.beginPath(), c === "bid") {
|
|
@@ -5266,14 +5268,14 @@ function dn(e, t, n, r, i, a, o, s, c) {
|
|
|
5266
5268
|
}
|
|
5267
5269
|
e.strokeStyle = s, e.lineWidth = 1.5, e.stroke();
|
|
5268
5270
|
}
|
|
5269
|
-
function
|
|
5271
|
+
function pn(e, t, n, r, i, a, o, s, c) {
|
|
5270
5272
|
let { left: l, top: u, bottom: d, plotWidth: f } = r, p = l + (t - i) / a * f;
|
|
5271
5273
|
if (e.save(), e.strokeStyle = o.textSecondary, e.lineWidth = 1, e.setLineDash([4, 4]), e.beginPath(), e.moveTo(p, u), e.lineTo(p, d), e.stroke(), e.restore(), s) {
|
|
5272
5274
|
let t = `Spread: ${c(n)}`;
|
|
5273
5275
|
e.save(), e.font = `${o.font.sizeSmall}px ${o.font.family}`, e.fillStyle = o.textSecondary, e.textAlign = "center", e.textBaseline = "bottom", e.fillText(t, p, u - 2), e.restore();
|
|
5274
5276
|
}
|
|
5275
5277
|
}
|
|
5276
|
-
function
|
|
5278
|
+
function mn(e, t, n, r, i, a, o, s, c, l, u) {
|
|
5277
5279
|
let { left: d, top: f, bottom: p, plotWidth: m, plotHeight: h } = i, g = t.x;
|
|
5278
5280
|
if (g < d || g > i.right) return;
|
|
5279
5281
|
let _ = a + (g - d) / m * o, v = 0, y = "";
|
|
@@ -5299,47 +5301,47 @@ function pn(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
5299
5301
|
for (let t = 0; t < b.length; t++) e.fillText(b[t], C + 8, w + 6 + t * (c.font.sizeSmall + 4));
|
|
5300
5302
|
e.restore();
|
|
5301
5303
|
}
|
|
5302
|
-
function
|
|
5304
|
+
function hn(e) {
|
|
5303
5305
|
return e.toFixed(2);
|
|
5304
5306
|
}
|
|
5305
|
-
function
|
|
5307
|
+
function gn(e) {
|
|
5306
5308
|
return e >= 1e6 ? (e / 1e6).toFixed(2) + "M" : e >= 1e3 ? (e / 1e3).toFixed(1) + "K" : e.toFixed(0);
|
|
5307
5309
|
}
|
|
5308
|
-
function
|
|
5310
|
+
function _n(e, t, n, r, i, a) {
|
|
5309
5311
|
let { data: o } = r;
|
|
5310
5312
|
if (o.bids.length === 0 && o.asks.length === 0 || t <= 0 || n <= 0) return;
|
|
5311
|
-
let s = r.bidColor ?? i.candleUp, c = r.askColor ?? i.candleDown, l = r.bidFillColor ?? s + "40", u = r.askFillColor ?? c + "40", d = r.midPriceLine !== !1, f = r.spreadLabel !== !1, p = r.priceFormat ??
|
|
5312
|
-
|
|
5313
|
+
let s = r.bidColor ?? i.candleUp, c = r.askColor ?? i.candleDown, l = r.bidFillColor ?? s + "40", u = r.askFillColor ?? c + "40", d = r.midPriceLine !== !1, f = r.spreadLabel !== !1, p = r.priceFormat ?? hn, m = r.volumeFormat ?? gn, h = sn(o.bids), g = cn(o.asks), _ = h.length > 0 ? h[0].price : 0, v = g.length > 0 ? g[0].price : 0, y = h.length > 0 && g.length > 0 ? (_ + v) / 2 : _ || v, b = g.length > 0 && h.length > 0 ? v - _ : 0, x = h.length > 0 ? h[h.length - 1].price : y, S = g.length > 0 ? g[g.length - 1].price : y, C = Math.max(y - x, S - y) * (1 + on), w = y - C, T = y + C, E = T - w, D = h.length > 0 ? h[h.length - 1].cumulativeVolume : 0, O = g.length > 0 ? g[g.length - 1].cumulativeVolume : 0, k = Math.max(D, O) || 1, A = ln(t, n);
|
|
5314
|
+
un(e, t, n, i.background), dn(e, A, w, T, k, i, p, m), fn(e, h, A, w, E, k, l, s, "bid"), fn(e, g, A, w, E, k, u, c, "ask"), d && pn(e, y, b, A, w, E, i, f, p), a && mn(e, a, h, g, A, w, E, k, i, p, m);
|
|
5313
5315
|
}
|
|
5314
5316
|
//#endregion
|
|
5315
5317
|
//#region src/finance/EquityCurveRenderer.ts
|
|
5316
|
-
var
|
|
5317
|
-
function
|
|
5318
|
+
var vn = 70, yn = 30, bn = 20, xn = 20, Sn = .05;
|
|
5319
|
+
function Cn(e, t) {
|
|
5318
5320
|
return {
|
|
5319
|
-
left:
|
|
5320
|
-
right: e -
|
|
5321
|
-
top:
|
|
5322
|
-
bottom: t -
|
|
5323
|
-
plotWidth: e -
|
|
5324
|
-
plotHeight: t -
|
|
5321
|
+
left: vn,
|
|
5322
|
+
right: e - bn,
|
|
5323
|
+
top: xn,
|
|
5324
|
+
bottom: t - yn,
|
|
5325
|
+
plotWidth: e - vn - bn,
|
|
5326
|
+
plotHeight: t - xn - yn
|
|
5325
5327
|
};
|
|
5326
5328
|
}
|
|
5327
|
-
function
|
|
5329
|
+
function wn(e, t) {
|
|
5328
5330
|
let n = Infinity, r = -Infinity;
|
|
5329
5331
|
for (let t of e) t.value < n && (n = t.value), t.value > r && (r = t.value);
|
|
5330
5332
|
if (t) for (let e of t) e.value < n && (n = e.value), e.value > r && (r = e.value);
|
|
5331
|
-
let i = (r - n) *
|
|
5333
|
+
let i = (r - n) * Sn;
|
|
5332
5334
|
return {
|
|
5333
5335
|
valMin: n - i,
|
|
5334
5336
|
valMax: r + i
|
|
5335
5337
|
};
|
|
5336
5338
|
}
|
|
5337
|
-
function
|
|
5339
|
+
function Tn(e) {
|
|
5338
5340
|
let t = [], n = -Infinity;
|
|
5339
5341
|
for (let r of e) r.value > n && (n = r.value), t.push(n);
|
|
5340
5342
|
return t;
|
|
5341
5343
|
}
|
|
5342
|
-
function
|
|
5344
|
+
function En(e) {
|
|
5343
5345
|
let t = 864e5;
|
|
5344
5346
|
if (365.25 * t, e < 7 * t) {
|
|
5345
5347
|
let e = new Intl.DateTimeFormat(void 0, {
|
|
@@ -5361,13 +5363,13 @@ function Tn(e) {
|
|
|
5361
5363
|
});
|
|
5362
5364
|
return (e) => n.format(new Date(e));
|
|
5363
5365
|
}
|
|
5364
|
-
function
|
|
5366
|
+
function Dn(e) {
|
|
5365
5367
|
return Math.abs(e) >= 1e6 ? (e / 1e6).toFixed(2) + "M" : Math.abs(e) >= 1e3 ? (e / 1e3).toFixed(1) + "K" : e.toFixed(2);
|
|
5366
5368
|
}
|
|
5367
|
-
function
|
|
5369
|
+
function On(e, t, n, r) {
|
|
5368
5370
|
e.fillStyle = r, e.fillRect(0, 0, t, n);
|
|
5369
5371
|
}
|
|
5370
|
-
function
|
|
5372
|
+
function kn(e, t, n, r, i, a, o, s, c) {
|
|
5371
5373
|
let { left: l, right: u, top: d, bottom: p, plotWidth: m, plotHeight: h } = t;
|
|
5372
5374
|
e.save(), e.strokeStyle = o.grid, e.lineWidth = .5, e.fillStyle = o.axisLabel, e.font = `${o.font.sizeSmall}px ${o.font.family}`;
|
|
5373
5375
|
let g = f(n, r, 6), _ = Math.ceil(n / g) * g;
|
|
@@ -5382,21 +5384,21 @@ function On(e, t, n, r, i, a, o, s, c) {
|
|
|
5382
5384
|
}
|
|
5383
5385
|
e.restore();
|
|
5384
5386
|
}
|
|
5385
|
-
function
|
|
5387
|
+
function An(e, t, n, r, i, a, o, s, c) {
|
|
5386
5388
|
if (t.length < 2) return;
|
|
5387
5389
|
let { left: l, bottom: u, plotWidth: d, plotHeight: f } = n, p = (e) => l + (e - r) / i * d, m = (e) => u - (e - a) / o * f;
|
|
5388
5390
|
e.save(), e.beginPath(), e.moveTo(p(t[0].time), m(t[0].value));
|
|
5389
5391
|
for (let n = 1; n < t.length; n++) e.lineTo(p(t[n].time), m(t[n].value));
|
|
5390
5392
|
e.strokeStyle = s, e.lineWidth = c, e.lineJoin = "round", e.stroke(), e.restore();
|
|
5391
5393
|
}
|
|
5392
|
-
function
|
|
5394
|
+
function jn(e, t, n, r, i, a, o, s) {
|
|
5393
5395
|
if (t.length < 2) return;
|
|
5394
5396
|
let { left: c, bottom: l, plotWidth: u, plotHeight: d } = n, f = (e) => c + (e - r) / i * u, p = (e) => l - (e - a) / o * d, m = e.createLinearGradient(0, n.top, 0, l);
|
|
5395
5397
|
m.addColorStop(0, s + "40"), m.addColorStop(1, "transparent"), e.save(), e.beginPath(), e.moveTo(f(t[0].time), p(t[0].value));
|
|
5396
5398
|
for (let n = 1; n < t.length; n++) e.lineTo(f(t[n].time), p(t[n].value));
|
|
5397
5399
|
e.lineTo(f(t[t.length - 1].time), l), e.lineTo(f(t[0].time), l), e.closePath(), e.fillStyle = m, e.fill(), e.restore();
|
|
5398
5400
|
}
|
|
5399
|
-
function
|
|
5401
|
+
function Mn(e, t, n, r, i, a, o, s, c) {
|
|
5400
5402
|
if (t.length < 2) return;
|
|
5401
5403
|
let { left: l, bottom: u, plotWidth: d, plotHeight: f } = r, p = (e) => l + (e - i) / a * d, m = (e) => u - (e - o) / s * f;
|
|
5402
5404
|
e.save(), e.fillStyle = c, e.beginPath(), e.moveTo(p(t[0].time), m(n[0]));
|
|
@@ -5404,12 +5406,12 @@ function An(e, t, n, r, i, a, o, s, c) {
|
|
|
5404
5406
|
for (let n = t.length - 1; n >= 0; n--) e.lineTo(p(t[n].time), m(t[n].value));
|
|
5405
5407
|
e.closePath(), e.fill(), e.restore();
|
|
5406
5408
|
}
|
|
5407
|
-
function
|
|
5409
|
+
function Nn(e, t, n, r, i, a, o, s, c, l) {
|
|
5408
5410
|
if (t.length === 0) return;
|
|
5409
5411
|
let { left: u, bottom: d, plotWidth: f, plotHeight: p } = n, m = t[t.length - 1], h = u + (m.time - r) / i * f, g = d - (m.value - a) / o * p;
|
|
5410
5412
|
e.save(), e.font = `${l.font.sizeSmall}px ${l.font.family}`, e.fillStyle = c, e.textAlign = "left", e.textBaseline = "middle", e.fillText(s, h + 4, g), e.restore();
|
|
5411
5413
|
}
|
|
5412
|
-
function
|
|
5414
|
+
function Pn(e, t, n, r, i, a, o, s, c, l, u, d) {
|
|
5413
5415
|
let { left: f, top: p, bottom: m, plotWidth: h, plotHeight: g } = i, _ = t.x;
|
|
5414
5416
|
if (_ < f || _ > i.right) return;
|
|
5415
5417
|
e.save(), e.strokeStyle = l.crosshair, e.lineWidth = .5, e.setLineDash([4, 4]), e.beginPath(), e.moveTo(_, p), e.lineTo(_, m), e.stroke(), e.restore();
|
|
@@ -5427,15 +5429,15 @@ function Mn(e, t, n, r, i, a, o, s, c, l, u, d) {
|
|
|
5427
5429
|
for (let t = 0; t < S.length; t++) e.fillText(S[t], D + 8, O + 6 + t * (l.font.sizeSmall + 4));
|
|
5428
5430
|
e.restore();
|
|
5429
5431
|
}
|
|
5430
|
-
function
|
|
5432
|
+
function Fn(e, t, n, r, i, a) {
|
|
5431
5433
|
let { data: o } = r;
|
|
5432
5434
|
if (o.length < 2 || t <= 0 || n <= 0) return;
|
|
5433
|
-
let s = r.lineColor ?? i.lineColor, c = r.lineWidth ?? 1.5, l = r.drawdown === !0, u = r.drawdownColor ?? i.candleDown + "30", d = r.fillArea === !0, f = r.benchmark, p = r.benchmarkColor ?? i.textSecondary, m = r.benchmarkLabel ?? "Benchmark", h = r.valueFormat ??
|
|
5434
|
-
|
|
5435
|
+
let s = r.lineColor ?? i.lineColor, c = r.lineWidth ?? 1.5, l = r.drawdown === !0, u = r.drawdownColor ?? i.candleDown + "30", d = r.fillArea === !0, f = r.benchmark, p = r.benchmarkColor ?? i.textSecondary, m = r.benchmarkLabel ?? "Benchmark", h = r.valueFormat ?? Dn, { valMin: g, valMax: _ } = wn(o, f), v = _ - g || 1, y = o[0].time, b = o[o.length - 1].time, x = b - y || 1, S = r.timeFormat ?? En(x), C = Cn(t, n);
|
|
5436
|
+
On(e, t, n, i.background), kn(e, C, g, _, y, b, i, h, S), l && Mn(e, o, Tn(o), C, y, x, g, v, u), d && jn(e, o, C, y, x, g, v, s), An(e, o, C, y, x, g, v, s, c), f && f.length >= 2 && (An(e, f, C, y, x, g, v, p, 1), Nn(e, f, C, y, x, g, v, m, p, i)), a && Pn(e, a, o, f, C, y, x, g, v, i, S, h);
|
|
5435
5437
|
}
|
|
5436
5438
|
//#endregion
|
|
5437
5439
|
//#region src/finance/HeatmapLayout.ts
|
|
5438
|
-
function
|
|
5440
|
+
function In(e, t, n) {
|
|
5439
5441
|
if (e.length === 0) return [];
|
|
5440
5442
|
let r = e.length, i = Math.ceil(Math.sqrt(r)), a = Math.ceil(r / i), o = t.width / i, s = t.height / a, c = [];
|
|
5441
5443
|
for (let a = 0; a < r; a++) {
|
|
@@ -5452,7 +5454,7 @@ function Pn(e, t, n) {
|
|
|
5452
5454
|
}
|
|
5453
5455
|
return c;
|
|
5454
5456
|
}
|
|
5455
|
-
function
|
|
5457
|
+
function Ln(e, t) {
|
|
5456
5458
|
let n = e.reduce((e, t) => e + t, 0);
|
|
5457
5459
|
if (n === 0 || t === 0) return Infinity;
|
|
5458
5460
|
let r = 0;
|
|
@@ -5462,7 +5464,7 @@ function Fn(e, t) {
|
|
|
5462
5464
|
}
|
|
5463
5465
|
return r;
|
|
5464
5466
|
}
|
|
5465
|
-
function
|
|
5467
|
+
function X(e, t, n, r, i, a) {
|
|
5466
5468
|
let o = r ? n.height : n.width, s = e.reduce((e, t) => e + t, 0), c = o > 0 ? s / o : 0, l = 0;
|
|
5467
5469
|
for (let o = 0; o < e.length; o++) {
|
|
5468
5470
|
let s = c > 0 ? e[o] / c : 0, u;
|
|
@@ -5482,19 +5484,19 @@ function Q(e, t, n, r, i, a) {
|
|
|
5482
5484
|
}), l += s;
|
|
5483
5485
|
}
|
|
5484
5486
|
}
|
|
5485
|
-
function
|
|
5487
|
+
function Rn(e, t, n, r, i) {
|
|
5486
5488
|
if (e.length === 0) return;
|
|
5487
5489
|
let a = n.width >= n.height, o = a ? n.height : n.width;
|
|
5488
5490
|
if (e.length === 1) {
|
|
5489
|
-
|
|
5491
|
+
X(e, t, n, a, r, i);
|
|
5490
5492
|
return;
|
|
5491
5493
|
}
|
|
5492
5494
|
let s = [], c = [], l = 0;
|
|
5493
5495
|
for (; l < e.length;) {
|
|
5494
5496
|
let u = [...s, e[l]];
|
|
5495
|
-
if (s.length === 0 ||
|
|
5497
|
+
if (s.length === 0 || Ln(u, o) <= Ln(s, o)) s.push(e[l]), c.push(t[l]), l++;
|
|
5496
5498
|
else {
|
|
5497
|
-
|
|
5499
|
+
X(s, c, n, a, r, i);
|
|
5498
5500
|
let u = s.reduce((e, t) => e + t, 0), d = o > 0 ? u / o : 0;
|
|
5499
5501
|
n = a ? {
|
|
5500
5502
|
x: n.x + d,
|
|
@@ -5506,28 +5508,28 @@ function In(e, t, n, r, i) {
|
|
|
5506
5508
|
y: n.y + d,
|
|
5507
5509
|
width: n.width,
|
|
5508
5510
|
height: n.height - d
|
|
5509
|
-
},
|
|
5511
|
+
}, Rn(e.slice(l), t.slice(l), n, r, i);
|
|
5510
5512
|
return;
|
|
5511
5513
|
}
|
|
5512
5514
|
}
|
|
5513
|
-
s.length > 0 &&
|
|
5515
|
+
s.length > 0 && X(s, c, n, a, r, i);
|
|
5514
5516
|
}
|
|
5515
|
-
function
|
|
5517
|
+
function zn(e, t, n) {
|
|
5516
5518
|
if (e.length === 0) return [];
|
|
5517
5519
|
let r = [...e].sort((e, t) => t.weight - e.weight), i = r.reduce((e, t) => e + Math.max(0, t.weight), 0);
|
|
5518
5520
|
if (i === 0) return [];
|
|
5519
5521
|
let a = t.width * t.height, o = r.map((e) => Math.max(0, e.weight) / i * a), s = r.map((e) => e.id), c = [];
|
|
5520
|
-
return
|
|
5522
|
+
return Rn(o, s, { ...t }, n, c), c;
|
|
5521
5523
|
}
|
|
5522
5524
|
//#endregion
|
|
5523
5525
|
//#region src/finance/HeatmapRenderer.ts
|
|
5524
|
-
function
|
|
5526
|
+
function Bn(e) {
|
|
5525
5527
|
return (e >= 0 ? "+" : "") + e.toFixed(2) + "%";
|
|
5526
5528
|
}
|
|
5527
|
-
function
|
|
5529
|
+
function Vn(e) {
|
|
5528
5530
|
return e.label;
|
|
5529
5531
|
}
|
|
5530
|
-
function
|
|
5532
|
+
function Hn(e, t) {
|
|
5531
5533
|
let n = t.min ?? -5, r = t.max ?? 5;
|
|
5532
5534
|
if (e <= n) return t.negative;
|
|
5533
5535
|
if (e >= r) return t.positive;
|
|
@@ -5538,11 +5540,11 @@ function Bn(e, t) {
|
|
|
5538
5540
|
let i = e / r;
|
|
5539
5541
|
return m(t.zero, t.positive, i);
|
|
5540
5542
|
}
|
|
5541
|
-
function
|
|
5543
|
+
function Z(e, t, n, r, i, a) {
|
|
5542
5544
|
let o = Math.min(a, r / 2, i / 2);
|
|
5543
5545
|
e.beginPath(), e.moveTo(t + o, n), e.lineTo(t + r - o, n), e.arcTo(t + r, n, t + r, n + o, o), e.lineTo(t + r, n + i - o), e.arcTo(t + r, n + i, t + r - o, n + i, o), e.lineTo(t + o, n + i), e.arcTo(t, n + i, t, n + i - o, o), e.lineTo(t, n + o), e.arcTo(t, n, t + o, n, o), e.closePath();
|
|
5544
5546
|
}
|
|
5545
|
-
function
|
|
5547
|
+
function Un(e, t, n, r, i, a, o, s, c, l, u) {
|
|
5546
5548
|
if (i < 40 || a < 30) return;
|
|
5547
5549
|
let d = n + i / 2, f = r + a / 2;
|
|
5548
5550
|
if (e.save(), e.shadowColor = "rgba(0,0,0,0.6)", e.shadowBlur = 2, e.fillStyle = "#FFFFFF", e.textAlign = "center", s) {
|
|
@@ -5555,22 +5557,22 @@ function Vn(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
5555
5557
|
}
|
|
5556
5558
|
e.restore();
|
|
5557
5559
|
}
|
|
5558
|
-
function
|
|
5560
|
+
function Wn(e, t, n, r, i, a, o, s) {
|
|
5559
5561
|
let c = [o(t), s(t.value)];
|
|
5560
5562
|
if (t.meta) for (let [e, n] of Object.entries(t.meta)) c.push(e + ": " + String(n));
|
|
5561
5563
|
e.save(), e.font = a.font.sizeSmall + "px " + a.font.family;
|
|
5562
5564
|
let l = Math.max(...c.map((t) => e.measureText(t).width)) + 16, u = a.font.sizeSmall + 4, d = c.length * u + 12, f = n.x + 14, p = n.y - d / 2;
|
|
5563
|
-
f + l > r && (f = n.x - l - 14), p < 0 && (p = 0), p + d > i && (p = i - d), e.fillStyle = a.axisLabelBackground, e.globalAlpha = .92,
|
|
5565
|
+
f + l > r && (f = n.x - l - 14), p < 0 && (p = 0), p + d > i && (p = i - d), e.fillStyle = a.axisLabelBackground, e.globalAlpha = .92, Z(e, f, p, l, d, 4), e.fill(), e.globalAlpha = 1, e.fillStyle = a.text, e.textBaseline = "top", e.textAlign = "left";
|
|
5564
5566
|
for (let t = 0; t < c.length; t++) e.fillText(c[t], f + 8, p + 6 + t * u);
|
|
5565
5567
|
e.restore();
|
|
5566
5568
|
}
|
|
5567
|
-
function
|
|
5569
|
+
function Gn(e, t, n, r, i, a, o, s) {
|
|
5568
5570
|
if (r.length === 0 || i.length === 0 || t <= 0 || n <= 0) return null;
|
|
5569
5571
|
let c = a.colorScale ?? {
|
|
5570
5572
|
negative: "#EF5350",
|
|
5571
5573
|
zero: "#424242",
|
|
5572
5574
|
positive: "#26A69A"
|
|
5573
|
-
}, l = a.cellRadius ?? 4, u = a.showLabels !== !1, d = a.showValues !== !1, f = a.valueFormat ??
|
|
5575
|
+
}, l = a.cellRadius ?? 4, u = a.showLabels !== !1, d = a.showValues !== !1, f = a.valueFormat ?? Bn, p = a.labelFormat ?? Vn, m = /* @__PURE__ */ new Map();
|
|
5574
5576
|
for (let e of r) m.set(e.id, e);
|
|
5575
5577
|
let h = null, g = null;
|
|
5576
5578
|
if (s) for (let e of i) {
|
|
@@ -5591,12 +5593,272 @@ function Un(e, t, n, r, i, a, o, s) {
|
|
|
5591
5593
|
if (!n) continue;
|
|
5592
5594
|
let { x: r, y: i, width: a, height: s } = t.rect;
|
|
5593
5595
|
if (a <= 0 || s <= 0) continue;
|
|
5594
|
-
let g =
|
|
5595
|
-
|
|
5596
|
+
let g = Hn(n.value, c);
|
|
5597
|
+
Z(e, r, i, a, s, l), e.fillStyle = g, e.fill(), Un(e, n, r, i, a, s, o, u, d, p, f), t.id === h && (Z(e, r, i, a, s, l), e.strokeStyle = "#FFFFFF", e.lineWidth = 1.5, e.stroke());
|
|
5598
|
+
}
|
|
5599
|
+
return g && s && Wn(e, g.cell, s, t, n, o, p, f), g;
|
|
5600
|
+
}
|
|
5601
|
+
//#endregion
|
|
5602
|
+
//#region src/finance/WaterfallRenderer.ts
|
|
5603
|
+
var Kn = 60, qn = 12, Jn = 24, Yn = 40, Xn = .7, Zn = 1;
|
|
5604
|
+
function Qn(e) {
|
|
5605
|
+
return e.type ? e.type : e.value > 0 ? "positive" : e.value < 0 ? "negative" : "subtotal";
|
|
5606
|
+
}
|
|
5607
|
+
function $n(e) {
|
|
5608
|
+
let t = Math.abs(e);
|
|
5609
|
+
return t >= 1e6 ? (e / 1e6).toFixed(2) + "M" : t >= 1e3 ? (e / 1e3).toFixed(1) + "K" : e.toFixed(2);
|
|
5610
|
+
}
|
|
5611
|
+
function er(e, t) {
|
|
5612
|
+
return {
|
|
5613
|
+
left: Kn,
|
|
5614
|
+
right: e - qn,
|
|
5615
|
+
top: Jn,
|
|
5616
|
+
bottom: t - Yn,
|
|
5617
|
+
plotWidth: e - Kn - qn,
|
|
5618
|
+
plotHeight: t - Jn - Yn
|
|
5619
|
+
};
|
|
5620
|
+
}
|
|
5621
|
+
function tr(e, t, n, r, i) {
|
|
5622
|
+
let a = Array(e.length), o = Array(e.length), s = t.plotWidth / e.length, c = s * n, l = (s - c) / 2, { left: u, bottom: d, plotHeight: f } = t, p = 0;
|
|
5623
|
+
for (let t = 0; t < e.length; t++) {
|
|
5624
|
+
let n = e[t], m = Qn(n), h, g;
|
|
5625
|
+
m === "total" || m === "subtotal" ? (h = 0, g = n.value, p = n.value) : (h = p, g = p + n.value, p = g);
|
|
5626
|
+
let _ = Math.min(h, g), v = Math.max(h, g), y = d - (_ - r) / i * f, b = d - (v - r) / i * f, x = Math.min(y, b), S = Math.max(Math.abs(b - y), Zn), C = u + t * s, w = C + l;
|
|
5627
|
+
a[t] = {
|
|
5628
|
+
label: n.label,
|
|
5629
|
+
value: n.value,
|
|
5630
|
+
start: h,
|
|
5631
|
+
end: g,
|
|
5632
|
+
type: m,
|
|
5633
|
+
rectX: w,
|
|
5634
|
+
rectY: x,
|
|
5635
|
+
rectW: c,
|
|
5636
|
+
rectH: S,
|
|
5637
|
+
slotX: C,
|
|
5638
|
+
slotW: s
|
|
5639
|
+
}, o[t] = p;
|
|
5640
|
+
}
|
|
5641
|
+
return {
|
|
5642
|
+
bars: a,
|
|
5643
|
+
cumulatives: o
|
|
5644
|
+
};
|
|
5645
|
+
}
|
|
5646
|
+
function nr(e) {
|
|
5647
|
+
if (e.length === 0) return {
|
|
5648
|
+
valMin: 0,
|
|
5649
|
+
valMax: 1
|
|
5650
|
+
};
|
|
5651
|
+
let t = 0, n = 0, r = 0;
|
|
5652
|
+
for (let i = 0; i < e.length; i++) {
|
|
5653
|
+
let a = e[i], o = Qn(a), s, c;
|
|
5654
|
+
o === "total" || o === "subtotal" ? (s = 0, c = a.value, r = a.value) : (s = r, c = r + a.value, r = c), s < t && (t = s), c < t && (t = c), s > n && (n = s), c > n && (n = c);
|
|
5655
|
+
}
|
|
5656
|
+
let i = (n - t || 1) * .1;
|
|
5657
|
+
return {
|
|
5658
|
+
valMin: t - i,
|
|
5659
|
+
valMax: n + i
|
|
5660
|
+
};
|
|
5661
|
+
}
|
|
5662
|
+
function rr(e, t, n, r) {
|
|
5663
|
+
e.fillStyle = r, e.fillRect(0, 0, t, n);
|
|
5664
|
+
}
|
|
5665
|
+
function ir(e, t, n, r, i, a) {
|
|
5666
|
+
let { left: o, right: s, top: c, bottom: l, plotHeight: u } = t, d = r - n || 1;
|
|
5667
|
+
e.strokeStyle = i.grid, e.lineWidth = .5, e.fillStyle = i.axisLabel, e.font = `${i.font.sizeSmall}px ${i.font.family}`, e.textAlign = "right", e.textBaseline = "middle";
|
|
5668
|
+
let p = f(n, r, 5), m = Math.ceil(n / p) * p;
|
|
5669
|
+
e.beginPath();
|
|
5670
|
+
for (let t = m; t <= r; t += p) {
|
|
5671
|
+
let r = Math.round(l - (t - n) / d * u) + .5;
|
|
5672
|
+
r < c || r > l || (e.moveTo(o, r), e.lineTo(s, r));
|
|
5673
|
+
}
|
|
5674
|
+
e.stroke();
|
|
5675
|
+
for (let t = m; t <= r; t += p) {
|
|
5676
|
+
let r = l - (t - n) / d * u;
|
|
5677
|
+
r < c - 1 || r > l + 1 || e.fillText(a(t), o - 6, r);
|
|
5678
|
+
}
|
|
5679
|
+
if (n < 0 && r > 0) {
|
|
5680
|
+
let t = Math.round(l - (0 - n) / d * u) + .5;
|
|
5681
|
+
e.strokeStyle = i.axisLine, e.lineWidth = 1, e.beginPath(), e.moveTo(o, t), e.lineTo(s, t), e.stroke();
|
|
5682
|
+
}
|
|
5683
|
+
}
|
|
5684
|
+
function ar(e, t, n) {
|
|
5685
|
+
let r = [
|
|
5686
|
+
"positive",
|
|
5687
|
+
"negative",
|
|
5688
|
+
"total",
|
|
5689
|
+
"subtotal"
|
|
5690
|
+
];
|
|
5691
|
+
for (let i = 0; i < r.length; i++) {
|
|
5692
|
+
let a = r[i], o = n[a], s = !1;
|
|
5693
|
+
e.beginPath();
|
|
5694
|
+
for (let n = 0; n < t.length; n++) {
|
|
5695
|
+
let r = t[n];
|
|
5696
|
+
if (r.type !== a) continue;
|
|
5697
|
+
let i = Math.round(r.rectX), o = Math.round(r.rectY), c = Math.round(r.rectW), l = Math.round(r.rectH);
|
|
5698
|
+
e.rect(i, o, c, l), s = !0;
|
|
5699
|
+
}
|
|
5700
|
+
s && (e.fillStyle = o, e.fill());
|
|
5701
|
+
}
|
|
5702
|
+
}
|
|
5703
|
+
function or(e, t, n, r, i, a, o) {
|
|
5704
|
+
if (o === "none" || t.length < 2) return;
|
|
5705
|
+
let { bottom: s, plotHeight: c } = n;
|
|
5706
|
+
e.strokeStyle = a, e.lineWidth = 1, o === "dashed" ? e.setLineDash([4, 4]) : e.setLineDash([]), e.beginPath();
|
|
5707
|
+
for (let n = 0; n < t.length - 1; n++) {
|
|
5708
|
+
let a = t[n], o = t[n + 1], l = a.end, u = Math.round(s - (l - r) / i * c) + .5, d = Math.round(a.rectX + a.rectW), f = Math.round(o.rectX);
|
|
5709
|
+
f <= d || (e.moveTo(d, u), e.lineTo(f, u));
|
|
5710
|
+
}
|
|
5711
|
+
e.stroke(), e.setLineDash([]);
|
|
5712
|
+
}
|
|
5713
|
+
function sr(e, t, n, r, i, a) {
|
|
5714
|
+
e.fillStyle = r.text, e.font = `${r.font.sizeSmall}px ${r.font.family}`, e.textAlign = "center";
|
|
5715
|
+
for (let r = 0; r < t.length; r++) {
|
|
5716
|
+
let o = t[r], s;
|
|
5717
|
+
s = o.type === "total" || o.type === "subtotal" ? i(o.value) : a ? `${o.value >= 0 ? "+" : ""}${i(o.value)}` : i(n[r]);
|
|
5718
|
+
let c = o.rectX + o.rectW / 2;
|
|
5719
|
+
o.end < o.start ? (e.textBaseline = "top", e.fillText(s, c, o.rectY + o.rectH + 4)) : (e.textBaseline = "bottom", e.fillText(s, c, o.rectY - 4));
|
|
5720
|
+
}
|
|
5721
|
+
}
|
|
5722
|
+
function cr(e, t, n, r, i) {
|
|
5723
|
+
e.fillStyle = r.axisLabel, e.font = `${r.font.sizeSmall}px ${r.font.family}`, e.textAlign = "center", e.textBaseline = "top";
|
|
5724
|
+
let a = n.bottom + 6, o = t.length > 0 ? t[0].slotW - 4 : 0, s = !1;
|
|
5725
|
+
for (let n = 0; n < t.length; n++) if (e.measureText(i(t[n].label)).width > o) {
|
|
5726
|
+
s = !0;
|
|
5727
|
+
break;
|
|
5728
|
+
}
|
|
5729
|
+
if (!s) {
|
|
5730
|
+
for (let n = 0; n < t.length; n++) {
|
|
5731
|
+
let r = t[n], o = r.slotX + r.slotW / 2;
|
|
5732
|
+
e.fillText(i(r.label), o, a);
|
|
5733
|
+
}
|
|
5734
|
+
return;
|
|
5596
5735
|
}
|
|
5597
|
-
|
|
5736
|
+
e.save(), e.textAlign = "right", e.textBaseline = "middle";
|
|
5737
|
+
for (let n = 0; n < t.length; n++) {
|
|
5738
|
+
let r = t[n], o = r.slotX + r.slotW / 2;
|
|
5739
|
+
e.setTransform(1, 0, 0, 1, o, a + 4), e.rotate(-Math.PI / 4), e.fillText(i(r.label), 0, 0);
|
|
5740
|
+
}
|
|
5741
|
+
e.setTransform(1, 0, 0, 1, 0, 0), e.restore();
|
|
5742
|
+
}
|
|
5743
|
+
function lr(e, t, n) {
|
|
5744
|
+
if (t < n.left || t > n.right) return null;
|
|
5745
|
+
for (let n = 0; n < e.length; n++) {
|
|
5746
|
+
let r = e[n];
|
|
5747
|
+
if (t >= r.slotX && t <= r.slotX + r.slotW) return n;
|
|
5748
|
+
}
|
|
5749
|
+
return null;
|
|
5750
|
+
}
|
|
5751
|
+
function ur(e, t, n, r, i, a, o, s) {
|
|
5752
|
+
let c = t[r], l = n[r], u = Math.round(c.slotX + c.slotW / 2) + .5;
|
|
5753
|
+
e.strokeStyle = o.crosshair, e.lineWidth = .5, e.setLineDash([4, 4]), e.beginPath(), e.moveTo(u, a.top), e.lineTo(u, a.bottom), e.stroke(), e.setLineDash([]);
|
|
5754
|
+
let d = [
|
|
5755
|
+
c.label,
|
|
5756
|
+
`Value: ${c.value >= 0 && (c.type === "positive" || c.type === "negative") ? "+" : ""}${s(c.value)}`,
|
|
5757
|
+
`Total: ${s(l)}`
|
|
5758
|
+
];
|
|
5759
|
+
e.font = `${o.font.sizeSmall}px ${o.font.family}`;
|
|
5760
|
+
let f = 0;
|
|
5761
|
+
for (let t = 0; t < d.length; t++) {
|
|
5762
|
+
let n = e.measureText(d[t]).width;
|
|
5763
|
+
n > f && (f = n);
|
|
5764
|
+
}
|
|
5765
|
+
let p = f + 16, m = d.length * (o.font.sizeSmall + 4) + 12, h = i.x + 10, g = i.y - m / 2;
|
|
5766
|
+
h + p > a.right && (h = i.x - p - 10), g < a.top && (g = a.top), g + m > a.bottom && (g = a.bottom - m), e.fillStyle = o.axisLabelBackground, e.globalAlpha = .9, e.fillRect(h, g, p, m), e.globalAlpha = 1, e.fillStyle = o.text, e.textAlign = "left", e.textBaseline = "top";
|
|
5767
|
+
let _ = o.font.sizeSmall + 4;
|
|
5768
|
+
for (let t = 0; t < d.length; t++) e.fillText(d[t], h + 8, g + 6 + t * _);
|
|
5769
|
+
}
|
|
5770
|
+
function dr(e, t, n, r, i, a) {
|
|
5771
|
+
let { data: o } = r;
|
|
5772
|
+
if (!o || o.length === 0 || t <= 0 || n <= 0) return { hitBar: null };
|
|
5773
|
+
let s = r.positiveColor ?? i.candleUp, c = r.negativeColor ?? i.candleDown, l = r.totalColor ?? i.lineColor, u = r.subtotalColor ?? i.textSecondary, d = r.connectorColor ?? i.textSecondary, f = r.connectorStyle ?? "dashed", p = r.barWidth ?? Xn, m = r.showValues !== !1, h = r.showDelta !== !1, g = r.valueFormat ?? $n, _ = r.labelFormat ?? ((e) => e), { valMin: v, valMax: y } = nr(o), b = y - v || 1, x = er(t, n), { bars: S, cumulatives: C } = tr(o, x, p, v, b);
|
|
5774
|
+
rr(e, t, n, i.background), ir(e, x, v, y, i, g), or(e, S, x, v, b, d, f), ar(e, S, {
|
|
5775
|
+
positive: s,
|
|
5776
|
+
negative: c,
|
|
5777
|
+
total: l,
|
|
5778
|
+
subtotal: u
|
|
5779
|
+
}), m && sr(e, S, C, i, g, h), cr(e, S, x, i, _);
|
|
5780
|
+
let w = a ? lr(S, a.x, x) : null;
|
|
5781
|
+
return a && w !== null && ur(e, S, C, w, a, x, i, g), { hitBar: w };
|
|
5782
|
+
}
|
|
5783
|
+
//#endregion
|
|
5784
|
+
//#region src/finance/GaugeRenderer.ts
|
|
5785
|
+
var fr = Math.PI / 180, pr = 135, mr = 405, hr = .25;
|
|
5786
|
+
function gr(e) {
|
|
5787
|
+
let t = Math.abs(e);
|
|
5788
|
+
return t >= 1e6 ? (e / 1e6).toFixed(2) + "M" : t >= 1e3 ? (e / 1e3).toFixed(1) + "K" : Number.isInteger(e) ? e.toFixed(0) : e.toFixed(1);
|
|
5789
|
+
}
|
|
5790
|
+
function Q(e, t, n) {
|
|
5791
|
+
return e < t ? t : e > n ? n : e;
|
|
5792
|
+
}
|
|
5793
|
+
function _r(e, t, n) {
|
|
5794
|
+
let r = n.min ?? 0, i = n.max ?? 100, a = i - r || 1, o = (n.startAngle ?? pr) * fr, s = (n.endAngle ?? mr) * fr, c = n.thickness ?? hr, l = e / 2, u = t / 2 + t * .05, d = Math.max(10, Math.min(e, t) / 2 - 24);
|
|
5795
|
+
return {
|
|
5796
|
+
cx: l,
|
|
5797
|
+
cy: u,
|
|
5798
|
+
radius: d,
|
|
5799
|
+
innerRadius: Math.max(2, d * (1 - c)),
|
|
5800
|
+
startAngle: o,
|
|
5801
|
+
endAngle: s,
|
|
5802
|
+
angleRange: s - o,
|
|
5803
|
+
min: r,
|
|
5804
|
+
max: i,
|
|
5805
|
+
range: a
|
|
5806
|
+
};
|
|
5807
|
+
}
|
|
5808
|
+
function $(e, t) {
|
|
5809
|
+
let n = Q((e - t.min) / t.range, 0, 1);
|
|
5810
|
+
return t.startAngle + t.angleRange * n;
|
|
5811
|
+
}
|
|
5812
|
+
function vr(e, t, n, r) {
|
|
5813
|
+
e.fillStyle = r, e.fillRect(0, 0, t, n);
|
|
5814
|
+
}
|
|
5815
|
+
function yr(e, t, n) {
|
|
5816
|
+
e.beginPath(), e.arc(t.cx, t.cy, t.radius, t.startAngle, t.endAngle, !1), e.arc(t.cx, t.cy, t.innerRadius, t.endAngle, t.startAngle, !0), e.closePath(), e.fillStyle = n, e.fill();
|
|
5817
|
+
}
|
|
5818
|
+
function br(e, t, n) {
|
|
5819
|
+
let r = Q(n.from, t.min, t.max), i = Q(n.to, t.min, t.max);
|
|
5820
|
+
if (i <= r) return;
|
|
5821
|
+
let a = $(r, t), o = $(i, t);
|
|
5822
|
+
e.beginPath(), e.arc(t.cx, t.cy, t.radius, a, o, !1), e.arc(t.cx, t.cy, t.innerRadius, o, a, !0), e.closePath(), e.fillStyle = n.color, e.fill();
|
|
5823
|
+
}
|
|
5824
|
+
function xr(e, t, n, r, i) {
|
|
5825
|
+
let a = $(n, t);
|
|
5826
|
+
a <= t.startAngle || (e.globalAlpha = i, e.beginPath(), e.arc(t.cx, t.cy, t.radius, t.startAngle, a, !1), e.arc(t.cx, t.cy, t.innerRadius, a, t.startAngle, !0), e.closePath(), e.fillStyle = r, e.fill(), e.globalAlpha = 1);
|
|
5827
|
+
}
|
|
5828
|
+
function Sr(e, t, n, r) {
|
|
5829
|
+
let i = $(n, t), a = Math.cos(i), o = Math.sin(i), s = t.radius - 2, c = t.innerRadius * .25, l = -o, u = a, d = t.cx + a * s, f = t.cy + o * s, p = t.cx + l * 4 - a * c, m = t.cy + u * 4 - o * c, h = t.cx - l * 4 - a * c, g = t.cy - u * 4 - o * c;
|
|
5830
|
+
e.beginPath(), e.moveTo(d, f), e.lineTo(p, m), e.lineTo(h, g), e.closePath(), e.fillStyle = r, e.fill(), e.beginPath(), e.arc(t.cx, t.cy, Math.max(4, t.innerRadius * .12), 0, Math.PI * 2), e.fill();
|
|
5831
|
+
}
|
|
5832
|
+
function Cr(e, t, n, r, i) {
|
|
5833
|
+
let a = Math.round(t.innerRadius * .55), o = Math.round(i.font.sizeMedium);
|
|
5834
|
+
e.fillStyle = i.text, e.textAlign = "center", e.textBaseline = "middle", e.font = `600 ${a}px ${i.font.family}`;
|
|
5835
|
+
let s = !!r, c = s ? t.cy - o * .6 : t.cy - a * .1;
|
|
5836
|
+
e.fillText(n, t.cx, c), s && (e.fillStyle = i.textSecondary, e.font = `${o}px ${i.font.family}`, e.fillText(r, t.cx, t.cy + a * .55));
|
|
5837
|
+
}
|
|
5838
|
+
function wr(e, t, n, r) {
|
|
5839
|
+
e.fillStyle = r.textSecondary, e.font = `${r.font.sizeSmall}px ${r.font.family}`;
|
|
5840
|
+
let i = t.radius + 10, a = Math.cos(t.startAngle), o = Math.sin(t.startAngle), s = Math.cos(t.endAngle), c = Math.sin(t.endAngle), l = t.cx + a * i, u = t.cy + o * i, d = t.cx + s * i, f = t.cy + c * i;
|
|
5841
|
+
e.textBaseline = "middle", e.textAlign = a < -.2 ? "right" : a > .2 ? "left" : "center", e.fillText(n(t.min), l, u), e.textAlign = s < -.2 ? "right" : s > .2 ? "left" : "center", e.fillText(n(t.max), d, f);
|
|
5842
|
+
}
|
|
5843
|
+
function Tr(e, t, n, r) {
|
|
5844
|
+
e.fillStyle = r.textSecondary, e.font = `${r.font.sizeSmall}px ${r.font.family}`, e.textAlign = "center", e.textBaseline = "middle";
|
|
5845
|
+
let i = (t.radius + t.innerRadius) / 2;
|
|
5846
|
+
for (let r = 0; r < n.length; r++) {
|
|
5847
|
+
let a = n[r];
|
|
5848
|
+
if (!a.label) continue;
|
|
5849
|
+
let o = $((Q(a.from, t.min, t.max) + Q(a.to, t.min, t.max)) / 2, t), s = t.cx + Math.cos(o) * i, c = t.cy + Math.sin(o) * i;
|
|
5850
|
+
e.fillText(a.label, s, c);
|
|
5851
|
+
}
|
|
5852
|
+
}
|
|
5853
|
+
function Er(e, t, n, r, i, a) {
|
|
5854
|
+
if (t <= 0 || n <= 0) return;
|
|
5855
|
+
let o = _r(t, n, r), s = r.trackColor ?? i.grid, c = r.needleColor ?? i.text, l = r.showValue !== !1, u = r.showZoneLabels === !0, d = r.valueFormat ?? gr, f = Q(a, o.min, o.max);
|
|
5856
|
+
vr(e, t, n, i.background), yr(e, o, s);
|
|
5857
|
+
let p = r.zones;
|
|
5858
|
+
if (p && p.length > 0) for (let t = 0; t < p.length; t++) br(e, o, p[t]);
|
|
5859
|
+
xr(e, o, f, c, .12), Sr(e, o, f, c), l && Cr(e, o, d(f), r.label, i), wr(e, o, d, i), u && p && p.length > 0 && Tr(e, o, p, i);
|
|
5598
5860
|
}
|
|
5599
5861
|
//#endregion
|
|
5600
|
-
export {
|
|
5862
|
+
export { Se as ADXIndicator, xe as ATRIndicator, Ne as AccumulationDistributionIndicator, Kt as AlertManager, Ct as AnchoredVWAPTool, Qt as Animator, te as AreaRenderer, De as AroonIndicator, bt as ArrowTool, Ut as BarCountdown, ne as BarRenderer, en as BaseFinanceChart, ie as BaselineRenderer, Lt as BinanceAdapter, P as BollingerBandsIndicator, Te as CCIIndicator, Ae as CMFIndicator, A as CandlestickRenderer, v as CanvasLayer, Bt as ChartLegend, Jt as ChartStateManager, le as CompareRenderer, Ge as CrosshairHandler, qe as CrosshairTooltip, Pt as CurrentPriceLine, zt as DEFAULT_LEGEND_CONFIG, x as DPRManager, Xt as DataExporter, _t as DateRangeTool, Ot as DepthOverlay, B as DonchianChannelIndicator, H as DrawingBase, Qe as DrawingManager, $e as DrawingRenderer, N as EMAIndicator, Zt as Easing, ht as ElliottWaveTool, dt as EllipseTool, K as Emitter, Xe as EventBus, it as ExtendedLineTool, lt as FibExtensionTool, st as FibRetracementTool, tn as FinanceCrosshair, St as GannBoxTool, W as GannFanTool, Ie as GridRenderer, re as HollowCandleRenderer, tt as HorizontalLineTool, I as IchimokuIndicator, j as IndicatorBase, _e as IndicatorEngine, He as InteractionManager, oe as KagiRenderer, z as KeltnerChannelIndicator, Ke as KeyboardHandler, y as LayerManager, ee as LineRenderer, ye as MACDIndicator, Ee as MFIIndicator, vt as MeasureTool, Rt as MockAdapter, Ce as OBVIndicator, Et as OrderRenderer, Ue as PanHandler, L as ParabolicSARIndicator, at as ParallelChannelTool, pt as PitchforkTool, se as PointAndFigureRenderer, Dt as PositionRenderer, Le as PriceAxis, gt as PriceRangeTool, Oe as ROCIndicator, ve as RSIIndicator, rt as RayTool, q as ReconnectManager, ut as RectangleTool, ot as RegressionChannelTool, D as RenderEngine, b as RenderLoop, ae as RenkoRenderer, qt as ReplayManager, M as SMAIndicator, Vt as Screenshot, Wt as SessionBreaks, je as StdDevIndicator, be as StochasticIndicator, Ft as StreamManager, R as SupertrendIndicator, ke as TSIIndicator, yt as TextAnnotationTool, Nt as TickAggregator, Ve as TimeAxis, At as TradingContextMenu, kt as TradingDragHandler, jt as TradingManager, Mt as TradingRenderer, et as TrendLineTool, ft as TriangleTool, Yt as UndoRedoManager, Pe as VROCIndicator, F as VWAPIndicator, nt as VerticalLineTool, O as Viewport, Me as VolumeProfileIndicator, wt as VolumeProfileRangeTool, ce as VolumeRenderer, Ht as Watermark, we as WilliamsRIndicator, We as ZoomHandler, S as barIndexToX, k as getVisibleData, zn as layoutSquarifiedTreemap, In as layoutUniformGrid, C as priceToY, Tt as registerBuiltInDrawingTools, Fe as registerBuiltInIndicators, _n as renderDepthChart, Fn as renderEquityCurve, Er as renderGauge, Gn as renderHeatmap, nn as renderSparkline, dr as renderWaterfall, E as timestampToBarIndex, ue as toHeikinAshi, me as toKagi, pe as toLineBreak, he as toPointAndFigure, de as toRenko, w as xToBarIndex, T as yToPrice };
|
|
5601
5863
|
|
|
5602
5864
|
//# sourceMappingURL=index.js.map
|