lightweight-charts-indicators 0.15.4 → 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 +194 -15
- package/dist/index.d.ts +17 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +194 -15
- package/dist/sources.mjs +1 -1
- package/dist/standard/moon-phases.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;
|
|
@@ -51855,7 +52034,7 @@ function calculate429(bars, inputs = {}, chart) {
|
|
|
51855
52034
|
const v = values[i];
|
|
51856
52035
|
if (!Number.isFinite(v))
|
|
51857
52036
|
return;
|
|
51858
|
-
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}` });
|
|
51859
52038
|
});
|
|
51860
52039
|
}
|
|
51861
52040
|
return {
|
|
@@ -52002,16 +52181,16 @@ function calculate430(bars, inputs = {}) {
|
|
|
52002
52181
|
if (!Number.isFinite(v))
|
|
52003
52182
|
continue;
|
|
52004
52183
|
if (bullCond) {
|
|
52005
|
-
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" });
|
|
52006
52185
|
}
|
|
52007
52186
|
if (hiddenBullCond) {
|
|
52008
|
-
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" });
|
|
52009
52188
|
}
|
|
52010
52189
|
if (bearCond) {
|
|
52011
|
-
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" });
|
|
52012
52191
|
}
|
|
52013
52192
|
if (hiddenBearCond) {
|
|
52014
|
-
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" });
|
|
52015
52194
|
}
|
|
52016
52195
|
}
|
|
52017
52196
|
return {
|
|
@@ -325407,5 +325586,5 @@ var registryPart11 = [
|
|
|
325407
325586
|
calculate: calculate435
|
|
325408
325587
|
}
|
|
325409
325588
|
];
|
|
325410
|
-
var indicatorRegistry = [...registryPart1, ...registryPart11, ...registryPart2, ...registryPart3, ...registryPart4, ...registryPart5, ...registryPart6, ...registryPart7, ...registryPart8, ...registryPart9, ...registryPart10].map(withReferenceNames).map(withValueFormat);
|
|
325411
|
-
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";
|
package/dist/index.d.ts
CHANGED
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
* These indicators are hand-optimized versions that leverage the oakscriptjs
|
|
7
7
|
* library for better performance and more idiomatic TypeScript code.
|
|
8
8
|
*/
|
|
9
|
-
import type { Bar, InputConfig, PlotConfig, HLineConfig, FillConfig, ArrowConfig } from 'oakscriptjs';
|
|
9
|
+
import type { Bar, InputConfig, PlotConfig, HLineConfig, FillConfig, ArrowConfig, ShapeConfig, BarColorConfig } from 'oakscriptjs';
|
|
10
|
+
import type { PlotCandleDecl } from './style-apply';
|
|
11
|
+
import type { StudyDrawingKind } from './style-outputs';
|
|
10
12
|
import type { ChartContext, SymbolRequest } from './chart-context';
|
|
11
|
-
export type { InputConfig, PlotConfig, HLineConfig, FillConfig } from 'oakscriptjs';
|
|
13
|
+
export type { InputConfig, PlotConfig, HLineConfig, FillConfig, ShapeConfig, BarColorConfig, CandleConfig } from 'oakscriptjs';
|
|
12
14
|
export { SMA, calculate as calculateSMA } from './standard/sma';
|
|
13
15
|
export type { SMAInputs } from './standard/sma';
|
|
14
16
|
export { ADR, calculate as calculateADR } from './standard/adr';
|
|
@@ -731,6 +733,8 @@ export type { VwapMvwapEmaCrossoverInputs } from './community/vwap-mvwap-ema-cro
|
|
|
731
733
|
export type { VolumeFootprintInputs } from './community/volume-footprint';
|
|
732
734
|
export { VALUE_FORMATS, type StudyFormat } from './value-formats';
|
|
733
735
|
export { REFERENCE_NAMES } from './reference-names';
|
|
736
|
+
export { STYLE_OUTPUTS, type StyleOutputs, type StudyDrawingKind } from './style-outputs';
|
|
737
|
+
export type { PlotCandleDecl } from './style-apply';
|
|
734
738
|
export { candlestickPortIndicators, candlestickPortEntries, candlestickPortAllPatterns } from './candlestick-port/adapter';
|
|
735
739
|
export declare const Hammer: import("./candlestick-port/adapter").PortIndicator;
|
|
736
740
|
export declare const ShootingStar: import("./candlestick-port/adapter").PortIndicator;
|
|
@@ -3332,12 +3336,18 @@ export interface IndicatorRegistryEntry {
|
|
|
3332
3336
|
plotConfig: PlotConfig[];
|
|
3333
3337
|
hlineConfig?: HLineConfig[];
|
|
3334
3338
|
fillConfig?: FillConfig[];
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
title: string;
|
|
3338
|
-
}[];
|
|
3339
|
+
/** Its candles (plotcandle) by id of the result's `plotCandles`: title, colours (a single colour or a palette) */
|
|
3340
|
+
plotCandleConfig?: PlotCandleDecl[];
|
|
3339
3341
|
/** plotarrow settings by arrow id (minheight / maxheight / forceOverlay) of the `arrows` of the result */
|
|
3340
3342
|
arrowConfig?: ArrowConfig[];
|
|
3343
|
+
/** Its shape / character outputs (plotshape / plotchar): the `id` of their markers in the result, title, defaults */
|
|
3344
|
+
shapeConfig?: ShapeConfig[];
|
|
3345
|
+
/** Markers that are not in `shapeConfig` are drawings of this kind (the reference draws them as labels) */
|
|
3346
|
+
markerDrawing?: StudyDrawingKind;
|
|
3347
|
+
/** Its background / bar colour outputs (bgcolor / barcolor): the `id` of their entries in the result */
|
|
3348
|
+
barColorConfig?: BarColorConfig[];
|
|
3349
|
+
/** The kinds of drawing objects it creates (labels, lines, boxes, ...): one show / hide row per kind */
|
|
3350
|
+
drawingKinds?: StudyDrawingKind[];
|
|
3341
3351
|
/**
|
|
3342
3352
|
* Its outputs in the order PineScript numbers them for alert messages ({{plot_<n>}}): line plots, shapes,
|
|
3343
3353
|
* characters and arrows as the reference script declares them; the values of the shapes / characters / arrows are in
|
|
@@ -3380,5 +3390,5 @@ export type { ChartContext, VisibleRange, SymbolRequest, SymbolInfo } from './ch
|
|
|
3380
3390
|
export { MissingSymbolDataError, symbolBarsOf } from './chart-context';
|
|
3381
3391
|
export { mintickOf, timezoneOf, tickeridOf, tickerOf, symbolTypeOf, currencyOf, basecurrencyOf, rootOf, foregroundColorOf, backgroundColorOf, lastBarConfirmedOf, nowOf, visibleRangeOf, } from './chart-context';
|
|
3382
3392
|
export { securityOther, securityOtherValues, securityLowerTf, otherSymbolChart, spreadSymbols, spreadBars, spreadOptions, type OtherSymbolOptions, type OtherSymbolChart, type SymbolCalendar, } from './other-symbol';
|
|
3383
|
-
export declare const version = "0.
|
|
3393
|
+
export declare const version = "0.16.0";
|
|
3384
3394
|
//# sourceMappingURL=index.d.ts.map
|