lightweight-charts-indicators 0.15.3 → 0.16.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/index.cjs +227 -90
- package/dist/index.d.ts +17 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +234 -97
- package/dist/sources.mjs +1 -1
- package/dist/standard/correlation-coefficient.d.ts.map +1 -1
- package/dist/standard/linreg-channel.d.ts.map +1 -1
- package/dist/standard/moon-phases.d.ts.map +1 -1
- package/dist/standard/visible-average-price.d.ts.map +1 -1
- package/dist/standard/williams-fractals.d.ts.map +1 -1
- package/dist/style-apply.d.ts +28 -0
- package/dist/style-apply.d.ts.map +1 -0
- package/dist/style-outputs.d.ts +35 -0
- package/dist/style-outputs.d.ts.map +1 -0
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1232,6 +1232,7 @@ __export(src_exports, {
|
|
|
1232
1232
|
SSLChannel: () => SSLChannel,
|
|
1233
1233
|
ST0P: () => ST0P,
|
|
1234
1234
|
STHUnrealizedProfitLossRatio: () => STHUnrealizedProfitLossRatio,
|
|
1235
|
+
STYLE_OUTPUTS: () => STYLE_OUTPUTS,
|
|
1235
1236
|
SatyAtrLevels: () => SatyAtrLevels,
|
|
1236
1237
|
SavitzkyFlowBands: () => SavitzkyFlowBands,
|
|
1237
1238
|
SavitzkyGolayHampelFilterAlphanatt: () => SavitzkyGolayHampelFilterAlphanatt,
|
|
@@ -9422,6 +9423,7 @@ function calculate81(bars, inputs = {}) {
|
|
|
9422
9423
|
position: "aboveBar",
|
|
9423
9424
|
shape: "triangleUp",
|
|
9424
9425
|
color: "#009688",
|
|
9426
|
+
id: "upFractal",
|
|
9425
9427
|
size: 1
|
|
9426
9428
|
});
|
|
9427
9429
|
}
|
|
@@ -9431,6 +9433,7 @@ function calculate81(bars, inputs = {}) {
|
|
|
9431
9433
|
position: "belowBar",
|
|
9432
9434
|
shape: "triangleDown",
|
|
9433
9435
|
color: "#F44336",
|
|
9436
|
+
id: "downFractal",
|
|
9434
9437
|
size: 1
|
|
9435
9438
|
});
|
|
9436
9439
|
}
|
|
@@ -9696,14 +9699,16 @@ function calculate84(bars, inputs = {}, chart) {
|
|
|
9696
9699
|
time: bar.time,
|
|
9697
9700
|
position: "aboveBar",
|
|
9698
9701
|
shape: "circle",
|
|
9699
|
-
color: hexToRgba(waxingMoonColor, 0.5)
|
|
9702
|
+
color: hexToRgba(waxingMoonColor, 0.5),
|
|
9703
|
+
id: "newMoon"
|
|
9700
9704
|
});
|
|
9701
9705
|
} else if (moonType === -1) {
|
|
9702
9706
|
markers.push({
|
|
9703
9707
|
time: bar.time,
|
|
9704
9708
|
position: "belowBar",
|
|
9705
9709
|
shape: "circle",
|
|
9706
|
-
color: hexToRgba(waningMoonColor, 0.5)
|
|
9710
|
+
color: hexToRgba(waningMoonColor, 0.5),
|
|
9711
|
+
id: "fullMoon"
|
|
9707
9712
|
});
|
|
9708
9713
|
}
|
|
9709
9714
|
const bgColor = moonPhaseAdjusted === 1 ? hexToRgba(waxingMoonColor, 0.05) : hexToRgba(waningMoonColor, 0.05);
|
|
@@ -48590,6 +48595,180 @@ function withValueFormat(entry) {
|
|
|
48590
48595
|
return f && !entry.format ? { ...entry, format: f } : entry;
|
|
48591
48596
|
}
|
|
48592
48597
|
|
|
48598
|
+
// src/style-outputs.ts
|
|
48599
|
+
var STYLE_OUTPUTS = {
|
|
48600
|
+
"sma": { "hiddenPlots": ["plot1", "plot2", "plot3"] },
|
|
48601
|
+
"bb": { "fills": [{ "id": "fill_0", "plot1": "plot1", "plot2": "plot2", "title": "Background", "color": "rgba(33, 150, 243, 0.05)" }] },
|
|
48602
|
+
"cci": { "hiddenPlots": ["plot2", "plot3"], "hlines": { "hline_mid": { "linestyle": "dashed" } }, "fills": [{ "id": "fill_band", "plot1": "hline_upper", "plot2": "hline_lower", "title": "Background", "color": "#2962FF1A" }] },
|
|
48603
|
+
"ema": { "hiddenPlots": ["plot1", "plot2", "plot3"] },
|
|
48604
|
+
"ichimoku": { "fills": [{ "id": "fill_0", "plot1": "plot3", "plot2": "plot4", "title": "Cloud Fill", "palette": ["#43A0471A", "#F443361A"] }] },
|
|
48605
|
+
"keltner": { "fills": [{ "id": "fill_0", "plot1": "plot0", "plot2": "plot2", "title": "Background", "color": "rgba(33, 150, 243, 0.05)" }] },
|
|
48606
|
+
"obv": { "hiddenPlots": ["plot1", "plot2", "plot3"] },
|
|
48607
|
+
"roc": { "hlines": { "hline_zero": { "linestyle": "dashed" } } },
|
|
48608
|
+
"rsi": { "hiddenPlots": ["plot6", "plot2", "plot3", "plot4", "plot5"], "hlines": { "hline_upper": { "linestyle": "dashed" }, "hline_mid": { "linestyle": "dashed" }, "hline_lower": { "linestyle": "dashed" } }, "fills": [{ "id": "fill_band", "plot1": "hline_upper", "plot2": "hline_lower", "title": "RSI Background Fill", "color": "#7E57C219" }, { "id": "fill_1", "plot1": "plot0", "plot2": "plot6", "title": "Overbought Gradient Fill", "topColor": "#4CAF50", "bottomColor": "#4CAF5000" }, { "id": "fill_2", "plot1": "plot0", "plot2": "plot6", "title": "Oversold Gradient Fill", "topColor": "#F2364500", "bottomColor": "#F23645" }], "shapes": [{ "id": "bullLabel", "kind": "shape", "title": "Regular Bullish Label", "location": "absolute", "style": "labelup", "color": "#4CAF50", "editable": false }, { "id": "bearLabel", "kind": "shape", "title": "Regular Bearish Label", "location": "absolute", "style": "labeldown", "color": "#F23645", "editable": false }] },
|
|
48609
|
+
"stoch": { "hlines": { "hline_upper": { "linestyle": "dashed" }, "hline_mid": { "linestyle": "dashed" }, "hline_lower": { "linestyle": "dashed" } }, "fills": [{ "id": "fill_band", "plot1": "hline_upper", "plot2": "hline_lower", "title": "Background", "color": "#2962FF1A" }] },
|
|
48610
|
+
"donchian": { "fills": [{ "id": "fill_0", "plot1": "plot1", "plot2": "plot2", "title": "Background", "color": "rgba(33, 150, 243, 0.05)" }] },
|
|
48611
|
+
"supertrend": { "fills": [{ "id": "fill_0", "plot1": "plot2", "plot2": "plot0", "title": "Uptrend background", "color": "rgba(8, 153, 129, 0.1)" }, { "id": "fill_1", "plot1": "plot2", "plot2": "plot1", "title": "Downtrend background", "color": "rgba(242, 54, 69, 0.1)" }] },
|
|
48612
|
+
"bbtrend": { "hlines": { "hline_zero": { "title": "Zero Line", "linestyle": "dashed" } } },
|
|
48613
|
+
"bull-bear-power": { "hlines": { "hline_zero": { "title": "Zero Line", "linestyle": "dashed" } } },
|
|
48614
|
+
"dpo": { "hlines": { "hline_zero": { "linestyle": "dashed" } } },
|
|
48615
|
+
"median": { "fills": [{ "id": "fill_0", "plot1": "plot0", "plot2": "plot3", "title": "Fill color", "palette": ["#00E676E6", "#E040FBE6"] }] },
|
|
48616
|
+
"mfi": { "fills": [{ "id": "fill_band", "plot1": "hline_upper", "plot2": "hline_lower", "title": "Background", "color": "#7E57C21A" }] },
|
|
48617
|
+
"stoch-rsi": { "hlines": { "hline_upper": { "linestyle": "dashed" }, "hline_mid": { "linestyle": "dashed" }, "hline_lower": { "linestyle": "dashed" } }, "fills": [{ "id": "fill_band", "plot1": "hline_upper", "plot2": "hline_lower", "title": "Background", "color": "#2962FF1A" }] },
|
|
48618
|
+
"trend-strength": { "hiddenPlots": ["plot3"], "fills": [{ "id": "fill_0", "plot1": "plot0", "plot2": "plot3", "title": "Bullish Gradient Fill" }, { "id": "fill_1", "plot1": "plot0", "plot2": "plot3", "title": "Bearish Gradient Fill" }] },
|
|
48619
|
+
"tsi": { "hlines": { "hline_zero": { "linestyle": "dashed" } } },
|
|
48620
|
+
"williams-r": { "hlines": { "hline_upper": { "linestyle": "dashed" }, "hline_lower": { "linestyle": "dashed" } }, "fills": [{ "id": "fill_band", "plot1": "hline_upper", "plot2": "hline_lower", "title": "Background", "color": "#7E57C219" }] },
|
|
48621
|
+
"bb-percent-b": { "hlines": { "hline_top": { "linestyle": "dashed", "editable": false }, "hline_mid": { "linestyle": "dashed" }, "hline_bottom": { "linestyle": "dashed", "editable": false } }, "fills": [{ "id": "fill_mid", "plot1": "hline_upper", "plot2": "hline_lower", "title": "Middle Background", "color": "#2962FF19" }, { "id": "fill_ob", "plot1": "hline_top", "plot2": "hline_upper", "title": "Overbought background", "color": "#F2364519" }, { "id": "fill_os", "plot1": "hline_lower", "plot2": "hline_bottom", "title": "Oversold background", "color": "#08998119" }] },
|
|
48622
|
+
"envelope": { "fills": [{ "id": "fill_0", "plot1": "plot1", "plot2": "plot2", "title": "Background", "color": "rgba(33, 150, 243, 0.05)" }] },
|
|
48623
|
+
"choppiness": { "hlines": { "hline_mid": { "linestyle": "dashed" } }, "fills": [{ "id": "fill_band", "plot1": "hline_upper", "plot2": "hline_lower", "title": "Background", "color": "#2962FF1A" }] },
|
|
48624
|
+
"zigzag": { "drawings": ["label", "line"] },
|
|
48625
|
+
"trix": { "hlines": { "hline_zero": { "linestyle": "dashed" } } },
|
|
48626
|
+
"rci-ribbon": { "hlines": { "hline_upper": { "title": "Upper Band" }, "hline_lower": { "title": "Lower Band" } }, "fills": [{ "id": "fill_band", "plot1": "hline_upper", "plot2": "hline_lower", "title": "Hlines Background", "color": "#2962FF1A" }] },
|
|
48627
|
+
"volume-delta": { "candles": { "delta": { "title": "Volume Delta", "palettes": { "color": ["#089981", "#F23645"], "wickColor": ["#089981", "#F23645"], "borderColor": ["#089981", "#F23645"] } } } },
|
|
48628
|
+
"cvd": { "candles": { "cvd": { "title": "CVD", "palettes": { "color": ["#089981", "#F23645"], "wickColor": ["#089981", "#F23645"], "borderColor": ["#089981", "#F23645"] } } } },
|
|
48629
|
+
"kst": { "hlines": { "hline_zero": { "linestyle": "dashed" } } },
|
|
48630
|
+
"connors-rsi": { "hlines": { "hline_upper": { "linestyle": "dashed" }, "hline_mid": { "linestyle": "dashed" }, "hline_lower": { "linestyle": "dashed" } }, "fills": [{ "id": "fill_band", "plot1": "hline_upper", "plot2": "hline_lower", "title": "Background", "color": "#2962FF1A" }] },
|
|
48631
|
+
"rci": { "hiddenPlots": ["plot2", "plot3"], "hlines": { "hline_upper": { "title": "Upper Band" }, "hline_lower": { "title": "Lower Band" } }, "fills": [{ "id": "fill_band", "plot1": "hline_upper", "plot2": "hline_lower", "title": "Hlines Background", "color": "#2962FF1A" }, { "id": "fill_bb", "plot1": "plot2", "plot2": "plot3", "title": "Bollinger Bands Background Fill", "color": "#4CAF501A", "editable": false }] },
|
|
48632
|
+
"rvol": { "hiddenPlots": ["plot2", "plot3"] },
|
|
48633
|
+
"williams-fractals": { "shapes": [{ "id": "downFractal", "kind": "shape", "title": "Shapes", "location": "belowbar", "style": "triangledown", "color": "#F44336" }, { "id": "upFractal", "kind": "shape", "title": "Shapes", "location": "abovebar", "style": "triangleup", "color": "#009688" }] },
|
|
48634
|
+
"bb-bars": { "candles": { "wicks": { "title": "Bollinger Bars Wicks", "color": "#0D349E", "wickColor": "rgba(0,0,0,0)", "borderColor": "#0D349E" }, "body": { "title": "Bollinger Bars Body", "wickColor": "rgba(0,0,0,0)", "palettes": { "color": ["#089981", "#F23645"], "borderColor": ["#089981", "#F23645"] } } } },
|
|
48635
|
+
"moon-phases": { "shapes": [{ "id": "newMoon", "kind": "shape", "title": "New Moon", "location": "abovebar", "style": "circle" }, { "id": "fullMoon", "kind": "shape", "title": "Full Moon", "location": "belowbar", "style": "circle" }], "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color" }] },
|
|
48636
|
+
"auto-fib-extension": { "drawings": ["label", "linefill", "line"] },
|
|
48637
|
+
"auto-fib-retracement": { "drawings": ["label", "linefill", "line"] },
|
|
48638
|
+
"auto-pitchfork": { "drawings": ["label", "linefill", "line"] },
|
|
48639
|
+
"gaps": { "drawings": ["box", "table"] },
|
|
48640
|
+
"linreg-channel": { "drawings": ["label", "linefill", "line"] },
|
|
48641
|
+
"multi-time-period-charts": { "drawings": ["box"] },
|
|
48642
|
+
"performance": { "drawings": ["table"] },
|
|
48643
|
+
"pivot-points-high-low": { "drawings": ["label"] },
|
|
48644
|
+
"pivot-points-standard": { "drawings": ["label", "line"] },
|
|
48645
|
+
"rob-booker-ziv-ghost-pivots": { "shapes": [{ "id": "pivot240", "kind": "char", "title": "Chars", "location": "absolute", "char": "8", "color": "#00BCD4" }, { "id": "pivotD", "kind": "char", "title": "Chars", "location": "absolute", "char": "d", "color": "#2962FF" }, { "id": "pivotW", "kind": "char", "title": "Chars", "location": "absolute", "char": "w", "color": "#673AB7" }, { "id": "pivotM", "kind": "char", "title": "Chars", "location": "absolute", "char": "m", "color": "#E91E63" }] },
|
|
48646
|
+
"rsi-divergence-indicator": { "hiddenPlots": ["plot2", "plot4"], "fills": [{ "id": "fill_background", "plot1": "hline_ob", "plot2": "hline_os", "title": "Background", "color": "#2196F31A" }], "shapes": [{ "id": "bullLabel", "kind": "shape", "title": "Regular Bullish Label", "location": "absolute", "style": "labelup", "color": "#4CAF50" }, { "id": "hiddenBullLabel", "kind": "shape", "title": "Hidden Bullish Label", "location": "absolute", "style": "labelup", "color": "#4CAF50", "editable": false }, { "id": "bearLabel", "kind": "shape", "title": "Regular Bearish Label", "location": "absolute", "style": "labeldown", "color": "#F23645" }, { "id": "hiddenBearLabel", "kind": "shape", "title": "Hidden Bearish Label", "location": "absolute", "style": "labeldown", "color": "#F23645", "editable": false }] },
|
|
48647
|
+
"seasonality": { "drawings": ["box", "table"] },
|
|
48648
|
+
"smi": { "hiddenPlots": ["plot2"], "fills": [{ "id": "fill_hlines", "plot1": "hline_overbought", "plot2": "hline_oversold", "title": "Background", "color": "#2962FF1A" }, { "id": "fill_1", "plot1": "plot0", "plot2": "plot2", "title": "Overbought Gradient Fill", "topColor": "#4CAF4F80", "bottomColor": "#4CAF5000" }, { "id": "fill_2", "plot1": "plot0", "plot2": "plot2", "title": "Oversold Gradient Fill", "topColor": "#F2364500", "bottomColor": "#F2364580" }] },
|
|
48649
|
+
"technicals": { "drawings": ["table"] },
|
|
48650
|
+
"trading-sessions": { "drawings": ["box", "label", "linefill", "line"] },
|
|
48651
|
+
"abandoned-baby-bearish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48652
|
+
"abandoned-baby-bullish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48653
|
+
"dark-cloud-cover": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48654
|
+
"doji": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(120, 123, 134, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48655
|
+
"doji-star-bearish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48656
|
+
"doji-star-bullish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48657
|
+
"downside-tasuki-gap": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48658
|
+
"dragonfly-doji": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41, 98, 255, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48659
|
+
"engulfing-bearish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242, 54, 69, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48660
|
+
"engulfing-bullish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41, 98, 255, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48661
|
+
"evening-doji-star": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48662
|
+
"evening-star": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48663
|
+
"falling-three-methods": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48664
|
+
"falling-window": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48665
|
+
"gravestone-doji": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48666
|
+
"hammer": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41, 98, 255, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48667
|
+
"hanging-man": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242, 54, 69, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48668
|
+
"harami-bearish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48669
|
+
"harami-bullish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48670
|
+
"harami-cross-bearish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48671
|
+
"harami-cross-bullish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48672
|
+
"inverted-hammer": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48673
|
+
"kicking-bearish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48674
|
+
"kicking-bullish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48675
|
+
"long-lower-shadow": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41, 98, 255, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48676
|
+
"long-upper-shadow": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242, 54, 69, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48677
|
+
"marubozu-black": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242, 54, 69, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48678
|
+
"marubozu-white": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41, 98, 255, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48679
|
+
"morning-doji-star": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48680
|
+
"morning-star": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48681
|
+
"on-neck": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48682
|
+
"piercing": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48683
|
+
"rising-three-methods": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48684
|
+
"rising-window": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48685
|
+
"shooting-star": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242, 54, 69, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48686
|
+
"spinning-top-black": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(120, 123, 134, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48687
|
+
"spinning-top-white": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(120, 123, 134, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48688
|
+
"three-black-crows": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48689
|
+
"three-white-soldiers": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48690
|
+
"tri-star-bearish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48691
|
+
"tri-star-bullish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48692
|
+
"tweezer-bottom": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41, 98, 255, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48693
|
+
"tweezer-top": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242, 54, 69, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48694
|
+
"upside-tasuki-gap": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48695
|
+
"all-patterns": { "markerDrawing": "label", "drawings": ["label"] },
|
|
48696
|
+
"aroon-oscillator": { "hiddenPlots": ["plot1"], "fills": [{ "id": "fill_0", "plot1": "plot0", "plot2": "plot1", "title": "Oscillator fill", "palette": ["#4CAF501A", "#FF52521A"] }] },
|
|
48697
|
+
"vwap": { "hiddenPlots": ["plot3", "plot4", "plot5", "plot6"], "fills": [{ "id": "fill_0", "plot1": "plot1", "plot2": "plot2", "title": "Bands Fill #1", "color": "rgba(76, 175, 80, 0.05)" }] },
|
|
48698
|
+
"up-down-volume": { "shapes": [{ "id": "delta", "kind": "char", "title": "Delta", "location": "absolute", "char": "\u2014", "palette": ["#4CAF50", "#F23645"] }] },
|
|
48699
|
+
"auto-key-levels": { "drawings": ["label", "line"] },
|
|
48700
|
+
"auto-trend-detector": { "markerDrawing": "label", "drawings": ["label", "line", "table"] }
|
|
48701
|
+
};
|
|
48702
|
+
|
|
48703
|
+
// src/style-apply.ts
|
|
48704
|
+
function stampIds(result, decl) {
|
|
48705
|
+
if (!result || typeof result !== "object")
|
|
48706
|
+
return result;
|
|
48707
|
+
let out = result;
|
|
48708
|
+
const copy = () => out === result ? out = { ...result } : out;
|
|
48709
|
+
for (const [key2, kind] of [["bgColors", "bgcolor"], ["barColors", "barcolor"]]) {
|
|
48710
|
+
const list = result[key2];
|
|
48711
|
+
const own = (decl.barColors ?? []).filter((b) => b.kind === kind);
|
|
48712
|
+
if (!Array.isArray(list) || own.length !== 1 || list.every((x) => x.id))
|
|
48713
|
+
continue;
|
|
48714
|
+
copy()[key2] = list.map((x) => x.id ? x : { ...x, id: own[0].id });
|
|
48715
|
+
}
|
|
48716
|
+
const plotFills = (decl.fills ?? []).filter((f) => !String(f.plot1).startsWith("hline"));
|
|
48717
|
+
if (Array.isArray(result.fills) && plotFills.length && result.fills.some((f) => !f.id)) {
|
|
48718
|
+
const used = /* @__PURE__ */ new Set();
|
|
48719
|
+
copy().fills = result.fills.map((f) => {
|
|
48720
|
+
if (f.id)
|
|
48721
|
+
return f;
|
|
48722
|
+
const same = (d12) => !used.has(d12.id) && d12.plot1 === f.plot1 && d12.plot2 === f.plot2;
|
|
48723
|
+
const d11 = plotFills.find((x) => same(x) && (x.title ?? "") === (f.options?.title ?? "")) ?? plotFills.find(same);
|
|
48724
|
+
if (!d11)
|
|
48725
|
+
return f;
|
|
48726
|
+
used.add(d11.id);
|
|
48727
|
+
return { ...f, id: d11.id };
|
|
48728
|
+
});
|
|
48729
|
+
}
|
|
48730
|
+
return out;
|
|
48731
|
+
}
|
|
48732
|
+
function withStyleOutputs(entry) {
|
|
48733
|
+
const decl = STYLE_OUTPUTS[entry.id];
|
|
48734
|
+
if (!decl)
|
|
48735
|
+
return entry;
|
|
48736
|
+
const hidden2 = new Set(decl.hiddenPlots ?? []);
|
|
48737
|
+
const e = { ...entry };
|
|
48738
|
+
if (hidden2.size)
|
|
48739
|
+
e.plotConfig = entry.plotConfig.map((p) => hidden2.has(p.id) ? { ...p, editable: false } : p);
|
|
48740
|
+
if (decl.hlines && entry.hlineConfig) {
|
|
48741
|
+
e.hlineConfig = entry.hlineConfig.map((h) => decl.hlines[h.id] ? { ...h, ...decl.hlines[h.id] } : h);
|
|
48742
|
+
}
|
|
48743
|
+
if (decl.fills) {
|
|
48744
|
+
const own = new Map((entry.fillConfig ?? []).map((f) => [f.id, f]));
|
|
48745
|
+
const merged = (entry.fillConfig ?? []).map((f) => {
|
|
48746
|
+
const d11 = decl.fills.find((x) => x.id === f.id);
|
|
48747
|
+
return d11 ? { ...f, ...d11 } : f;
|
|
48748
|
+
});
|
|
48749
|
+
for (const d11 of decl.fills)
|
|
48750
|
+
if (!own.has(d11.id))
|
|
48751
|
+
merged.push(d11);
|
|
48752
|
+
e.fillConfig = merged;
|
|
48753
|
+
}
|
|
48754
|
+
if (decl.shapes)
|
|
48755
|
+
e.shapeConfig = decl.shapes;
|
|
48756
|
+
if (decl.markerDrawing)
|
|
48757
|
+
e.markerDrawing = decl.markerDrawing;
|
|
48758
|
+
if (decl.barColors)
|
|
48759
|
+
e.barColorConfig = decl.barColors;
|
|
48760
|
+
if (decl.candles && entry.plotCandleConfig) {
|
|
48761
|
+
e.plotCandleConfig = entry.plotCandleConfig.map((c2) => decl.candles[c2.id] ? { ...c2, ...decl.candles[c2.id], id: c2.id } : c2);
|
|
48762
|
+
}
|
|
48763
|
+
if (decl.drawings)
|
|
48764
|
+
e.drawingKinds = decl.drawings;
|
|
48765
|
+
if (decl.barColors || decl.fills) {
|
|
48766
|
+
const calculate1669 = entry.calculate;
|
|
48767
|
+
e.calculate = (...args) => stampIds(calculate1669(...args), decl);
|
|
48768
|
+
}
|
|
48769
|
+
return e;
|
|
48770
|
+
}
|
|
48771
|
+
|
|
48593
48772
|
// src/standard/aroon-oscillator.ts
|
|
48594
48773
|
var defaultInputs403 = {
|
|
48595
48774
|
length: 14
|
|
@@ -49147,10 +49326,10 @@ function calculate410(bars, inputs = {}, chart) {
|
|
|
49147
49326
|
position: "atPriceMiddle",
|
|
49148
49327
|
price: delta,
|
|
49149
49328
|
shape: "circle",
|
|
49150
|
-
|
|
49151
|
-
|
|
49152
|
-
|
|
49153
|
-
|
|
49329
|
+
char: "\u2014",
|
|
49330
|
+
color: gt18(delta, 0) ? "#4CAF50" : "#F23645",
|
|
49331
|
+
size: "tiny",
|
|
49332
|
+
id: "delta"
|
|
49154
49333
|
});
|
|
49155
49334
|
}
|
|
49156
49335
|
return {
|
|
@@ -49292,11 +49471,11 @@ function calculate412(bars, inputs = {}) {
|
|
|
49292
49471
|
}
|
|
49293
49472
|
if (isHigh) {
|
|
49294
49473
|
highPivots.push({ barIndex: i, price: bars[i].high });
|
|
49295
|
-
markers.push({ time: bars[i].time, position: "aboveBar", shape: "triangleDown", color: RESISTANCE2 });
|
|
49474
|
+
markers.push({ time: bars[i].time, position: "aboveBar", shape: "triangleDown", color: RESISTANCE2, id: "pivotHigh" });
|
|
49296
49475
|
}
|
|
49297
49476
|
if (isLow) {
|
|
49298
49477
|
lowPivots.push({ barIndex: i, price: bars[i].low });
|
|
49299
|
-
markers.push({ time: bars[i].time, position: "belowBar", shape: "triangleUp", color: SUPPORT2 });
|
|
49478
|
+
markers.push({ time: bars[i].time, position: "belowBar", shape: "triangleUp", color: SUPPORT2, id: "pivotLow" });
|
|
49300
49479
|
}
|
|
49301
49480
|
}
|
|
49302
49481
|
const lastTime = n > 0 ? bars[n - 1].time : 0;
|
|
@@ -50586,7 +50765,7 @@ function calculate420(bars, inputs = {}, chart) {
|
|
|
50586
50765
|
otherSymbolChart(bars, chart),
|
|
50587
50766
|
{ other: chart?.symbolInfo?.(symbol) }
|
|
50588
50767
|
);
|
|
50589
|
-
const correlation = import_oakscriptjs385.ta.correlation(import_oakscriptjs385.Series.fromArray(bars,
|
|
50768
|
+
const correlation = import_oakscriptjs385.ta.correlation(import_oakscriptjs385.Series.fromArray(bars, (0, import_oakscriptjs385.getSource)(bars, source)), import_oakscriptjs385.Series.fromArray(bars, requested), length).toArray();
|
|
50590
50769
|
return {
|
|
50591
50770
|
metadata: { title: metadata420.title, shorttitle: metadata420.shortTitle, overlay: metadata420.overlay },
|
|
50592
50771
|
plots: {
|
|
@@ -50857,28 +51036,6 @@ var metadata423 = {
|
|
|
50857
51036
|
};
|
|
50858
51037
|
var gt21 = (a, b) => a - b > 1e-10;
|
|
50859
51038
|
var eq4 = (a, b) => Math.abs(a - b) <= 1e-10;
|
|
50860
|
-
function sourceOf3(bar, src) {
|
|
50861
|
-
switch (src) {
|
|
50862
|
-
case "open":
|
|
50863
|
-
return bar.open;
|
|
50864
|
-
case "high":
|
|
50865
|
-
return bar.high;
|
|
50866
|
-
case "low":
|
|
50867
|
-
return bar.low;
|
|
50868
|
-
case "hl2":
|
|
50869
|
-
return (bar.high + bar.low) / 2;
|
|
50870
|
-
case "hlc3":
|
|
50871
|
-
return (bar.high + bar.low + bar.close) / 3;
|
|
50872
|
-
case "hlcc4":
|
|
50873
|
-
return (bar.high + bar.low + bar.close + bar.close) / 4;
|
|
50874
|
-
case "ohlc4":
|
|
50875
|
-
return (bar.open + bar.high + bar.low + bar.close) / 4;
|
|
50876
|
-
case "volume":
|
|
50877
|
-
return bar.volume ?? NaN;
|
|
50878
|
-
default:
|
|
50879
|
-
return bar.close;
|
|
50880
|
-
}
|
|
50881
|
-
}
|
|
50882
51039
|
function calculate423(bars, inputs = {}) {
|
|
50883
51040
|
const cfg = { ...defaultInputs423, ...inputs };
|
|
50884
51041
|
const result = {
|
|
@@ -50893,7 +51050,8 @@ function calculate423(bars, inputs = {}) {
|
|
|
50893
51050
|
const last = n - 1;
|
|
50894
51051
|
if (n === 0 || length <= 1)
|
|
50895
51052
|
return result;
|
|
50896
|
-
const
|
|
51053
|
+
const srcValues = (0, import_oakscriptjs388.getSource)(bars, cfg.source);
|
|
51054
|
+
const src = (i) => last - i >= 0 ? srcValues[last - i] : NaN;
|
|
50897
51055
|
const high16 = (i) => last - i >= 0 ? bars[last - i].high : NaN;
|
|
50898
51056
|
const low17 = (i) => last - i >= 0 ? bars[last - i].low : NaN;
|
|
50899
51057
|
let sumX = 0;
|
|
@@ -51876,7 +52034,7 @@ function calculate429(bars, inputs = {}, chart) {
|
|
|
51876
52034
|
const v = values[i];
|
|
51877
52035
|
if (!Number.isFinite(v))
|
|
51878
52036
|
return;
|
|
51879
|
-
markers.push({ time: b.time, position: "atPriceMiddle", price: v, shape: "circle", char: p.char, color: p.color });
|
|
52037
|
+
markers.push({ time: b.time, position: "atPriceMiddle", price: v, shape: "circle", char: p.char, color: p.color, id: `pivot${p.tf}` });
|
|
51880
52038
|
});
|
|
51881
52039
|
}
|
|
51882
52040
|
return {
|
|
@@ -52023,16 +52181,16 @@ function calculate430(bars, inputs = {}) {
|
|
|
52023
52181
|
if (!Number.isFinite(v))
|
|
52024
52182
|
continue;
|
|
52025
52183
|
if (bullCond) {
|
|
52026
|
-
markers.push({ time: time15, position: "atPriceBottom", price: v, shape: "labelUp", color: BULL_COLOR5, text: " Bull ", textColor: TEXT_COLOR5 });
|
|
52184
|
+
markers.push({ time: time15, position: "atPriceBottom", price: v, shape: "labelUp", color: BULL_COLOR5, text: " Bull ", textColor: TEXT_COLOR5, id: "bullLabel" });
|
|
52027
52185
|
}
|
|
52028
52186
|
if (hiddenBullCond) {
|
|
52029
|
-
markers.push({ time: time15, position: "atPriceBottom", price: v, shape: "labelUp", color: BULL_COLOR5, text: " H Bull ", textColor: TEXT_COLOR5 });
|
|
52187
|
+
markers.push({ time: time15, position: "atPriceBottom", price: v, shape: "labelUp", color: BULL_COLOR5, text: " H Bull ", textColor: TEXT_COLOR5, id: "hiddenBullLabel" });
|
|
52030
52188
|
}
|
|
52031
52189
|
if (bearCond) {
|
|
52032
|
-
markers.push({ time: time15, position: "atPriceTop", price: v, shape: "labelDown", color: BEAR_COLOR5, text: " Bear ", textColor: TEXT_COLOR5 });
|
|
52190
|
+
markers.push({ time: time15, position: "atPriceTop", price: v, shape: "labelDown", color: BEAR_COLOR5, text: " Bear ", textColor: TEXT_COLOR5, id: "bearLabel" });
|
|
52033
52191
|
}
|
|
52034
52192
|
if (hiddenBearCond) {
|
|
52035
|
-
markers.push({ time: time15, position: "atPriceTop", price: v, shape: "labelDown", color: BEAR_COLOR5, text: " H Bear ", textColor: TEXT_COLOR5 });
|
|
52193
|
+
markers.push({ time: time15, position: "atPriceTop", price: v, shape: "labelDown", color: BEAR_COLOR5, text: " H Bear ", textColor: TEXT_COLOR5, id: "hiddenBearLabel" });
|
|
52036
52194
|
}
|
|
52037
52195
|
}
|
|
52038
52196
|
return {
|
|
@@ -53071,39 +53229,18 @@ var metadata435 = {
|
|
|
53071
53229
|
};
|
|
53072
53230
|
var usesVisibleRange = true;
|
|
53073
53231
|
var PLOT_OFFSET = -1e5;
|
|
53074
|
-
function sourceOf4(b, source) {
|
|
53075
|
-
switch (source) {
|
|
53076
|
-
case "open":
|
|
53077
|
-
return b.open;
|
|
53078
|
-
case "high":
|
|
53079
|
-
return b.high;
|
|
53080
|
-
case "low":
|
|
53081
|
-
return b.low;
|
|
53082
|
-
case "hl2":
|
|
53083
|
-
return (b.high + b.low) / 2;
|
|
53084
|
-
case "hlc3":
|
|
53085
|
-
return (b.high + b.low + b.close) / 3;
|
|
53086
|
-
case "ohlc4":
|
|
53087
|
-
return (b.open + b.high + b.low + b.close) / 4;
|
|
53088
|
-
case "hlcc4":
|
|
53089
|
-
return (b.high + b.low + b.close + b.close) / 4;
|
|
53090
|
-
case "volume":
|
|
53091
|
-
return b.volume ?? NaN;
|
|
53092
|
-
default:
|
|
53093
|
-
return b.close;
|
|
53094
|
-
}
|
|
53095
|
-
}
|
|
53096
53232
|
function calculate435(bars, inputs = {}, chart) {
|
|
53097
53233
|
const { src } = { ...defaultInputs435, ...inputs };
|
|
53098
53234
|
const n = bars.length;
|
|
53099
53235
|
const toMs = chart?.timeUnit === "ms" ? 1 : 1e3;
|
|
53100
53236
|
const { leftTime, rightTime } = visibleRangeOf(bars, chart);
|
|
53101
53237
|
const srcVals = import_oakscriptjs400.array.new_float();
|
|
53102
|
-
|
|
53238
|
+
const values = (0, import_oakscriptjs400.getSource)(bars, src);
|
|
53239
|
+
bars.forEach((b, i) => {
|
|
53103
53240
|
const t = b.time * toMs;
|
|
53104
53241
|
if (t >= leftTime && t <= rightTime)
|
|
53105
|
-
import_oakscriptjs400.array.unshift(srcVals,
|
|
53106
|
-
}
|
|
53242
|
+
import_oakscriptjs400.array.unshift(srcVals, values[i]);
|
|
53243
|
+
});
|
|
53107
53244
|
const last = n > 0 ? import_oakscriptjs400.array.avg(srcVals) : NaN;
|
|
53108
53245
|
const shownBar = n - 1 + PLOT_OFFSET;
|
|
53109
53246
|
const plot0 = bars.map((b, j) => ({ time: b.time, value: j === shownBar ? last : NaN }));
|
|
@@ -136641,7 +136778,7 @@ function calculate1057(bars, inputs = {}) {
|
|
|
136641
136778
|
}
|
|
136642
136779
|
}
|
|
136643
136780
|
};
|
|
136644
|
-
const
|
|
136781
|
+
const sourceOf9 = (name) => bars.map((b) => {
|
|
136645
136782
|
switch (name) {
|
|
136646
136783
|
case "High":
|
|
136647
136784
|
return b.high;
|
|
@@ -136698,7 +136835,7 @@ function calculate1057(bars, inputs = {}) {
|
|
|
136698
136835
|
NN.forEach((nn, k) => {
|
|
136699
136836
|
const s = section(cfg, nn);
|
|
136700
136837
|
const [c3, sc] = SECTION_RGB[k];
|
|
136701
|
-
const src =
|
|
136838
|
+
const src = sourceOf9(s.source);
|
|
136702
136839
|
const m = ma2(src, s.length, s.type);
|
|
136703
136840
|
refma.push(m);
|
|
136704
136841
|
refmaHigh.push(selects[k] ? ma2(high16, s.length, s.type) : zeros);
|
|
@@ -183150,8 +183287,8 @@ function calculate1333(bars, inputs = {}, chart) {
|
|
|
183150
183287
|
const txtSize = cfg.textSize === "Tiny" ? "tiny" : cfg.textSize === "Normal" ? "normal" : "small";
|
|
183151
183288
|
const signalSize = cfg.signalSizeInput === "Tiny" ? "tiny" : cfg.signalSizeInput === "Normal" ? "normal" : cfg.signalSizeInput === "Large" ? "large" : cfg.signalSizeInput === "Huge" ? "huge" : "small";
|
|
183152
183289
|
const sideCost = (fillPrice) => Math.abs(fillPrice) * cfg.commissionPct / 100 + (cfg.spreadTicks * 0.5 + cfg.slipTicks) * MINTICK;
|
|
183153
|
-
const
|
|
183154
|
-
const source = S2(bars.map(
|
|
183290
|
+
const sourceOf9 = (b) => cfg.sourceChoice === "HL2" ? (b.high + b.low) / 2 : cfg.sourceChoice === "HLC3" ? (b.high + b.low + b.close) / 3 : cfg.sourceChoice === "OHLC4" ? (b.open + b.high + b.low + b.close) / 4 : b.close;
|
|
183291
|
+
const source = S2(bars.map(sourceOf9));
|
|
183155
183292
|
const emaFast = A7(import_oakscriptjs1289.ta.ema(source, fastLen));
|
|
183156
183293
|
const emaSlow = A7(import_oakscriptjs1289.ta.ema(source, slowLen));
|
|
183157
183294
|
const emaTrend = A7(import_oakscriptjs1289.ta.ema(source, trendLen));
|
|
@@ -183217,7 +183354,7 @@ function calculate1333(bars, inputs = {}, chart) {
|
|
|
183217
183354
|
group2.forEach((g, i) => {
|
|
183218
183355
|
lastOf[g] = i;
|
|
183219
183356
|
});
|
|
183220
|
-
const htfSource = import_oakscriptjs1289.Series.fromArray(htf, htf.map(
|
|
183357
|
+
const htfSource = import_oakscriptjs1289.Series.fromArray(htf, htf.map(sourceOf9));
|
|
183221
183358
|
const fast = A7(import_oakscriptjs1289.ta.ema(htfSource, fastLen));
|
|
183222
183359
|
const slow = A7(import_oakscriptjs1289.ta.ema(htfSource, slowLen));
|
|
183223
183360
|
for (let i = 0; i < n; i++) {
|
|
@@ -255415,7 +255552,7 @@ var EPS899 = 1e-10;
|
|
|
255415
255552
|
var gt896 = (a, b) => a - b > EPS899;
|
|
255416
255553
|
var lt707 = (a, b) => b - a > EPS899;
|
|
255417
255554
|
var eq200 = (a, b) => !isNaN(a) && !isNaN(b) && !(Math.abs(a - b) > EPS899);
|
|
255418
|
-
function
|
|
255555
|
+
function sourceOf3(bars, name) {
|
|
255419
255556
|
return bars.map((b) => {
|
|
255420
255557
|
switch (name) {
|
|
255421
255558
|
case "open":
|
|
@@ -255595,7 +255732,7 @@ function calculate1543(bars, inputs = {}, chart) {
|
|
|
255595
255732
|
htf = sec.htf;
|
|
255596
255733
|
toChart = (values) => (0, import_oakscriptjs1498.mapToChart)(values, sec.group, sec.latest, false, false);
|
|
255597
255734
|
}
|
|
255598
|
-
const maMtf = toChart(movingAverage4(cfg.maType,
|
|
255735
|
+
const maMtf = toChart(movingAverage4(cfg.maType, sourceOf3(htf, cfg.source), htf, cfg.len));
|
|
255599
255736
|
const closeH = toChart(htf.map((b) => b.close));
|
|
255600
255737
|
const lowH = toChart(htf.map((b) => b.low));
|
|
255601
255738
|
const highH = toChart(htf.map((b) => b.high));
|
|
@@ -261483,7 +261620,7 @@ var RED123 = "#FF5252";
|
|
|
261483
261620
|
var BLACK38 = "#363A45";
|
|
261484
261621
|
var WHITE44 = "#FFFFFF";
|
|
261485
261622
|
var gt912 = (a, b) => a - b > 1e-10;
|
|
261486
|
-
function
|
|
261623
|
+
function sourceOf4(b, s) {
|
|
261487
261624
|
switch (s) {
|
|
261488
261625
|
case "open":
|
|
261489
261626
|
return b.open;
|
|
@@ -261521,13 +261658,13 @@ function calculate1562(bars, inputs = {}, chart) {
|
|
|
261521
261658
|
const length = cfg.length;
|
|
261522
261659
|
const A7 = (s) => s.toArray().map((v) => v ?? NaN);
|
|
261523
261660
|
const { htf, latest } = timeframeBars34(bars, cfg.resolution, chart);
|
|
261524
|
-
const htfSrc = import_oakscriptjs1517.Series.fromArray(htf, htf.map((b2) =>
|
|
261661
|
+
const htfSrc = import_oakscriptjs1517.Series.fromArray(htf, htf.map((b2) => sourceOf4(b2, cfg.source)));
|
|
261525
261662
|
const lr0 = A7(import_oakscriptjs1517.ta.linreg(htfSrc, length, cfg.offset));
|
|
261526
261663
|
const lr1 = A7(import_oakscriptjs1517.ta.linreg(htfSrc, length, cfg.offset + 1));
|
|
261527
261664
|
const onChart = (v) => import_oakscriptjs1517.Series.fromArray(bars, latest.map((g) => g >= 0 ? v[g] : NaN));
|
|
261528
261665
|
const linreg2 = A7(import_oakscriptjs1517.ta.sma(onChart(lr0), cfg.smoothing));
|
|
261529
261666
|
const linregP = A7(import_oakscriptjs1517.ta.sma(onChart(lr1), cfg.smoothing));
|
|
261530
|
-
const src = bars.map((b2) =>
|
|
261667
|
+
const src = bars.map((b2) => sourceOf4(b2, cfg.source));
|
|
261531
261668
|
const interval = (0, import_oakscriptjs12.barInterval)(bars);
|
|
261532
261669
|
const T20 = (index) => (0, import_oakscriptjs12.barTime)(bars, index, interval);
|
|
261533
261670
|
(0, import_oakscriptjs1517.resetDrawings)({ line: 50 });
|
|
@@ -267440,7 +267577,7 @@ var metadata1578 = {
|
|
|
267440
267577
|
var EPS929 = 1e-10;
|
|
267441
267578
|
var gt925 = (a, b) => a - b > EPS929;
|
|
267442
267579
|
var lt730 = (a, b) => b - a > EPS929;
|
|
267443
|
-
function
|
|
267580
|
+
function sourceOf5(b, src) {
|
|
267444
267581
|
switch (src) {
|
|
267445
267582
|
case "open":
|
|
267446
267583
|
return b.open;
|
|
@@ -267466,7 +267603,7 @@ function calculate1578(bars, inputs = {}) {
|
|
|
267466
267603
|
const prd = Math.trunc(cfg.prd);
|
|
267467
267604
|
const ppNum = Math.trunc(cfg.ppNum);
|
|
267468
267605
|
const A7 = (s) => s.toArray().map((v) => v ?? NaN);
|
|
267469
|
-
const srcSeries = new import_oakscriptjs1533.Series(bars, (b) =>
|
|
267606
|
+
const srcSeries = new import_oakscriptjs1533.Series(bars, (b) => sourceOf5(b, cfg.src));
|
|
267470
267607
|
const osc = cfg.indi === "RSI" ? A7(import_oakscriptjs1533.ta.rsi(srcSeries, cfg.rsiLen)) : cfg.indi === "CCI" ? A7(import_oakscriptjs1533.ta.cci(srcSeries, cfg.cciLen)) : cfg.indi === "Momentum" ? A7(import_oakscriptjs1533.ta.cci(srcSeries, cfg.momLen)) : A7(import_oakscriptjs1533.ta.obv(bars));
|
|
267471
267608
|
const oscSeries = import_oakscriptjs1533.Series.fromArray(bars, osc);
|
|
267472
267609
|
const ph = A7(import_oakscriptjs1533.ta.pivothigh(oscSeries, prd, prd));
|
|
@@ -273424,7 +273561,7 @@ function habClose(sub, cfg) {
|
|
|
273424
273561
|
}
|
|
273425
273562
|
return res;
|
|
273426
273563
|
}
|
|
273427
|
-
function
|
|
273564
|
+
function sourceOf6(bars, cfg) {
|
|
273428
273565
|
const opt = cfg.srcoption;
|
|
273429
273566
|
if (opt.startsWith("HAB ")) {
|
|
273430
273567
|
const hc = habClose(bars, cfg);
|
|
@@ -273498,7 +273635,7 @@ function sourceOf8(bars, cfg) {
|
|
|
273498
273635
|
function calculate1594(bars, inputs = {}) {
|
|
273499
273636
|
const cfg = { ...defaultInputs1594, ...inputs };
|
|
273500
273637
|
const n = bars.length;
|
|
273501
|
-
let src =
|
|
273638
|
+
let src = sourceOf6(bars, cfg);
|
|
273502
273639
|
if (cfg.filterop === "Both" || cfg.filterop === "Price" && gt937(cfg.filter, 0)) {
|
|
273503
273640
|
src = stdFilter(bars, src, cfg.filterperiod, cfg.filter);
|
|
273504
273641
|
}
|
|
@@ -290158,7 +290295,7 @@ function calculate1639(bars, inputs = {}) {
|
|
|
290158
290295
|
const A7 = (s) => s.toArray().map((v) => v === null || v === void 0 ? NaN : v);
|
|
290159
290296
|
const S2 = (a) => import_oakscriptjs1594.Series.fromArray(bars, a);
|
|
290160
290297
|
const field = (f) => bars.map(f);
|
|
290161
|
-
const
|
|
290298
|
+
const sourceOf9 = (s) => {
|
|
290162
290299
|
switch (s) {
|
|
290163
290300
|
case "open":
|
|
290164
290301
|
return field((b) => b.open);
|
|
@@ -290187,7 +290324,7 @@ function calculate1639(bars, inputs = {}) {
|
|
|
290187
290324
|
const closeS = S2(close11);
|
|
290188
290325
|
const scale = cfg.scale;
|
|
290189
290326
|
const lengthM = Math.trunc(cfg.lengthM);
|
|
290190
|
-
const srcM =
|
|
290327
|
+
const srcM = sourceOf9(cfg.srcM);
|
|
290191
290328
|
const hh = A7(import_oakscriptjs1594.ta.highest(highS, lengthM));
|
|
290192
290329
|
const ll = A7(import_oakscriptjs1594.ta.lowest(lowS, lengthM));
|
|
290193
290330
|
const smaM = A7(import_oakscriptjs1594.ta.sma(closeS, lengthM));
|
|
@@ -290257,7 +290394,7 @@ function calculate1639(bars, inputs = {}) {
|
|
|
290257
290394
|
const low58 = A7(import_oakscriptjs1594.ta.lowest(lowS, 58));
|
|
290258
290395
|
const var7 = low58.map((v) => !Number.isNaN(v) && v !== 0 ? 1 : 0);
|
|
290259
290396
|
const var8 = A7(import_oakscriptjs1594.ta.ema(S2(low17.map((v, i) => le303(v, var5[i]) ? (var4[i] + var6[i] * 2) / 2 : 0)), 3)).map((v, i) => v / 618 * var7[i]);
|
|
290260
|
-
const src =
|
|
290397
|
+
const src = sourceOf9(cfg.src);
|
|
290261
290398
|
const srcS = S2(src);
|
|
290262
290399
|
const rsi = A7(import_oakscriptjs1594.ta.rsi(srcS, Math.trunc(cfg.len)));
|
|
290263
290400
|
const rsiScale = rsi.map((v, i) => sc(v + cfg.rsiApart, i));
|
|
@@ -290272,7 +290409,7 @@ function calculate1639(bars, inputs = {}) {
|
|
|
290272
290409
|
const divergence = rsiFast.map((v, i) => v - rsiSlow[i]);
|
|
290273
290410
|
const kSto = A7(import_oakscriptjs1594.ta.sma(import_oakscriptjs1594.ta.stoch(closeS, highS, lowS, Math.trunc(cfg.periodK)), Math.trunc(cfg.smoothK)));
|
|
290274
290411
|
const dSto = A7(import_oakscriptjs1594.ta.sma(S2(kSto), Math.trunc(cfg.periodD)));
|
|
290275
|
-
const hl2S = S2(
|
|
290412
|
+
const hl2S = S2(sourceOf9("hl2"));
|
|
290276
290413
|
const aoSlow = A7(import_oakscriptjs1594.ta.sma(hl2S, Math.trunc(cfg.slowLength)));
|
|
290277
290414
|
const ao = A7(import_oakscriptjs1594.ta.sma(hl2S, Math.trunc(cfg.fastLength))).map((v, i) => v - aoSlow[i]);
|
|
290278
290415
|
const histColor = (h, i) => {
|
|
@@ -290291,7 +290428,7 @@ function calculate1639(bars, inputs = {}) {
|
|
|
290291
290428
|
const macd = macd1.map((v) => v * cfg.macdScale);
|
|
290292
290429
|
const sign = signal.map((v) => v * cfg.macdScale);
|
|
290293
290430
|
const m = Math.trunc(cfg.m);
|
|
290294
|
-
const tprice =
|
|
290431
|
+
const tprice = sourceOf9(cfg.srcTprice);
|
|
290295
290432
|
const tpriceS = S2(tprice);
|
|
290296
290433
|
const pvi = A7(import_oakscriptjs1594.ta.pvi(bars));
|
|
290297
290434
|
const pvim = A7(import_oakscriptjs1594.ta.ema(S2(pvi), m));
|
|
@@ -290303,7 +290440,7 @@ function calculate1639(bars, inputs = {}) {
|
|
|
290303
290440
|
const nvimax = A7(import_oakscriptjs1594.ta.highest(S2(nvim), Math.trunc(cfg.longitudNVI)));
|
|
290304
290441
|
const nvimin = A7(import_oakscriptjs1594.ta.lowest(S2(nvim), Math.trunc(cfg.longitudNVI)));
|
|
290305
290442
|
const azul = nvi.map((v, i) => (v - nvim[i]) * 100 / (nvimax[i] - nvimin[i]));
|
|
290306
|
-
const xmf = A7(import_oakscriptjs1594.ta.mfi(S2(
|
|
290443
|
+
const xmf = A7(import_oakscriptjs1594.ta.mfi(S2(sourceOf9(cfg.srcMfi)), Math.trunc(cfg.longitudMFI), S2(field((b) => b.volume ?? NaN))));
|
|
290307
290444
|
const boLength = Math.trunc(cfg.boLength);
|
|
290308
290445
|
const basisK = A7(import_oakscriptjs1594.ta.sma(tpriceS, boLength));
|
|
290309
290446
|
const devK = A7(import_oakscriptjs1594.ta.stdev(tpriceS, boLength)).map((v) => cfg.mult * v);
|
|
@@ -290321,12 +290458,12 @@ function calculate1639(bars, inputs = {}) {
|
|
|
290321
290458
|
const media = A7(import_oakscriptjs1594.ta.ema(S2(marron), m));
|
|
290322
290459
|
const konBull = A7(import_oakscriptjs1594.ta.crossover(S2(marron), S2(media)));
|
|
290323
290460
|
const konBear = A7(import_oakscriptjs1594.ta.crossunder(S2(marron), S2(media)));
|
|
290324
|
-
const cci = A7(import_oakscriptjs1594.ta.cci(S2(
|
|
290461
|
+
const cci = A7(import_oakscriptjs1594.ta.cci(S2(sourceOf9(cfg.cciSrc)), Math.trunc(cfg.cciLen)));
|
|
290325
290462
|
const rsiMFI = A7(import_oakscriptjs1594.ta.sma(
|
|
290326
290463
|
S2(bars.map((b) => (b.close - b.open) / (b.high - b.low) * cfg.rsiMFIMultiplier)),
|
|
290327
290464
|
Math.trunc(cfg.rsiMFIperiod)
|
|
290328
290465
|
)).map((v) => v - cfg.rsiMFIPosY);
|
|
290329
|
-
const ap =
|
|
290466
|
+
const ap = sourceOf9("hlc3");
|
|
290330
290467
|
const esa = A7(import_oakscriptjs1594.ta.ema(S2(ap), Math.trunc(cfg.n1)));
|
|
290331
290468
|
const dw = A7(import_oakscriptjs1594.ta.ema(S2(ap.map((v, i) => Math.abs(v - esa[i]))), Math.trunc(cfg.n1)));
|
|
290332
290469
|
const ci = ap.map((v, i) => (v - esa[i]) / (0.015 * dw[i]));
|
|
@@ -298536,7 +298673,7 @@ var eq228 = (a, b) => Math.abs(a - b) <= EPS1002;
|
|
|
298536
298673
|
var ne117 = (a, b) => !isNaN(a) && !isNaN(b) && Math.abs(a - b) > EPS1002;
|
|
298537
298674
|
var cnew2 = (c2, t) => String(import_oakscriptjs1613.color.new(c2, t));
|
|
298538
298675
|
var WHITE56 = "#FFFFFF";
|
|
298539
|
-
function
|
|
298676
|
+
function sourceOf7(bars, name) {
|
|
298540
298677
|
switch (name) {
|
|
298541
298678
|
case "open":
|
|
298542
298679
|
return bars.map((b) => b.open);
|
|
@@ -298609,7 +298746,7 @@ function calculate1658(bars, inputs = {}, chart) {
|
|
|
298609
298746
|
for (let i = 0; i < n; i++) {
|
|
298610
298747
|
haOpen.push(i === 0 || isNaN(haOpen[i - 1]) ? (open11[i] + close11[i]) / 2 : (haOpen[i - 1] + ohlc4[i - 1]) / 2);
|
|
298611
298748
|
}
|
|
298612
|
-
const srcPrice =
|
|
298749
|
+
const srcPrice = sourceOf7(bars, cfg.srcPrice);
|
|
298613
298750
|
const alternative = bars.map((b, i) => {
|
|
298614
298751
|
switch (cfg.altSourceFormula) {
|
|
298615
298752
|
case "(open + close +3 * (high + low)) / 8":
|
|
@@ -303140,7 +303277,7 @@ var ge457 = (a, b) => !isNaN(a) && !isNaN(b) && !(b - a > EPS1005);
|
|
|
303140
303277
|
var le311 = (a, b) => !isNaN(a) && !isNaN(b) && !(a - b > EPS1005);
|
|
303141
303278
|
var eq229 = (a, b) => !isNaN(a) && !isNaN(b) && Math.abs(a - b) <= EPS1005;
|
|
303142
303279
|
var nz115 = (x, y = 0) => isNaN(x) ? y : x;
|
|
303143
|
-
function
|
|
303280
|
+
function sourceOf8(bars, src) {
|
|
303144
303281
|
return bars.map((b) => {
|
|
303145
303282
|
switch (src) {
|
|
303146
303283
|
case "open":
|
|
@@ -303170,7 +303307,7 @@ function calculate1668(bars, inputs = {}, chart) {
|
|
|
303170
303307
|
const mom = Math.trunc(cfg.mom);
|
|
303171
303308
|
const A7 = (s) => s.toArray().map((v) => v ?? NaN);
|
|
303172
303309
|
const S2 = (a) => import_oakscriptjs1623.Series.fromArray(bars, a);
|
|
303173
|
-
const src =
|
|
303310
|
+
const src = sourceOf8(bars, cfg.maSrc);
|
|
303174
303311
|
const srcS = S2(src);
|
|
303175
303312
|
const variant4 = () => {
|
|
303176
303313
|
switch (cfg.maType) {
|
|
@@ -325449,5 +325586,5 @@ var registryPart11 = [
|
|
|
325449
325586
|
calculate: calculate435
|
|
325450
325587
|
}
|
|
325451
325588
|
];
|
|
325452
|
-
var indicatorRegistry = [...registryPart1, ...registryPart11, ...registryPart2, ...registryPart3, ...registryPart4, ...registryPart5, ...registryPart6, ...registryPart7, ...registryPart8, ...registryPart9, ...registryPart10].map(withReferenceNames).map(withValueFormat);
|
|
325453
|
-
var version = "0.
|
|
325589
|
+
var indicatorRegistry = [...registryPart1, ...registryPart11, ...registryPart2, ...registryPart3, ...registryPart4, ...registryPart5, ...registryPart6, ...registryPart7, ...registryPart8, ...registryPart9, ...registryPart10].map(withReferenceNames).map(withValueFormat).map(withStyleOutputs);
|
|
325590
|
+
var version = "0.16.0";
|