test: protect accepted indicator entry lifecycle #87
Annotations
2 errors and 1 warning
|
test-and-build
Process completed with exit code 1.
|
|
tests/rsi-divergence-risk-consistency.test.ts > RSI Divergence Reversal consistency > does not overwrite an active same-direction visual trade:
tests/rsi-divergence-risk-consistency.test.ts#L29
AssertionError: expected '//@Version=6\n// Generated determinis…' to contain 'if longSignal and riskDirection == 0\…'
- Expected
+ Received
- if longSignal and riskDirection == 0
+ //@Version=6
+ // Generated deterministically by PineForge Studio
+ // Review and test this script in TradingView before using it with real capital.
+ indicator("RSI Divergence Reversal", overlay=false, max_labels_count=500, max_lines_count=500)
+
+ // === Inputs ===
+ confirmedOnly = input.bool(true, "Confirmed candles only")
+ cooldownBars = input.int(5, "Signal cooldown bars", minval=0)
+ expectedChartTimeframe = input.timeframe("15", "Expected chart timeframe")
+ enforceChartTimeframe = input.bool(true, "Block signals on a different chart timeframe")
+ visualProfile = "Clean" // Selected in PineForge Studio
+ colorSignalBars = input.bool(false, "Color bars by current setup")
+ showTrendRibbon = input.bool(false, "Show trend ribbon")
+ showRiskOutcomeLabels = input.bool(true, "Show stop/target outcome labels")
+ emaFastLen = input.int(20, "Fast EMA", minval=1)
+ emaSlowLen = input.int(50, "Slow EMA", minval=1)
+ longMaLen = input.int(100, "Long MA", minval=1)
+ rsiLen = input.int(14, "RSI length", minval=2)
+ rsiLongLevel = input.float(40, "RSI long threshold")
+ rsiShortLevel = input.float(60, "RSI short threshold")
+ atrLen = input.int(14, "ATR length", minval=1)
+ atrMultiple = input.float(2, "ATR stop multiple", minval=0.1)
+ riskReward = input.float(2, "Risk/reward", minval=0.1)
+
+ // === Core calculations ===
+ emaFast = ta.ema(close, emaFastLen)
+ emaSlow = ta.ema(close, emaSlowLen)
+ longMa = ta.sma(close, longMaLen)
+ rsiValue = ta.rsi(close, rsiLen)
+ atrValue = ta.atr(atrLen)
+
+ // Entry divergence is shared with the integrated RSI pane below.
+
+ // === Integrated RSI divergence pane ===
+ // Divergence reuses the main RSI period and source.
+ divPivotLeft = input.int(5, "Divergence pivot left", minval=1)
+ divPivotRight = input.int(5, "Divergence pivot right", minval=1)
+ divRangeMinimum = input.int(5, "Divergence minimum pivot range", minval=1)
+ divRangeMaximum = input.int(60, "Divergence maximum pivot range", minval=2)
+ showRegularBullDiv = input.bool(true, "Show regular bullish divergence")
+ showHiddenBullDiv = input.bool(false, "Show hidden bullish divergence")
+ showRegularBearDiv = input.bool(true, "Show regular bearish divergence")
+ showHiddenBearDiv = input.bool(false, "Show hidden bearish divergence")
+
+ divRsi = rsiValue
+ divRegularBullColor = color.green
+ divRegularBearColor = color.red
+ divHiddenBullColor = color.new(color.green, 35)
+ divHiddenBearColor = color.new(color.red, 35)
+ divTransparentColor = color.new(color.white, 100)
+
+ plot(divRsi, "RSI divergence", linewidth=2, color=color.rgb(41, 98, 255))
+ divMiddleLine = hline(50, "RSI middle", color=color.rgb(120, 123, 134), linestyle=hline.style_dotted)
+ divOverboughtLine = hline(70, "RSI overbought", color=color.rgb(120, 123, 134), linestyle=hline.style_dotted)
+ divOversoldLine = hline(30, "RSI oversold", color=color.rgb(120, 123, 134), linestyle=hline.style_dotted)
+ fill(divOverboughtLine, divOversoldLine, color=color.rgb(33, 150, 243, 90), title="RSI divergence background")
+
+ divPivotLowFound = not na(ta.pivotlow(divRsi, divPivotLeft, divPivotRight))
+ divPivotHighFound = not na(ta.pivothigh(divRsi, divPivotLeft, divPivotRight))
+
+ divInRange(condition) =>
+ divBarsSince = ta.barssince(condition)
+ divRangeMinimum <= divBarsSince and divBarsSince <= divRangeMaximum
+
+ divPreviousLowInRange = divInRange(divPivotLowFound[1])
+ divRsiHigherLow = divRsi[divPivotRight] > ta.valuewhen(divPivotLowFound, divRsi[divPivotRight], 1) and divPreviousLowInRange
+ divPriceLowerLow = low[divPivotRight] < ta.valuewhen(divPivotLowFound, low[divPivotRight], 1)
+ divRegularBullAlert = divPriceLowerLow and divRsiHigherLow and divPivotLowFound
+ divRegularBull = showRegularBullDiv and divRegularBullAlert
+ plot(divPivotLowFound ? divRsi[divPivotRight] : na, offset=-divPivotRight, title="Regular bullish divergence", linewidth=2, color=divRegularBul
|
|
test-and-build
Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/checkout@v4, actions/setup-node@v4. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
|