@luxalgo/vela 0.9.0 → 0.9.1
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/{DataProvider-zJGp58kb.d.cts → DataProvider-B5i0_yY4.d.cts} +1 -1
- package/dist/{DataProvider-BGlB1zSc.d.ts → DataProvider-CPFgSyAm.d.ts} +1 -1
- package/dist/{chunk-XIRSR3D6.js → chunk-3H6JO4VL.js} +48 -30
- package/dist/{chunk-4WAHYL7Y.js → chunk-BLVL7WXF.js} +33 -2
- package/dist/{chunk-YRCL3WMD.js → chunk-Q7POFYNE.js} +7 -1
- package/dist/{contributions-BjefWpxQ.d.ts → contributions-BfBaF6eE.d.ts} +3 -3
- package/dist/{contributions-CpCJisTC.d.cts → contributions-DupwEkzc.d.cts} +3 -3
- package/dist/index.cjs +40 -21
- package/dist/index.d.cts +13 -11
- package/dist/index.d.ts +13 -11
- package/dist/index.js +2 -2
- package/dist/{keymap-UolhuXH1.d.ts → keymap-C48ughm6.d.ts} +1 -1
- package/dist/{keymap-B9_FLhfJ.d.cts → keymap-W0hiajU6.d.cts} +1 -1
- package/dist/locales/ar.cjs +2 -0
- package/dist/locales/ar.d.cts +1 -1
- package/dist/locales/ar.d.ts +1 -1
- package/dist/locales/ar.js +2 -0
- package/dist/locales/de.cjs +2 -0
- package/dist/locales/de.d.cts +1 -1
- package/dist/locales/de.d.ts +1 -1
- package/dist/locales/de.js +2 -0
- package/dist/locales/en.cjs +2 -0
- package/dist/locales/en.d.cts +1 -1
- package/dist/locales/en.d.ts +1 -1
- package/dist/locales/en.js +2 -0
- package/dist/locales/es.cjs +2 -0
- package/dist/locales/es.d.cts +1 -1
- package/dist/locales/es.d.ts +1 -1
- package/dist/locales/es.js +2 -0
- package/dist/locales/fr.cjs +2 -0
- package/dist/locales/fr.d.cts +1 -1
- package/dist/locales/fr.d.ts +1 -1
- package/dist/locales/fr.js +2 -0
- package/dist/locales/he.cjs +2 -0
- package/dist/locales/he.d.cts +1 -1
- package/dist/locales/he.d.ts +1 -1
- package/dist/locales/he.js +2 -0
- package/dist/locales/hi.cjs +2 -0
- package/dist/locales/hi.d.cts +1 -1
- package/dist/locales/hi.d.ts +1 -1
- package/dist/locales/hi.js +2 -0
- package/dist/locales/id.cjs +2 -0
- package/dist/locales/id.d.cts +1 -1
- package/dist/locales/id.d.ts +1 -1
- package/dist/locales/id.js +2 -0
- package/dist/locales/it.cjs +2 -0
- package/dist/locales/it.d.cts +1 -1
- package/dist/locales/it.d.ts +1 -1
- package/dist/locales/it.js +2 -0
- package/dist/locales/ja.cjs +2 -0
- package/dist/locales/ja.d.cts +1 -1
- package/dist/locales/ja.d.ts +1 -1
- package/dist/locales/ja.js +2 -0
- package/dist/locales/ko.cjs +2 -0
- package/dist/locales/ko.d.cts +1 -1
- package/dist/locales/ko.d.ts +1 -1
- package/dist/locales/ko.js +2 -0
- package/dist/locales/ms.cjs +2 -0
- package/dist/locales/ms.d.cts +1 -1
- package/dist/locales/ms.d.ts +1 -1
- package/dist/locales/ms.js +2 -0
- package/dist/locales/pl.cjs +2 -0
- package/dist/locales/pl.d.cts +1 -1
- package/dist/locales/pl.d.ts +1 -1
- package/dist/locales/pl.js +2 -0
- package/dist/locales/pt-BR.cjs +2 -0
- package/dist/locales/pt-BR.d.cts +1 -1
- package/dist/locales/pt-BR.d.ts +1 -1
- package/dist/locales/pt-BR.js +2 -0
- package/dist/locales/ru.cjs +2 -0
- package/dist/locales/ru.d.cts +1 -1
- package/dist/locales/ru.d.ts +1 -1
- package/dist/locales/ru.js +2 -0
- package/dist/locales/th.cjs +2 -0
- package/dist/locales/th.d.cts +1 -1
- package/dist/locales/th.d.ts +1 -1
- package/dist/locales/th.js +2 -0
- package/dist/locales/tr.cjs +2 -0
- package/dist/locales/tr.d.cts +1 -1
- package/dist/locales/tr.d.ts +1 -1
- package/dist/locales/tr.js +2 -0
- package/dist/locales/vi.cjs +2 -0
- package/dist/locales/vi.d.cts +1 -1
- package/dist/locales/vi.d.ts +1 -1
- package/dist/locales/vi.js +2 -0
- package/dist/locales/zh-Hans.cjs +2 -0
- package/dist/locales/zh-Hans.d.cts +1 -1
- package/dist/locales/zh-Hans.d.ts +1 -1
- package/dist/locales/zh-Hans.js +2 -0
- package/dist/locales/zh-Hant.cjs +2 -0
- package/dist/locales/zh-Hant.d.cts +1 -1
- package/dist/locales/zh-Hant.d.ts +1 -1
- package/dist/locales/zh-Hant.js +2 -0
- package/dist/{options-D4L3_hv_.d.ts → options-B7aL1pbf.d.ts} +1 -1
- package/dist/{options-CpegHml_.d.cts → options-I1H2HDWw.d.cts} +1 -1
- package/dist/{plugin-DpNp4aBi.d.cts → plugin-BGz-Vsdv.d.cts} +6 -6
- package/dist/{plugin-DTmulpKM.d.ts → plugin-BZHypj8h.d.ts} +6 -6
- package/dist/plugin.cjs +1 -0
- package/dist/plugin.d.cts +7 -7
- package/dist/plugin.d.ts +7 -7
- package/dist/plugin.js +1 -1
- package/dist/providers/binance.d.cts +3 -3
- package/dist/providers/binance.d.ts +3 -3
- package/dist/providers/coinbase.d.cts +3 -3
- package/dist/providers/coinbase.d.ts +3 -3
- package/dist/providers/hyperliquid.d.cts +3 -3
- package/dist/providers/hyperliquid.d.ts +3 -3
- package/dist/{side-panel-CYmH1Opm.d.ts → side-panel-BEQJqSjR.d.cts} +2 -1
- package/dist/{side-panel-BqUnpfev.d.cts → side-panel-Ud0SBAnE.d.ts} +2 -1
- package/dist/{statusline-model-C3yIY9WE.d.ts → statusline-model-Dfb_GD9u.d.ts} +7 -4
- package/dist/{statusline-model-pGs3Xvp-.d.cts → statusline-model-PHt0YhmI.d.cts} +7 -4
- package/dist/{types-BlrXRLIR.d.cts → types-Bwf63xGI.d.cts} +4 -1
- package/dist/{types-BlrXRLIR.d.ts → types-Bwf63xGI.d.ts} +4 -1
- package/dist/ui.d.cts +3 -3
- package/dist/ui.d.ts +3 -3
- package/dist/vela.global.js +40 -21
- package/dist/vela.global.min.js +55 -55
- package/dist/widget.cjs +80 -25
- package/dist/widget.d.cts +10 -10
- package/dist/widget.d.ts +10 -10
- package/dist/widget.js +4 -4
- package/dist/workspace.cjs +80 -25
- package/dist/workspace.d.cts +7 -7
- package/dist/workspace.d.ts +7 -7
- package/dist/workspace.js +3 -3
- package/package.json +1 -1
package/dist/vela.global.js
CHANGED
|
@@ -27011,6 +27011,7 @@ ${overlayScrollbarCss(".vela-dialog.vela-ind-dialog *", 9)}
|
|
|
27011
27011
|
mode: isScaleMode(ps.mode) ? ps.mode : base.priceScale.mode,
|
|
27012
27012
|
log: isBool(ps.log) ? ps.log : base.priceScale.log,
|
|
27013
27013
|
invert: isBool(ps.invert) ? ps.invert : base.priceScale.invert,
|
|
27014
|
+
priceOnly: isBool(ps.priceOnly) ? ps.priceOnly : base.priceScale.priceOnly,
|
|
27014
27015
|
borderColor: isColor(ps.borderColor) ? ps.borderColor : base.priceScale.borderColor,
|
|
27015
27016
|
labelsVisible: isBool(ps.labelsVisible) ? ps.labelsVisible : base.priceScale.labelsVisible,
|
|
27016
27017
|
currentPriceLine: isBool(ps.currentPriceLine) ? ps.currentPriceLine : base.priceScale.currentPriceLine,
|
|
@@ -29419,6 +29420,9 @@ void main() {
|
|
|
29419
29420
|
this.logScale = false;
|
|
29420
29421
|
/** Inverted price axis on the price pane (high at the bottom). Study panes carry their own. */
|
|
29421
29422
|
this.invertScale = false;
|
|
29423
|
+
/** The price pane's autoscale fits the bars alone: indicator plots, their price lines
|
|
29424
|
+
* and Pine drawings paint where they fall instead of widening the window. */
|
|
29425
|
+
this.scalePriceOnly = false;
|
|
29422
29426
|
/** Exchange tick size for the active symbol (e.g. 0.01), when known. Drives the
|
|
29423
29427
|
* price-axis decimals — the instrument's true precision instead of the zoom-derived
|
|
29424
29428
|
* formula. Undefined until symbol metadata loads (the formula is the fallback). */
|
|
@@ -31117,6 +31121,18 @@ void main() {
|
|
|
31117
31121
|
}
|
|
31118
31122
|
};
|
|
31119
31123
|
|
|
31124
|
+
// src/renderers/native/chrome/tz.ts
|
|
31125
|
+
var DAY_MS3 = 864e5;
|
|
31126
|
+
function displayZone(timeZone, barIntervalMs) {
|
|
31127
|
+
return barIntervalMs >= DAY_MS3 ? "UTC" : timeZone;
|
|
31128
|
+
}
|
|
31129
|
+
function tzOffsetMs(ms, timeZone) {
|
|
31130
|
+
return zoneOffsetMs(ms, timeZone);
|
|
31131
|
+
}
|
|
31132
|
+
function zonedDate(ms, timeZone) {
|
|
31133
|
+
return new Date(ms + tzOffsetMs(ms, timeZone));
|
|
31134
|
+
}
|
|
31135
|
+
|
|
31120
31136
|
// src/renderers/native/chrome/ticks.ts
|
|
31121
31137
|
function priceTicks(min2, max2, target = 6) {
|
|
31122
31138
|
if (!(max2 > min2) || !Number.isFinite(min2) || !Number.isFinite(max2)) return [];
|
|
@@ -31257,7 +31273,7 @@ void main() {
|
|
|
31257
31273
|
YEAR
|
|
31258
31274
|
];
|
|
31259
31275
|
function formatTimeStamp2(ms, timeZone, barIntervalMs, fmt = ENGLISH_FORMAT, surface = "crosshair") {
|
|
31260
|
-
return fmt.timeStamp(ms, { timeZone, withTime: barIntervalMs < DAY2, surface });
|
|
31276
|
+
return fmt.timeStamp(ms, { timeZone: displayZone(timeZone, barIntervalMs), withTime: barIntervalMs < DAY2, surface });
|
|
31261
31277
|
}
|
|
31262
31278
|
function pickStep(targetMs) {
|
|
31263
31279
|
for (const step of STEP_LADDER) if (step >= targetMs) return step;
|
|
@@ -31401,14 +31417,6 @@ void main() {
|
|
|
31401
31417
|
}
|
|
31402
31418
|
};
|
|
31403
31419
|
|
|
31404
|
-
// src/renderers/native/chrome/tz.ts
|
|
31405
|
-
function tzOffsetMs(ms, timeZone) {
|
|
31406
|
-
return zoneOffsetMs(ms, timeZone);
|
|
31407
|
-
}
|
|
31408
|
-
function zonedDate(ms, timeZone) {
|
|
31409
|
-
return new Date(ms + tzOffsetMs(ms, timeZone));
|
|
31410
|
-
}
|
|
31411
|
-
|
|
31412
31420
|
// src/renderers/native/chrome/countdown.ts
|
|
31413
31421
|
function countdownText2(barOpen, barMs, now2, fmt = ENGLISH_FORMAT) {
|
|
31414
31422
|
if (!(barMs > 0)) return null;
|
|
@@ -32122,7 +32130,7 @@ void main() {
|
|
|
32122
32130
|
ctx.textAlign = "center";
|
|
32123
32131
|
const y = dataH + (fullH - dataH) / 2;
|
|
32124
32132
|
const tr = coords.visibleTimeRange();
|
|
32125
|
-
const offset3 = tzOffsetMs((tr.from + tr.to) / 2, scene.timezone);
|
|
32133
|
+
const offset3 = tzOffsetMs((tr.from + tr.to) / 2, displayZone(scene.timezone, coords.barInterval));
|
|
32126
32134
|
const target = Math.max(3, Math.min(8, Math.floor(dataW / 64)));
|
|
32127
32135
|
const ticks = timeTicks(tr.from, tr.to, target, offset3, scene.format).map((tick) => ({ ...tick, x: coords.timeToX(tick.time), half: ctx.measureText(tick.label).width / 2 })).filter((tick) => tick.x >= 20 && tick.x <= dataW - 20);
|
|
32128
32136
|
const GAP = 12;
|
|
@@ -32703,6 +32711,7 @@ void main() {
|
|
|
32703
32711
|
indexedTo100: msg("chart.settings.indexedTo100", "Indexed to 100"),
|
|
32704
32712
|
logarithmic: msg("chart.settings.logarithmic", "Logarithmic"),
|
|
32705
32713
|
invertScale: msg("chart.settings.invertScale", "Invert scale"),
|
|
32714
|
+
scalePriceOnly: msg("chart.settings.scalePriceOnly", "Scale price chart only"),
|
|
32706
32715
|
lastPriceLine: msg("chart.settings.lastPriceLine", "Last price line"),
|
|
32707
32716
|
lastPriceLabel: msg("chart.settings.lastPriceLabel", "Last price label"),
|
|
32708
32717
|
countdownToBarClose: msg("chart.settings.countdownToBarClose", "Countdown to bar close"),
|
|
@@ -33211,6 +33220,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
33211
33220
|
), "scales.price-scale.mode")
|
|
33212
33221
|
);
|
|
33213
33222
|
body.append(sid(this.boolRow(TEXT8.invertScale, config.priceScale.invert, (v) => this.emit({ priceScale: { invert: v } })), "scales.price-scale.invert"));
|
|
33223
|
+
body.append(sid(this.boolRow(TEXT8.scalePriceOnly, config.priceScale.priceOnly, (v) => this.emit({ priceScale: { priceOnly: v } })), "scales.price-scale.price-only"));
|
|
33214
33224
|
body.append(sid(this.separator(), "scales.price-scale"));
|
|
33215
33225
|
body.append(sid(this.boolRow(TEXT8.lastPriceLine, config.priceScale.currentPriceLine, (v) => this.emit({ priceScale: { currentPriceLine: v } })), "scales.price-scale.last-price-line"));
|
|
33216
33226
|
body.append(sid(this.boolRow(TEXT8.lastPriceLabel, config.priceScale.priceLabel, (v) => this.emit({ priceScale: { priceLabel: v } })), "scales.price-scale.last-price-label"));
|
|
@@ -41345,7 +41355,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
41345
41355
|
ctx.globalAlpha = gridAlpha;
|
|
41346
41356
|
ctx.strokeStyle = vertColor;
|
|
41347
41357
|
const tr = coords.visibleTimeRange();
|
|
41348
|
-
const offset3 = tzOffsetMs((tr.from + tr.to) / 2, scene.timezone);
|
|
41358
|
+
const offset3 = tzOffsetMs((tr.from + tr.to) / 2, displayZone(scene.timezone, coords.barInterval));
|
|
41349
41359
|
ctx.beginPath();
|
|
41350
41360
|
for (const tick of timeTicks(tr.from, tr.to, 8, offset3)) {
|
|
41351
41361
|
const x = Math.round(coords.timeToX(tick.time)) + 0.5;
|
|
@@ -42268,7 +42278,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
42268
42278
|
this.priceStyleCbs = /* @__PURE__ */ new Set();
|
|
42269
42279
|
this.priceStyleWillChangeCbs = /* @__PURE__ */ new Set();
|
|
42270
42280
|
this.name = "native";
|
|
42271
|
-
this.features = ["logScale", "currentPriceLine", "priceLabel", "countdown", "upColor", "downColor", "glow", "animZoom", "animPan", "animScroll", "animAutoscale", "animLiveBar", "intro", "zoomAnchor", "axisDrag", "paneResize", "candleZOrder", "candleVisible", "seriesOrder", "highlights", "sessionZones", "gridlines", "axisLabels", "scaleMode", "invertScale", "paneScales", "autoScale", "timezone", "keyboard", "historyChords", "priceStyle", "priceBaseline", "baselinePrice", "settings", "attribution", "dialogHost", "tradeMarkers", "marks", "indicatorTitles", "indicatorValues", "crosshairOverride", "drawingsInteractive", "priceAxisTicks"];
|
|
42281
|
+
this.features = ["logScale", "currentPriceLine", "priceLabel", "countdown", "upColor", "downColor", "glow", "animZoom", "animPan", "animScroll", "animAutoscale", "animLiveBar", "intro", "zoomAnchor", "axisDrag", "paneResize", "candleZOrder", "candleVisible", "seriesOrder", "highlights", "sessionZones", "gridlines", "axisLabels", "scaleMode", "invertScale", "scalePriceOnly", "paneScales", "autoScale", "timezone", "keyboard", "historyChords", "priceStyle", "priceBaseline", "baselinePrice", "settings", "attribution", "dialogHost", "tradeMarkers", "marks", "indicatorTitles", "indicatorValues", "crosshairOverride", "drawingsInteractive", "priceAxisTicks"];
|
|
42272
42282
|
/** Track cursor proximity to the scroll button on the plot (bubbles from the button too,
|
|
42273
42283
|
* so moving onto the button doesn't count as leaving). */
|
|
42274
42284
|
this.onScrollProximityMove = (e) => {
|
|
@@ -42427,6 +42437,9 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
42427
42437
|
}
|
|
42428
42438
|
this.scene.invertScale = Boolean(value);
|
|
42429
42439
|
break;
|
|
42440
|
+
case "scalePriceOnly":
|
|
42441
|
+
this.scene.scalePriceOnly = Boolean(value);
|
|
42442
|
+
break;
|
|
42430
42443
|
case "autoScale":
|
|
42431
42444
|
for (const pane of this.scene.panes.values()) {
|
|
42432
42445
|
pane.manualScale = value ? null : { ...pane.scale };
|
|
@@ -42553,6 +42566,8 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
42553
42566
|
return this.scene.scaleMode;
|
|
42554
42567
|
case "invertScale":
|
|
42555
42568
|
return this.scene.invertScale;
|
|
42569
|
+
case "scalePriceOnly":
|
|
42570
|
+
return this.scene.scalePriceOnly;
|
|
42556
42571
|
case "paneScales":
|
|
42557
42572
|
return this.paneScaleInfos();
|
|
42558
42573
|
case "autoScale": {
|
|
@@ -42699,6 +42714,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
42699
42714
|
mode: this.scene.scaleMode,
|
|
42700
42715
|
log: this.scene.logScale,
|
|
42701
42716
|
invert: this.scene.invertScale,
|
|
42717
|
+
priceOnly: this.scene.scalePriceOnly,
|
|
42702
42718
|
borderColor: s.borderColor ?? t.borderColor,
|
|
42703
42719
|
labelsVisible: this.scene.showAxisLabels,
|
|
42704
42720
|
currentPriceLine: this.scene.showPriceLine,
|
|
@@ -42813,6 +42829,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
42813
42829
|
this.scene.scaleMode = next2.priceScale.mode;
|
|
42814
42830
|
this.scene.logScale = next2.priceScale.log;
|
|
42815
42831
|
this.scene.invertScale = next2.priceScale.invert;
|
|
42832
|
+
this.scene.scalePriceOnly = next2.priceScale.priceOnly;
|
|
42816
42833
|
s.borderColor = keepInherit(s.borderColor, next2.priceScale.borderColor, prevTheme.borderColor);
|
|
42817
42834
|
this.scene.showAxisLabels = next2.priceScale.labelsVisible;
|
|
42818
42835
|
this.scene.showPriceLine = next2.priceScale.currentPriceLine;
|
|
@@ -44794,7 +44811,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
44794
44811
|
const pricePane = this.dataWindowPricePane();
|
|
44795
44812
|
const ohlc = this.dataWindowOHLC(bar, pricePane);
|
|
44796
44813
|
const parts3 = [];
|
|
44797
|
-
if (bar) parts3.push(formatStamp(bar.time, this.scene.timezone));
|
|
44814
|
+
if (bar) parts3.push(formatStamp(bar.time, displayZone(this.scene.timezone, this.coords.barInterval)));
|
|
44798
44815
|
if (ohlc) parts3.push(this.t(TEXT16.barSummary, { open: ohlc.o, high: ohlc.h, low: ohlc.l, close: ohlc.c }));
|
|
44799
44816
|
for (const group of this.dataWindowGroups(idx, pricePane)) {
|
|
44800
44817
|
for (const row2 of group.rows) parts3.push(this.t(TEXT16.valueSummary, { name: row2.label, value: row2.value }));
|
|
@@ -44811,7 +44828,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
44811
44828
|
const idx = this.hoverLogical != null ? this.hoverLogical : n - 1;
|
|
44812
44829
|
const bar = this.bars[idx];
|
|
44813
44830
|
const pricePane = this.dataWindowPricePane();
|
|
44814
|
-
const parts3 = bar ? formatStampParts(bar.time, this.scene.timezone) : { date: "", time: "" };
|
|
44831
|
+
const parts3 = bar ? formatStampParts(bar.time, displayZone(this.scene.timezone, this.coords.barInterval)) : { date: "", time: "" };
|
|
44815
44832
|
return { date: parts3.date, time: parts3.time, ohlc: this.dataWindowOHLC(bar, pricePane), groups: this.dataWindowGroups(idx, pricePane) };
|
|
44816
44833
|
}
|
|
44817
44834
|
dataWindowPricePane() {
|
|
@@ -45178,7 +45195,8 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
45178
45195
|
if (or2) dr = dr ? { min: Math.min(dr.min, or2.min), max: Math.max(dr.max, or2.max) } : or2;
|
|
45179
45196
|
}
|
|
45180
45197
|
const includeCandles = pane.kind === "price" && (!this.scene.candlesHidden || this.priceLayersAnchoredToBars(masterModels) || !this.paneHasMeasurableContent(masterModels, dr));
|
|
45181
|
-
|
|
45198
|
+
const priceOnly = pane === pricePane && this.scene.scalePriceOnly && includeCandles;
|
|
45199
|
+
pane.scaleTarget = priceOnly ? computePaneScale([], this.bars, true, i0, s1, null, paneLogScale(this.scene, pane), (id) => this.scene.offsetOf(id), margins) : computePaneScale(masterModels, this.bars, includeCandles, i0, s1, dr, paneLogScale(this.scene, pane), (id) => this.scene.offsetOf(id), margins);
|
|
45182
45200
|
pane.percentBaseline = pane.kind === "price" ? this.bars[i0]?.close ?? 0 : this.firstVisibleValue(masterModels, i0);
|
|
45183
45201
|
pane.axisFormat = void 0;
|
|
45184
45202
|
pane.axisBands = void 0;
|
|
@@ -49503,16 +49521,16 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
49503
49521
|
];
|
|
49504
49522
|
|
|
49505
49523
|
// src/core/native-indicators/classics/overlays.ts
|
|
49506
|
-
var
|
|
49524
|
+
var DAY_MS4 = 864e5;
|
|
49507
49525
|
function periodKey(anchor, time) {
|
|
49508
|
-
if (anchor === "Week") return Math.floor((Math.floor(time /
|
|
49526
|
+
if (anchor === "Week") return Math.floor((Math.floor(time / DAY_MS4) + 3) / 7);
|
|
49509
49527
|
if (anchor === "Month" || anchor === "Quarter" || anchor === "Year") {
|
|
49510
49528
|
const d = new Date(time);
|
|
49511
49529
|
if (anchor === "Year") return d.getUTCFullYear();
|
|
49512
49530
|
if (anchor === "Quarter") return d.getUTCFullYear() * 4 + Math.floor(d.getUTCMonth() / 3);
|
|
49513
49531
|
return d.getUTCFullYear() * 12 + d.getUTCMonth();
|
|
49514
49532
|
}
|
|
49515
|
-
return Math.floor(time /
|
|
49533
|
+
return Math.floor(time / DAY_MS4);
|
|
49516
49534
|
}
|
|
49517
49535
|
function barInterval(bars) {
|
|
49518
49536
|
if (bars.length < 2) return 0;
|
|
@@ -49614,7 +49632,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
49614
49632
|
const anchor = str3(inputs, "anchor", "Session");
|
|
49615
49633
|
const src = sourceValues(bars, str3(inputs, "source", "HLC3"));
|
|
49616
49634
|
const n = bars.length;
|
|
49617
|
-
const hidden = bool(inputs, "hideDwm", true) && barInterval(bars) >=
|
|
49635
|
+
const hidden = bool(inputs, "hideDwm", true) && barInterval(bars) >= DAY_MS4;
|
|
49618
49636
|
const values = new Array(n).fill(Number.NaN);
|
|
49619
49637
|
const bands = VWAP_BANDS.filter((b) => bool(inputs, b.show, b.defOn)).map((b) => ({
|
|
49620
49638
|
mult: Math.max(0, num3(inputs, b.mult, b.defMult)),
|
|
@@ -49688,7 +49706,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
49688
49706
|
compute: (bars, inputs) => {
|
|
49689
49707
|
const interval = barInterval(bars);
|
|
49690
49708
|
const requested = str3(inputs, "anchor", PIVOT_AUTO);
|
|
49691
|
-
const auto = interval <= 15 * 6e4 ? "Session" : interval <
|
|
49709
|
+
const auto = interval <= 15 * 6e4 ? "Session" : interval < DAY_MS4 ? "Week" : interval <= DAY_MS4 ? "Month" : "Year";
|
|
49692
49710
|
const anchor = requested === "Daily" ? "Session" : requested === "Weekly" ? "Week" : requested === "Monthly" ? "Month" : requested === "Yearly" ? "Year" : auto;
|
|
49693
49711
|
const kind = str3(inputs, "kind", PIVOT_TRADITIONAL);
|
|
49694
49712
|
const aggs = /* @__PURE__ */ new Map();
|
|
@@ -49774,7 +49792,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
49774
49792
|
colorInput(NEUTRAL, msg("indicator.n52WeekHighLow.allTimeColor", "All-Time High/Low"), "allTimeColor", msg("indicator.n52WeekHighLow.allTimeColor.tooltip", "Color of the all-time high and all-time low levels."))
|
|
49775
49793
|
],
|
|
49776
49794
|
compute: (bars, inputs) => {
|
|
49777
|
-
const span = num3(inputs, "weeks", 52) * 7 *
|
|
49795
|
+
const span = num3(inputs, "weeks", 52) * 7 * DAY_MS4;
|
|
49778
49796
|
const n = bars.length;
|
|
49779
49797
|
const hi = new Array(n).fill(Number.NaN);
|
|
49780
49798
|
const lo = new Array(n).fill(Number.NaN);
|
|
@@ -50461,6 +50479,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
50461
50479
|
body: { "reset-view": -30, "remove-drawings": -20, "remove-indicators": -10, settings: 1e3 },
|
|
50462
50480
|
"price-axis": {
|
|
50463
50481
|
auto: -80,
|
|
50482
|
+
"price-only": -75,
|
|
50464
50483
|
invert: -70,
|
|
50465
50484
|
"scale:regular": -60,
|
|
50466
50485
|
"scale:percent": -50,
|