lightweight-charts-indicators 0.15.4 → 0.16.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/index.cjs +197 -15
- package/dist/index.d.ts +17 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +197 -15
- package/dist/sources.mjs +1 -1
- package/dist/standard/bollinger-bars.d.ts.map +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
|
}
|
|
@@ -9516,6 +9519,8 @@ function calculate83(bars, _inputs = {}) {
|
|
|
9516
9519
|
low: b.low,
|
|
9517
9520
|
close: b.low,
|
|
9518
9521
|
color: "#0D349E",
|
|
9522
|
+
// reference: wickcolor transparent on both series (the wick candles draw the high-low range as their body)
|
|
9523
|
+
wickColor: "rgba(0,0,0,0)",
|
|
9519
9524
|
borderColor: "#0D349E"
|
|
9520
9525
|
}));
|
|
9521
9526
|
const body = bars.map((b) => {
|
|
@@ -9527,6 +9532,7 @@ function calculate83(bars, _inputs = {}) {
|
|
|
9527
9532
|
low: b.low,
|
|
9528
9533
|
close: b.close,
|
|
9529
9534
|
color: col2,
|
|
9535
|
+
wickColor: "rgba(0,0,0,0)",
|
|
9530
9536
|
borderColor: col2
|
|
9531
9537
|
};
|
|
9532
9538
|
});
|
|
@@ -9696,14 +9702,16 @@ function calculate84(bars, inputs = {}, chart) {
|
|
|
9696
9702
|
time: bar.time,
|
|
9697
9703
|
position: "aboveBar",
|
|
9698
9704
|
shape: "circle",
|
|
9699
|
-
color: hexToRgba(waxingMoonColor, 0.5)
|
|
9705
|
+
color: hexToRgba(waxingMoonColor, 0.5),
|
|
9706
|
+
id: "newMoon"
|
|
9700
9707
|
});
|
|
9701
9708
|
} else if (moonType === -1) {
|
|
9702
9709
|
markers.push({
|
|
9703
9710
|
time: bar.time,
|
|
9704
9711
|
position: "belowBar",
|
|
9705
9712
|
shape: "circle",
|
|
9706
|
-
color: hexToRgba(waningMoonColor, 0.5)
|
|
9713
|
+
color: hexToRgba(waningMoonColor, 0.5),
|
|
9714
|
+
id: "fullMoon"
|
|
9707
9715
|
});
|
|
9708
9716
|
}
|
|
9709
9717
|
const bgColor = moonPhaseAdjusted === 1 ? hexToRgba(waxingMoonColor, 0.05) : hexToRgba(waningMoonColor, 0.05);
|
|
@@ -48590,6 +48598,180 @@ function withValueFormat(entry) {
|
|
|
48590
48598
|
return f && !entry.format ? { ...entry, format: f } : entry;
|
|
48591
48599
|
}
|
|
48592
48600
|
|
|
48601
|
+
// src/style-outputs.ts
|
|
48602
|
+
var STYLE_OUTPUTS = {
|
|
48603
|
+
"sma": { "hiddenPlots": ["plot1", "plot2", "plot3"] },
|
|
48604
|
+
"bb": { "fills": [{ "id": "fill_0", "plot1": "plot1", "plot2": "plot2", "title": "Background", "color": "rgba(33, 150, 243, 0.05)" }] },
|
|
48605
|
+
"cci": { "hiddenPlots": ["plot2", "plot3"], "hlines": { "hline_mid": { "linestyle": "dashed" } }, "fills": [{ "id": "fill_band", "plot1": "hline_upper", "plot2": "hline_lower", "title": "Background", "color": "#2962FF1A" }] },
|
|
48606
|
+
"ema": { "hiddenPlots": ["plot1", "plot2", "plot3"] },
|
|
48607
|
+
"ichimoku": { "fills": [{ "id": "fill_0", "plot1": "plot3", "plot2": "plot4", "title": "Cloud Fill", "palette": ["#43A0471A", "#F443361A"] }] },
|
|
48608
|
+
"keltner": { "fills": [{ "id": "fill_0", "plot1": "plot0", "plot2": "plot2", "title": "Background", "color": "rgba(33, 150, 243, 0.05)" }] },
|
|
48609
|
+
"obv": { "hiddenPlots": ["plot1", "plot2", "plot3"] },
|
|
48610
|
+
"roc": { "hlines": { "hline_zero": { "linestyle": "dashed" } } },
|
|
48611
|
+
"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 }] },
|
|
48612
|
+
"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" }] },
|
|
48613
|
+
"donchian": { "fills": [{ "id": "fill_0", "plot1": "plot1", "plot2": "plot2", "title": "Background", "color": "rgba(33, 150, 243, 0.05)" }] },
|
|
48614
|
+
"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)" }] },
|
|
48615
|
+
"bbtrend": { "hlines": { "hline_zero": { "title": "Zero Line", "linestyle": "dashed" } } },
|
|
48616
|
+
"bull-bear-power": { "hlines": { "hline_zero": { "title": "Zero Line", "linestyle": "dashed" } } },
|
|
48617
|
+
"dpo": { "hlines": { "hline_zero": { "linestyle": "dashed" } } },
|
|
48618
|
+
"median": { "fills": [{ "id": "fill_0", "plot1": "plot0", "plot2": "plot3", "title": "Fill color", "palette": ["#00E676E6", "#E040FBE6"] }] },
|
|
48619
|
+
"mfi": { "fills": [{ "id": "fill_band", "plot1": "hline_upper", "plot2": "hline_lower", "title": "Background", "color": "#7E57C21A" }] },
|
|
48620
|
+
"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" }] },
|
|
48621
|
+
"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" }] },
|
|
48622
|
+
"tsi": { "hlines": { "hline_zero": { "linestyle": "dashed" } } },
|
|
48623
|
+
"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" }] },
|
|
48624
|
+
"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" }] },
|
|
48625
|
+
"envelope": { "fills": [{ "id": "fill_0", "plot1": "plot1", "plot2": "plot2", "title": "Background", "color": "rgba(33, 150, 243, 0.05)" }] },
|
|
48626
|
+
"choppiness": { "hlines": { "hline_mid": { "linestyle": "dashed" } }, "fills": [{ "id": "fill_band", "plot1": "hline_upper", "plot2": "hline_lower", "title": "Background", "color": "#2962FF1A" }] },
|
|
48627
|
+
"zigzag": { "drawings": ["label", "line"] },
|
|
48628
|
+
"trix": { "hlines": { "hline_zero": { "linestyle": "dashed" } } },
|
|
48629
|
+
"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" }] },
|
|
48630
|
+
"volume-delta": { "candles": { "delta": { "title": "Volume Delta", "palettes": { "color": ["#089981", "#F23645"], "wickColor": ["#089981", "#F23645"], "borderColor": ["#089981", "#F23645"] } } } },
|
|
48631
|
+
"cvd": { "candles": { "cvd": { "title": "CVD", "palettes": { "color": ["#089981", "#F23645"], "wickColor": ["#089981", "#F23645"], "borderColor": ["#089981", "#F23645"] } } } },
|
|
48632
|
+
"kst": { "hlines": { "hline_zero": { "linestyle": "dashed" } } },
|
|
48633
|
+
"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" }] },
|
|
48634
|
+
"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 }] },
|
|
48635
|
+
"rvol": { "hiddenPlots": ["plot2", "plot3"] },
|
|
48636
|
+
"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" }] },
|
|
48637
|
+
"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"] } } } },
|
|
48638
|
+
"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" }] },
|
|
48639
|
+
"auto-fib-extension": { "drawings": ["label", "linefill", "line"] },
|
|
48640
|
+
"auto-fib-retracement": { "drawings": ["label", "linefill", "line"] },
|
|
48641
|
+
"auto-pitchfork": { "drawings": ["label", "linefill", "line"] },
|
|
48642
|
+
"gaps": { "drawings": ["box", "table"] },
|
|
48643
|
+
"linreg-channel": { "drawings": ["label", "linefill", "line"] },
|
|
48644
|
+
"multi-time-period-charts": { "drawings": ["box"] },
|
|
48645
|
+
"performance": { "drawings": ["table"] },
|
|
48646
|
+
"pivot-points-high-low": { "drawings": ["label"] },
|
|
48647
|
+
"pivot-points-standard": { "drawings": ["label", "line"] },
|
|
48648
|
+
"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" }] },
|
|
48649
|
+
"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 }] },
|
|
48650
|
+
"seasonality": { "drawings": ["box", "table"] },
|
|
48651
|
+
"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" }] },
|
|
48652
|
+
"technicals": { "drawings": ["table"] },
|
|
48653
|
+
"trading-sessions": { "drawings": ["box", "label", "linefill", "line"] },
|
|
48654
|
+
"abandoned-baby-bearish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48655
|
+
"abandoned-baby-bullish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48656
|
+
"dark-cloud-cover": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48657
|
+
"doji": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(120, 123, 134, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48658
|
+
"doji-star-bearish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48659
|
+
"doji-star-bullish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48660
|
+
"downside-tasuki-gap": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48661
|
+
"dragonfly-doji": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41, 98, 255, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48662
|
+
"engulfing-bearish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242, 54, 69, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48663
|
+
"engulfing-bullish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41, 98, 255, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48664
|
+
"evening-doji-star": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48665
|
+
"evening-star": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48666
|
+
"falling-three-methods": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48667
|
+
"falling-window": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48668
|
+
"gravestone-doji": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48669
|
+
"hammer": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41, 98, 255, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48670
|
+
"hanging-man": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242, 54, 69, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48671
|
+
"harami-bearish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48672
|
+
"harami-bullish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48673
|
+
"harami-cross-bearish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48674
|
+
"harami-cross-bullish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48675
|
+
"inverted-hammer": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48676
|
+
"kicking-bearish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48677
|
+
"kicking-bullish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48678
|
+
"long-lower-shadow": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41, 98, 255, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48679
|
+
"long-upper-shadow": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242, 54, 69, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48680
|
+
"marubozu-black": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242, 54, 69, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48681
|
+
"marubozu-white": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41, 98, 255, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48682
|
+
"morning-doji-star": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48683
|
+
"morning-star": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48684
|
+
"on-neck": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48685
|
+
"piercing": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48686
|
+
"rising-three-methods": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48687
|
+
"rising-window": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48688
|
+
"shooting-star": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242, 54, 69, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48689
|
+
"spinning-top-black": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(120, 123, 134, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48690
|
+
"spinning-top-white": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(120, 123, 134, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48691
|
+
"three-black-crows": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48692
|
+
"three-white-soldiers": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48693
|
+
"tri-star-bearish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242,54,69,0.1)"] }], "drawings": ["label"] },
|
|
48694
|
+
"tri-star-bullish": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48695
|
+
"tweezer-bottom": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41, 98, 255, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48696
|
+
"tweezer-top": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(242, 54, 69, 0.09999999999999998)"] }], "drawings": ["label"] },
|
|
48697
|
+
"upside-tasuki-gap": { "markerDrawing": "label", "barColors": [{ "id": "bgcolor0", "kind": "bgcolor", "title": "Background Color", "palette": ["rgba(41,98,255,0.1)"] }], "drawings": ["label"] },
|
|
48698
|
+
"all-patterns": { "markerDrawing": "label", "drawings": ["label"] },
|
|
48699
|
+
"aroon-oscillator": { "hiddenPlots": ["plot1"], "fills": [{ "id": "fill_0", "plot1": "plot0", "plot2": "plot1", "title": "Oscillator fill", "palette": ["#4CAF501A", "#FF52521A"] }] },
|
|
48700
|
+
"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)" }] },
|
|
48701
|
+
"up-down-volume": { "shapes": [{ "id": "delta", "kind": "char", "title": "Delta", "location": "absolute", "char": "\u2014", "palette": ["#4CAF50", "#F23645"] }] },
|
|
48702
|
+
"auto-key-levels": { "drawings": ["label", "line"] },
|
|
48703
|
+
"auto-trend-detector": { "markerDrawing": "label", "drawings": ["label", "line", "table"] }
|
|
48704
|
+
};
|
|
48705
|
+
|
|
48706
|
+
// src/style-apply.ts
|
|
48707
|
+
function stampIds(result, decl) {
|
|
48708
|
+
if (!result || typeof result !== "object")
|
|
48709
|
+
return result;
|
|
48710
|
+
let out = result;
|
|
48711
|
+
const copy = () => out === result ? out = { ...result } : out;
|
|
48712
|
+
for (const [key2, kind] of [["bgColors", "bgcolor"], ["barColors", "barcolor"]]) {
|
|
48713
|
+
const list = result[key2];
|
|
48714
|
+
const own = (decl.barColors ?? []).filter((b) => b.kind === kind);
|
|
48715
|
+
if (!Array.isArray(list) || own.length !== 1 || list.every((x) => x.id))
|
|
48716
|
+
continue;
|
|
48717
|
+
copy()[key2] = list.map((x) => x.id ? x : { ...x, id: own[0].id });
|
|
48718
|
+
}
|
|
48719
|
+
const plotFills = (decl.fills ?? []).filter((f) => !String(f.plot1).startsWith("hline"));
|
|
48720
|
+
if (Array.isArray(result.fills) && plotFills.length && result.fills.some((f) => !f.id)) {
|
|
48721
|
+
const used = /* @__PURE__ */ new Set();
|
|
48722
|
+
copy().fills = result.fills.map((f) => {
|
|
48723
|
+
if (f.id)
|
|
48724
|
+
return f;
|
|
48725
|
+
const same = (d12) => !used.has(d12.id) && d12.plot1 === f.plot1 && d12.plot2 === f.plot2;
|
|
48726
|
+
const d11 = plotFills.find((x) => same(x) && (x.title ?? "") === (f.options?.title ?? "")) ?? plotFills.find(same);
|
|
48727
|
+
if (!d11)
|
|
48728
|
+
return f;
|
|
48729
|
+
used.add(d11.id);
|
|
48730
|
+
return { ...f, id: d11.id };
|
|
48731
|
+
});
|
|
48732
|
+
}
|
|
48733
|
+
return out;
|
|
48734
|
+
}
|
|
48735
|
+
function withStyleOutputs(entry) {
|
|
48736
|
+
const decl = STYLE_OUTPUTS[entry.id];
|
|
48737
|
+
if (!decl)
|
|
48738
|
+
return entry;
|
|
48739
|
+
const hidden2 = new Set(decl.hiddenPlots ?? []);
|
|
48740
|
+
const e = { ...entry };
|
|
48741
|
+
if (hidden2.size)
|
|
48742
|
+
e.plotConfig = entry.plotConfig.map((p) => hidden2.has(p.id) ? { ...p, editable: false } : p);
|
|
48743
|
+
if (decl.hlines && entry.hlineConfig) {
|
|
48744
|
+
e.hlineConfig = entry.hlineConfig.map((h) => decl.hlines[h.id] ? { ...h, ...decl.hlines[h.id] } : h);
|
|
48745
|
+
}
|
|
48746
|
+
if (decl.fills) {
|
|
48747
|
+
const own = new Map((entry.fillConfig ?? []).map((f) => [f.id, f]));
|
|
48748
|
+
const merged = (entry.fillConfig ?? []).map((f) => {
|
|
48749
|
+
const d11 = decl.fills.find((x) => x.id === f.id);
|
|
48750
|
+
return d11 ? { ...f, ...d11 } : f;
|
|
48751
|
+
});
|
|
48752
|
+
for (const d11 of decl.fills)
|
|
48753
|
+
if (!own.has(d11.id))
|
|
48754
|
+
merged.push(d11);
|
|
48755
|
+
e.fillConfig = merged;
|
|
48756
|
+
}
|
|
48757
|
+
if (decl.shapes)
|
|
48758
|
+
e.shapeConfig = decl.shapes;
|
|
48759
|
+
if (decl.markerDrawing)
|
|
48760
|
+
e.markerDrawing = decl.markerDrawing;
|
|
48761
|
+
if (decl.barColors)
|
|
48762
|
+
e.barColorConfig = decl.barColors;
|
|
48763
|
+
if (decl.candles && entry.plotCandleConfig) {
|
|
48764
|
+
e.plotCandleConfig = entry.plotCandleConfig.map((c2) => decl.candles[c2.id] ? { ...c2, ...decl.candles[c2.id], id: c2.id } : c2);
|
|
48765
|
+
}
|
|
48766
|
+
if (decl.drawings)
|
|
48767
|
+
e.drawingKinds = decl.drawings;
|
|
48768
|
+
if (decl.barColors || decl.fills) {
|
|
48769
|
+
const calculate1669 = entry.calculate;
|
|
48770
|
+
e.calculate = (...args) => stampIds(calculate1669(...args), decl);
|
|
48771
|
+
}
|
|
48772
|
+
return e;
|
|
48773
|
+
}
|
|
48774
|
+
|
|
48593
48775
|
// src/standard/aroon-oscillator.ts
|
|
48594
48776
|
var defaultInputs403 = {
|
|
48595
48777
|
length: 14
|
|
@@ -49147,10 +49329,10 @@ function calculate410(bars, inputs = {}, chart) {
|
|
|
49147
49329
|
position: "atPriceMiddle",
|
|
49148
49330
|
price: delta,
|
|
49149
49331
|
shape: "circle",
|
|
49150
|
-
|
|
49151
|
-
|
|
49152
|
-
|
|
49153
|
-
|
|
49332
|
+
char: "\u2014",
|
|
49333
|
+
color: gt18(delta, 0) ? "#4CAF50" : "#F23645",
|
|
49334
|
+
size: "tiny",
|
|
49335
|
+
id: "delta"
|
|
49154
49336
|
});
|
|
49155
49337
|
}
|
|
49156
49338
|
return {
|
|
@@ -49292,11 +49474,11 @@ function calculate412(bars, inputs = {}) {
|
|
|
49292
49474
|
}
|
|
49293
49475
|
if (isHigh) {
|
|
49294
49476
|
highPivots.push({ barIndex: i, price: bars[i].high });
|
|
49295
|
-
markers.push({ time: bars[i].time, position: "aboveBar", shape: "triangleDown", color: RESISTANCE2 });
|
|
49477
|
+
markers.push({ time: bars[i].time, position: "aboveBar", shape: "triangleDown", color: RESISTANCE2, id: "pivotHigh" });
|
|
49296
49478
|
}
|
|
49297
49479
|
if (isLow) {
|
|
49298
49480
|
lowPivots.push({ barIndex: i, price: bars[i].low });
|
|
49299
|
-
markers.push({ time: bars[i].time, position: "belowBar", shape: "triangleUp", color: SUPPORT2 });
|
|
49481
|
+
markers.push({ time: bars[i].time, position: "belowBar", shape: "triangleUp", color: SUPPORT2, id: "pivotLow" });
|
|
49300
49482
|
}
|
|
49301
49483
|
}
|
|
49302
49484
|
const lastTime = n > 0 ? bars[n - 1].time : 0;
|
|
@@ -51855,7 +52037,7 @@ function calculate429(bars, inputs = {}, chart) {
|
|
|
51855
52037
|
const v = values[i];
|
|
51856
52038
|
if (!Number.isFinite(v))
|
|
51857
52039
|
return;
|
|
51858
|
-
markers.push({ time: b.time, position: "atPriceMiddle", price: v, shape: "circle", char: p.char, color: p.color });
|
|
52040
|
+
markers.push({ time: b.time, position: "atPriceMiddle", price: v, shape: "circle", char: p.char, color: p.color, id: `pivot${p.tf}` });
|
|
51859
52041
|
});
|
|
51860
52042
|
}
|
|
51861
52043
|
return {
|
|
@@ -52002,16 +52184,16 @@ function calculate430(bars, inputs = {}) {
|
|
|
52002
52184
|
if (!Number.isFinite(v))
|
|
52003
52185
|
continue;
|
|
52004
52186
|
if (bullCond) {
|
|
52005
|
-
markers.push({ time: time15, position: "atPriceBottom", price: v, shape: "labelUp", color: BULL_COLOR5, text: " Bull ", textColor: TEXT_COLOR5 });
|
|
52187
|
+
markers.push({ time: time15, position: "atPriceBottom", price: v, shape: "labelUp", color: BULL_COLOR5, text: " Bull ", textColor: TEXT_COLOR5, id: "bullLabel" });
|
|
52006
52188
|
}
|
|
52007
52189
|
if (hiddenBullCond) {
|
|
52008
|
-
markers.push({ time: time15, position: "atPriceBottom", price: v, shape: "labelUp", color: BULL_COLOR5, text: " H Bull ", textColor: TEXT_COLOR5 });
|
|
52190
|
+
markers.push({ time: time15, position: "atPriceBottom", price: v, shape: "labelUp", color: BULL_COLOR5, text: " H Bull ", textColor: TEXT_COLOR5, id: "hiddenBullLabel" });
|
|
52009
52191
|
}
|
|
52010
52192
|
if (bearCond) {
|
|
52011
|
-
markers.push({ time: time15, position: "atPriceTop", price: v, shape: "labelDown", color: BEAR_COLOR5, text: " Bear ", textColor: TEXT_COLOR5 });
|
|
52193
|
+
markers.push({ time: time15, position: "atPriceTop", price: v, shape: "labelDown", color: BEAR_COLOR5, text: " Bear ", textColor: TEXT_COLOR5, id: "bearLabel" });
|
|
52012
52194
|
}
|
|
52013
52195
|
if (hiddenBearCond) {
|
|
52014
|
-
markers.push({ time: time15, position: "atPriceTop", price: v, shape: "labelDown", color: BEAR_COLOR5, text: " H Bear ", textColor: TEXT_COLOR5 });
|
|
52196
|
+
markers.push({ time: time15, position: "atPriceTop", price: v, shape: "labelDown", color: BEAR_COLOR5, text: " H Bear ", textColor: TEXT_COLOR5, id: "hiddenBearLabel" });
|
|
52015
52197
|
}
|
|
52016
52198
|
}
|
|
52017
52199
|
return {
|
|
@@ -325407,5 +325589,5 @@ var registryPart11 = [
|
|
|
325407
325589
|
calculate: calculate435
|
|
325408
325590
|
}
|
|
325409
325591
|
];
|
|
325410
|
-
var indicatorRegistry = [...registryPart1, ...registryPart11, ...registryPart2, ...registryPart3, ...registryPart4, ...registryPart5, ...registryPart6, ...registryPart7, ...registryPart8, ...registryPart9, ...registryPart10].map(withReferenceNames).map(withValueFormat);
|
|
325411
|
-
var version = "0.
|
|
325592
|
+
var indicatorRegistry = [...registryPart1, ...registryPart11, ...registryPart2, ...registryPart3, ...registryPart4, ...registryPart5, ...registryPart6, ...registryPart7, ...registryPart8, ...registryPart9, ...registryPart10].map(withReferenceNames).map(withValueFormat).map(withStyleOutputs);
|
|
325593
|
+
var version = "0.16.1";
|
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.1";
|
|
3384
3394
|
//# sourceMappingURL=index.d.ts.map
|