//@version=6 indicator('CROCOBOT FULL FINAL v7 (NO REPAINT)', overlay=true, max_labels_count=500, max_lines_count=500) // ===================== INPUTS ===================== atrPeriod1 = input.int(14, 'ATR Period 1') atrMult1 = input.float(2, 'ATR Mult 1', step=0.1) atrPeriod2 = input.int(10, 'ATR Period 2') atrMult2 = input.float(3, 'ATR Mult 2', step=0.1) atrPeriod3 = input.int(26, 'ATR Period 3') atrMult3 = input.float(9, 'ATR Mult 3', step=0.1) atrPeriod4 = input.int(22, 'ATR Period 4') atrMult4 = input.float(5, 'ATR Mult 4', step=0.1) cciLen1 = input.int(5, 'CCI Len 1') cciLen2 = input.int(20, 'CCI Len 2') bb1_len = input.int(20, 'BB1 Length') bb1_std = input.float(2.0, 'BB1 StdDev', step=0.1) bb2_len = input.int(50, 'BB2 Length') bb2_std = input.float(2.5, 'BB2 StdDev', step=0.1) enableElliottOverlay = input.bool(true, 'Show Wave 3/C') enableElliottWaves = input.bool(true, 'Elliott Wave Count') useDynamicWaveCount = input.bool(true, 'Dynamic Wave Count') manualWaveCount = input.int(5, 'Manual Max Wave Count', minval=1) iBarsBack = input.int(2, 'Bars Back', minval=1) macdFast = input.int(40, 'MACD Fast Length') macdSlow = input.int(144, 'MACD Slow Length') macdSig = input.int(9, 'MACD Signal Length') // show fibonacci levels showFibLevels = input.bool(false, 'Show Fibonacci Levels', group='Fibonacci') // alert toggles alertEntry = input.bool(true, 'Alert: Entry Signals', group='Alerts') alertTransition = input.bool(true, 'Alert: Transition', group='Alerts') alertMeta = input.bool(true, 'Alert: Meta Cluster', group='Alerts') alertElliott = input.bool(true, 'Alert: Elliott Waves', group='Alerts') alertMACDSlope = input.bool(true, 'Alert: MACD/Slope Signals', group='Alerts') alertD = input.bool(true, 'Alert: D+ Signal', group='Alerts') alertDashboard = input.bool(true, 'Alert: Dashboard Aligned', group='Alerts') alertStrong = input.bool(true, 'Alert: Signal Strength ≥ 80', group='Alerts') // ===================== BASE CALCULATIONS ===================== src = (high + close + open) / 3.0 stochK = ta.stoch(close, close, close, 14) rsiVal = ta.rsi(close, 14) cci5 = ta.cci(close, cciLen1) cci20 = ta.cci(close, cciLen2) atr1 = ta.atr(atrPeriod1) atr2 = ta.atr(atrPeriod2) atr3 = ta.atr(atrPeriod3) atr4 = ta.atr(atrPeriod4) // --- Helper function for ATR trailing stops (CORRECTED) --- f_atrTrail(src, prevStop, atr, mult) => loss = mult * atr // single-line ternary, or wrap in parentheses (src > prevStop ? math.max(prevStop, src - loss) : src < prevStop ? math.min(prevStop, src + loss) : prevStop) // --- Main ATR stops (non-repainting) --- var float atrStop1 = close[1] - atrMult1*atr1[1] var float atrStop2 = close[1] - atrMult2*atr2[1] var float atrStop3 = close[1] - atrMult3*atr3[1] var float atrStop4 = close[1] - atrMult4*atr4[1] atrStop1 := f_atrTrail(close[1], nz(atrStop1[1]), atr1, atrMult1) atrStop2 := f_atrTrail(close[1], nz(atrStop2[1]), atr2, atrMult2) atrStop3 := f_atrTrail(close[1], nz(atrStop3[1]), atr3, atrMult3) atrStop4 := f_atrTrail(close[1], nz(atrStop4[1]), atr4, atrMult4) bullCandle = close[1] > atrStop1[1] bearCandle = close[1] <= atrStop1[1] barcolor(bullCandle ? color.lime : bearCandle ? color.red : na) plot(atrStop1, 'ATR1', color.white, 2) plot(atrStop2, 'ATR2', color.black, 2) plot(atrStop3, 'ATR3', color.red, 2) plot(atrStop4, 'ATR4', color.rgb(0,255,21,69), 2) // ===================== MOVING AVERAGES & BOLLINGER BANDS ===================== sma20 = ta.sma(close, 20) sma40 = ta.sma(close, 40) ema40 = ta.ema(close, 40) ema144 = ta.ema(close, 144) bb1_basis = ta.sma(close, bb1_len) bb1_upper = bb1_basis + bb1_std * ta.stdev(close, bb1_len) bb1_lower = bb1_basis - bb1_std * ta.stdev(close, bb1_len) bb2_basis = ta.sma(close, bb2_len) bb2_upper = bb2_basis + bb2_std * ta.stdev(close, bb2_len) bb2_lower = bb2_basis - bb2_std * ta.stdev(close, bb2_len) p1u = plot(bb1_upper, 'BB1 Upper', color.orange, 1) p1l = plot(bb1_lower, 'BB1 Lower', color.orange, 1) fill(p1u, p1l, color.new(color.orange,85)) p2u = plot(bb2_upper, 'BB2 Upper', color.purple, 1) p2l = plot(bb2_lower, 'BB2 Lower', color.purple, 1) fill(p2u, p2l, color.new(color.purple,85)) plot(bb1_basis, 'BB1 Basis', color.orange) plot(bb2_basis, 'BB2 Basis', color.purple) plot(sma20, 'SMA20', color.blue, 2) plot(sma40, 'SMA40', color.green, 2) plot(ema40, 'EMA40', color.red, 2) plot(ema144, 'EMA144', color.fuchsia, 2) // ===================== CROSSES ===================== crossATR1 = ta.crossover(close[1], atrStop1[1]) crossATR2 = ta.crossover(close[1], atrStop2[1]) crossATR3 = ta.crossover(close[1], atrStop3[1]) crossATR4 = ta.crossover(close[1], atrStop4[1]) crossATR1_any = ta.cross(close[1], atrStop1[1]) crossATR2_any = ta.cross(close[1], atrStop2[1]) crossATR3_any = ta.cross(close[1], atrStop3[1]) crossATR4_any = ta.cross(close[1], atrStop4[1]) // ===================== OVERSOLD TRANSITION ===================== stochPrev2 = stochK[2] <= 20 stochNow2 = stochK[1] > 20 rsiPrev2 = rsiVal[2] <= 30 rsiNow2 = rsiVal[1] > 30 cci5Prev2 = cci5[2] <= -100 or cci5[2] >= 100 cci5Now2 = cci5[1] > -100 and cci5[1] < 100 cci20Prev2 = cci20[2] <= -100 or cci20[2] >= 100 cci20Now2 = cci20[1] > -100 and cci20[1] < 100 transition_strict = stochPrev2 and rsiPrev2 and (cci20Prev2 or cci5Prev2) and stochNow2 and rsiNow2 and (cci20Now2 or cci5Now2) and (crossATR2 or crossATR1 or crossATR3 or crossATR4) transition6_strict = stochPrev2 and rsiPrev2 and stochNow2 and rsiNow2 and (cci20Prev2 or cci5Prev2) and (cci20Now2 or cci5Now2) v_strict = transition6_strict and transition_strict plotshape(barstate.isconfirmed and transition_strict, title='Transition', location=location.abovebar, color=color.black, style=shape.labelup, text='U-TURN', textcolor=color.red) plotshape(barstate.isconfirmed and transition6_strict, title='Transition6', location=location.abovebar, color=color.green, style=shape.triangleup, size=size.small) alertcondition(barstate.isconfirmed and alertTransition and (transition_strict or transition6_strict), 'Oversold Recovery', 'Transition signal') // ===================== ENTRY SIGNALS ===================== trendUp = sma20[1] > sma40[1] cciExhausted = (cci5[1] <= -100 or cci20[1] <= -100) or (cci5[1] >= 100 or cci20[1] >= 100) priceCrossed = open[1] > sma20[1] or open[1] < sma40[1] closedAboveSlow = close[1] >= sma40[1] and (crossATR1_any or crossATR2_any) closedAboveSlow2 = close[1] >= sma40[1] and (crossATR4_any or crossATR3_any) entrySignal1 = trendUp and cciExhausted and priceCrossed and closedAboveSlow and (atrStop1 > atrStop2) and (atrStop2 > atrStop3) entrySignal2 = trendUp and cciExhausted and priceCrossed and closedAboveSlow2 bgcolor(barstate.isconfirmed and (entrySignal1 or entrySignal2) ? color.rgb(0,255,127,15) : na) alertcondition(barstate.isconfirmed and alertEntry and (entrySignal1 or entrySignal2), 'Entry Signal', 'Entry signal triggered') // ===================== FRACTALS ===================== fractalLength = 2 bullishFractal = low[fractalLength] > low[fractalLength+1] and low[fractalLength] > low[fractalLength-1] bearishFractal = high[fractalLength] < high[fractalLength+1] and high[fractalLength] < high[fractalLength-1] var float anchorHigh = na var float anchorLow = na anchorHigh := bearishFractal ? high[fractalLength] : anchorHigh anchorLow := bullishFractal ? low[fractalLength] : anchorLow crossoverAnchorLow = ta.crossover(close[1], anchorLow) crossunderAnchorHigh = ta.crossunder(close[1], anchorHigh) plot(anchorHigh, 'Fractal High', color.red, 1, plot.style_circles) plot(anchorLow, 'Fractal Low', color.green, 1, plot.style_circles) longSignal = not na(anchorLow) and crossoverAnchorLow shortSignal = not na(anchorHigh) and crossunderAnchorHigh // ===================== FIBONACCI ZONES ===================== bullishSignal = (entrySignal1 or entrySignal2 or transition_strict or transition6_strict) and barstate.isconfirmed var float signalCandleHigh = na signalCandleHigh := bullishSignal ? high[1] : signalCandleHigh[1] crossunderSignalLow = ta.crossunder(close[1], signalCandleHigh) useStopAsFib0 = bullishSignal and atrStop2 < signalCandleHigh revFibStart = useStopAsFib0 ? atrStop2 : signalCandleHigh revFibEnd = useStopAsFib0 ? signalCandleHigh : atrStop2 revFib786 = revFibStart + (revFibEnd - revFibStart) * 0.786 revFib618 = revFibStart + (revFibEnd - revFibStart) * 0.618 revFib50 = revFibStart + (revFibEnd - revFibStart) * 0.5 revFib382 = revFibStart + (revFibEnd - revFibStart) * 0.382 revFib236 = revFibStart + (revFibEnd - revFibStart) * 0.236 extFibStart = atrStop2 extFibEnd = high[1] extFib1618 = extFibEnd + (extFibEnd - extFibStart) * 0.618 extFib2618 = extFibEnd + (extFibEnd - extFibStart) * 1.618 extFib3618 = extFibEnd + (extFibEnd - extFibStart) * 2.618 extFib4236 = extFibEnd + (extFibEnd - extFibStart) * 3.236 useFractalFib = bullishSignal and not na(anchorLow) and anchorLow < signalCandleHigh fractFibStart = useFractalFib ? anchorLow : na fractFibEnd = useFractalFib ? signalCandleHigh : na fractFib786 = fractFibStart + (fractFibEnd - fractFibStart) * 0.786 fractFib618 = fractFibStart + (fractFibEnd - fractFibStart) * 0.618 fractFib50 = fractFibStart + (fractFibEnd - fractFibStart) * 0.5 var float fibStart = 0.0, var float fibEnd = 0.0 fibStart := bullishSignal ? atrStop2 : fibStart[1] fibEnd := bullishSignal ? close[1] : fibEnd[1] fib618 = fibEnd - (fibEnd - fibStart) * 0.618 fib786 = fibEnd - (fibEnd - fibStart) * 0.786 // --- Optional drawing of the main Fibonacci retracement levels --- if showFibLevels and bullishSignal line.new(bar_index[1], fib618, bar_index, fib618, color=color.green, width=1, style=line.style_dashed) line.new(bar_index[1], fib786, bar_index, fib786, color=color.red, width=1, style=line.style_dashed) label.new(bar_index[1], fib618, '0.618', style=label.style_none, textcolor=color.green, size=size.small) label.new(bar_index[1], fib786, '0.786', style=label.style_none, textcolor=color.red, size=size.small) // ===================== CCI DIP DETECTION ===================== wasExhausted = cci5[2] <= -100 and cci20[2] <= -100 dipFormed = cci5[1] > -100 and cci20[1] <= -100 and wasExhausted wasntExhausted = cci5[2] >= 100 and cci20[2] >= 100 dipntFormed = cci5[1] >= 100 and cci20[1] >= 100 and wasntExhausted // ===================== METACLUSTER SCORING ===================== isEntry = entrySignal1 or entrySignal2 isTransition = transition_strict or transition6_strict isFibZone = close[1] >= fib618 and close[1] <= fib786 isAboveATR = close[1] > atrStop1[1] and close[1] > atrStop2[1] clusterScore = (isEntry ? 2 : 0) + (isTransition ? 2 : 0) + (dipFormed ? 1 : 0) + (isFibZone ? 1 : 0) + (bullishFractal ? 1 : 0) + (isAboveATR ? 1 : 0) metaSignal = clusterScore >= 4 plotshape(barstate.isconfirmed and metaSignal, title='Meta', location=location.abovebar, color=color.fuchsia, style=shape.labelup, text='META') alertcondition(barstate.isconfirmed and alertMeta and metaSignal, 'Meta Cluster', 'High conviction zone') // ===================== ADDITIONAL ATR STOPS & BREAKOUTS ===================== atr1x = 1.5 atr2x = 2.0 atr3x = 2.5 atr4x = 3.0 atr5x = 3.5 atr5 = ta.atr(7) loss1b = atr1x * atr1 loss2b = atr2x * atr2 loss3b = atr3x * atr3 loss4b = atr4x * atr4 loss5b = atr5x * atr5 var float sl1 = close - loss1b var float sl2 = close - loss2b var float sl3 = close - loss3b var float sl4 = close - loss4b var float sl5 = close - loss5b sl1 := f_atrTrail(close[1], nz(sl1[1]), atr1, atr1x) sl2 := f_atrTrail(close[1], nz(sl2[1]), atr2, atr2x) sl3 := f_atrTrail(close[1], nz(sl3[1]), atr3, atr3x) sl4 := f_atrTrail(close[1], nz(sl4[1]), atr4, atr4x) sl5 := f_atrTrail(close[1], nz(sl5[1]), atr5, atr5x) priceAboveAll = close[1] > sl1[1] and close[1] > sl2[1] and close[1] > sl3[1] and close[1] > sl4[1] and close[1] > sl5[1] priceBelowAll = close[1] < sl1[1] and close[1] < sl2[1] and close[1] < sl3[1] and close[1] < sl4[1] and close[1] < sl5[1] strongBreakout = priceAboveAll and close[1] > high[2] and close[1] > high[3] strongBreakdown = priceBelowAll and close[1] < low[2] and close[1] < low[3] plotshape(enableElliottOverlay and strongBreakout and barstate.isconfirmed, title='Wave 3 Up', location=location.belowbar, style=shape.labelup, color=color.lime, text='Wave 3', textcolor=color.black) plotshape(enableElliottOverlay and strongBreakdown and barstate.isconfirmed, title='Wave C Down', location=location.abovebar, style=shape.labeldown, color=color.red, text='Wave C', textcolor=color.white) alertcondition(barstate.isconfirmed and alertElliott and enableElliottOverlay and strongBreakout, 'Wave 3 Start', 'Breakout above all stops - possible wave 3') alertcondition(barstate.isconfirmed and alertElliott and enableElliottOverlay and strongBreakdown, 'Wave C Start', 'Breakdown below all stops - possible wave C') // ===================== ELLIOTT WAVE COUNTER ===================== var int waveUp = 0, var int waveDown = 0 newWaveUp = strongBreakout newWaveDown = strongBreakdown waveUp := newWaveUp ? (waveUp + 1 > 5 ? 1 : waveUp + 1) : waveUp waveDown := newWaveDown ? (waveDown + 1 > 5 ? 1 : waveDown + 1) : waveDown alertcondition(barstate.isconfirmed and alertElliott and enableElliottWaves and newWaveUp and waveUp == 1, 'Wave 1 Up', 'Elliott Wave 1 Up') alertcondition(barstate.isconfirmed and alertElliott and enableElliottWaves and newWaveUp and waveUp == 2, 'Wave 2 Up', 'Elliott Wave 2 Up') alertcondition(barstate.isconfirmed and alertElliott and enableElliottWaves and newWaveUp and waveUp == 3, 'Wave 3 Up', 'Elliott Wave 3 Up') alertcondition(barstate.isconfirmed and alertElliott and enableElliottWaves and newWaveUp and waveUp == 4, 'Wave 4 Up', 'Elliott Wave 4 Up') alertcondition(barstate.isconfirmed and alertElliott and enableElliottWaves and newWaveUp and waveUp == 5, 'Wave 5 Up', 'Elliott Wave 5 Up') alertcondition(barstate.isconfirmed and alertElliott and enableElliottWaves and newWaveDown and waveDown == 1, 'Wave 1 Down', 'Elliott Wave 1 Down') alertcondition(barstate.isconfirmed and alertElliott and enableElliottWaves and newWaveDown and waveDown == 2, 'Wave 2 Down', 'Elliott Wave 2 Down') alertcondition(barstate.isconfirmed and alertElliott and enableElliottWaves and newWaveDown and waveDown == 3, 'Wave 3 Down', 'Elliott Wave 3 Down') alertcondition(barstate.isconfirmed and alertElliott and enableElliottWaves and newWaveDown and waveDown == 4, 'Wave 4 Down', 'Elliott Wave 4 Down') alertcondition(barstate.isconfirmed and alertElliott and enableElliottWaves and newWaveDown and waveDown == 5, 'Wave 5 Down', 'Elliott Wave 5 Down') // ===================== FIBONACCI COUNT LABELS & D SIGNAL ===================== var int candleCount = 0 newBullishCluster = bullishSignal and not bullishSignal[1] candleCount := newBullishCluster ? 1 : na(candleCount) ? na : candleCount + 1 if barstate.isconfirmed and candleCount == 8 label.new(bar_index, high, '8', style=label.style_label_down, color=color.rgb(54,58,69,100), textcolor=color.white) if barstate.isconfirmed and candleCount == 13 label.new(bar_index, high, '13', style=label.style_label_down, color=color.rgb(54,58,69,100), textcolor=color.white) if barstate.isconfirmed and candleCount == 21 label.new(bar_index, high, '21', style=label.style_label_down, color=color.rgb(54,58,69,100), textcolor=color.white) if barstate.isconfirmed and candleCount == 34 label.new(bar_index, high, '34', style=label.style_label_down, color=color.rgb(54,58,69,100), textcolor=color.white) if barstate.isconfirmed and candleCount == 55 label.new(bar_index, high, '55', style=label.style_label_down, color=color.rgb(54,58,69,100), textcolor=color.white) if barstate.isconfirmed and candleCount == 89 label.new(bar_index, high, '89', style=label.style_label_down, color=color.rgb(54,58,69,100), textcolor=color.white) D = bullishSignal and (enableElliottOverlay or enableElliottWaves or candleCount == 8 or candleCount == 13 or candleCount == 34 or candleCount == 55 or candleCount == 89) plotshape(barstate.isconfirmed and D and newWaveUp and waveUp == 1, title='D Wave1', location=location.bottom, style=shape.labelup, color=color.new(color.white,50), text='Wave 1', textcolor=color.white) alertcondition(barstate.isconfirmed and alertD and D, 'D+ Signal', 'Combined D signal') // ===================== TREND ENVELOPE ===================== ma1 = ta.ema(close, 13) ma2 = ta.ema(close, 21) ma3 = ta.ema(close, 34) ma = ta.ema(close, 89) trueRange = ta.tr rangema = ta.ema(trueRange, 89) upper = ma + rangema * 0.5 lower = ma - rangema * 0.5 tr_up = ma1[1] > upper[1] and ma2[1] > upper[1] and ma3[1] > upper[1] tr_down = ma1[1] < lower[1] and ma2[1] < lower[1] and ma3[1] < lower[1] bgcolor(barstate.isconfirmed and tr_up ? color.new(color.green,85) : barstate.isconfirmed and tr_down ? color.new(color.red,85) : na) // ===================== MACD / SLOPE / TOUCH SIGNALS ===================== rad2degree = 180 / math.pi slopeSMA20 = ta.change(sma20, 1) slopeSMA40 = ta.change(sma40, 1) slopeSMA20Degree = rad2degree * math.atan(slopeSMA20) slopeSMA40Degree = rad2degree * math.atan(slopeSMA40) cci55 = ta.cci(close, 5) cciCondition1 = (cci5[1] <= -99 or cci5[1] >= 99) or (cci5[2] <= -99 or cci5[2] >= 99) cciCondition2 = (cci55[1] <= -99 or cci55[1] >= 99) or (cci55[2] <= -99 or cci55[2] >= 99) cciCondition22 = cciCondition1 or cciCondition2 touchConditionBottom1 = (low[1] <= sma20[1] or high[1] <= sma20[1]) or (low[2] <= sma20[2] or high[2] <= sma20[2]) touchConditionBottom2 = close[2] >= sma40[2] smaSCondition = sma20[2] >= sma40[2] slopeSMA20Condition = slopeSMA20Degree[1] > 0 slopeSMA40Condition = slopeSMA40Degree[1] > 0 bearishOverride = close[1] < sma20[1] or close[1] < sma40[1] finalResult = cciCondition22 and touchConditionBottom1 and touchConditionBottom2 and smaSCondition and slopeSMA20Condition and slopeSMA40Condition macdLine = ta.ema(close, macdFast) - ta.ema(close, macdSlow) macdSignalLine = ta.ema(macdLine, macdSig) bullFlip = ta.crossover(macdLine[1], macdSignalLine[1]) bearFlip = ta.crossunder(macdLine[1], macdSignalLine[1]) confirmedBull = finalResult and bullFlip and not bearishOverride pendingBull = finalResult and not bullFlip and not bearishOverride bearishSignal = finalResult and bearishOverride plotshape(barstate.isconfirmed and confirmedBull, title='Bull Flip', location=location.belowbar, color=color.green, style=shape.arrowup) plotshape(barstate.isconfirmed and pendingBull, title='Pending Signal', location=location.belowbar, color=color.gray, style=shape.labeldown, text='P') plotshape(barstate.isconfirmed and bearishSignal, title='Bearish Signal', location=location.abovebar, color=color.red, style=shape.labeldown, text='S') alertcondition(barstate.isconfirmed and alertMACDSlope and confirmedBull, 'Confirmed Bull Flip', 'Confirmed bull flip with slope/CCI etc.') alertcondition(barstate.isconfirmed and alertMACDSlope and pendingBull, 'Pending Bull Signal', 'FinalResult without flip') // ===================== DYNAMIC WAVE COUNT & CONFIDENCE ===================== confidence = (isEntry and bullishFractal) ? 100 : (isEntry or isTransition) ? 80 : (dipFormed or isFibZone) ? 60 : isAboveATR ? 50 : 30 dynamicWaveCount = clusterScore >= 7 and confidence >= 90 ? 3 : clusterScore >= 5 ? 5 : clusterScore >= 3 ? 2 : clusterScore >= 1 ? 4 : 1 maxWaveCount = useDynamicWaveCount ? dynamicWaveCount : manualWaveCount waveStart = waveUp == 1 or waveDown == 1 waveMid = waveUp == math.floor(maxWaveCount / 2) or waveDown == math.floor(maxWaveCount / 2) waveEnd = waveUp == maxWaveCount or waveDown == maxWaveCount slBreachMetaSignal = crossunderSignalLow and metaSignal // ===================== SIGNAL STRENGTH ===================== highlightSignal = (longSignal or shortSignal) and (isEntry or isTransition) entryModerate = isEntry entryStrong = isEntry and isTransition and isAboveATR metaFractal = bullishFractal and clusterScore >= 4 transitionFiltered= isTransition and isAboveATR and isFibZone signalStrength = ( confirmedBull ? 90 : entryStrong ? 85 : metaFractal ? 80 : v_strict ? 75 : transitionFiltered ? 70 : highlightSignal ? 65 : longSignal or shortSignal ? 60 : entryModerate ? 55 : pendingBull ? 50 : dipFormed and isAboveATR ? 45 : waveStart ? 40 : waveMid ? 35 : waveEnd ? 30 : bearishSignal ? 25 : slBreachMetaSignal ? 20 : 0 ) plot(signalStrength, 'Signal Strength', color.new(color.teal,0), 2, plot.style_line, display=display.none) bgcolor(barstate.isconfirmed and signalStrength >= 80 ? color.new(color.green,85) : barstate.isconfirmed and signalStrength >= 60 ? color.new(color.orange,85) : barstate.isconfirmed and signalStrength >= 40 ? color.new(color.red,85) : na, title='Strength Heatmap', display=display.none) // ===================== DASHBOARD TABLE ===================== rsiOversold = rsiVal[1] <= 30 rsiOverbought = rsiVal[1] >= 70 stochOversold = stochK[1]*100 <= 20 stochOverbought = stochK[1]*100 >= 80 cciOversold = cci5[1] <= -100 and cci20[1] <= -100 cciOverbought = cci5[1] >= 100 and cci20[1] >= 100 rsiStochCheck = (rsiOversold and stochOversold) or (rsiOverbought and stochOverbought) cciCheck = cciOversold or cciOverbought dashboardSignal = rsiStochCheck and cciCheck var table signalPanel = table.new(position.top_right, 1, 8, border_width=1) if barstate.isconfirmed table.cell(signalPanel, 0, 0, 'Signal Panel', text_color=color.white, bgcolor=color.gray, text_size=size.normal) table.cell(signalPanel, 0, 1, 'RSI: ' + str.tostring(math.round(nz(rsiVal[1]), 2)) + ' / Stoch: ' + str.tostring(math.round(nz(stochK[1]*100), 2)) + (rsiStochCheck ? ' OK' : ''), text_color=color.lime, bgcolor=color.black) table.cell(signalPanel, 0, 2, 'CCI5: ' + str.tostring(math.round(nz(cci5[1]), 2)) + ' CCI20: ' + str.tostring(math.round(nz(cci20[1]), 2)) + (cciCheck ? ' OK' : ''), text_color=color.orange, bgcolor=color.black) table.cell(signalPanel, 0, 3, 'Status: ' + (dashboardSignal ? 'ALL ALIGNED' : 'Waiting...'), text_color=color.white, bgcolor=color.black) actionText = signalStrength >= 90 ? 'Aggressive Entry' : signalStrength >= 80 ? 'Full Entry / Scale In' : signalStrength >= 70 ? 'Light Entry / Probe' : signalStrength >= 60 ? 'Prep Entry / Watchlist' : signalStrength >= 40 ? 'Monitor / Structure Forming' : signalStrength >= 20 ? 'Avoid / Weak Signal' : 'No Signal' strengthColor = signalStrength >= 70 ? color.green : signalStrength >= 40 ? color.rgb(63,60,100) : color.red table.cell(signalPanel, 0, 4, 'Strength: ' + str.tostring(signalStrength), text_color=color.white, bgcolor=strengthColor) table.cell(signalPanel, 0, 5, 'Action: ' + actionText, text_color=color.white, bgcolor=color.gray) table.cell(signalPanel, 0, 6, 'Confidence: ' + str.tostring(confidence) + '% | Wave: ' + str.tostring(waveUp) + '/' + str.tostring(waveDown), text_color=color.white, bgcolor=color.navy) alertcondition(barstate.isconfirmed and alertDashboard and dashboardSignal, 'Dashboard Aligned', 'RSI, Stoch, CCI aligned') alertcondition(barstate.isconfirmed and alertStrong and signalStrength >= 80, 'Strong Signal', 'Signal strength >= 80') alertcondition(barstate.isconfirmed and alertMeta and clusterScore >= 4 and signalStrength >= 70, 'Meta + Strong', 'High conviction cluster') // ===================== MASTER ALERT ===================== allAlerts = metaSignal or transition_strict or transition6_strict or entrySignal1 or entrySignal2 or highlightSignal or D or v_strict or confirmedBull or pendingBull or bearishSignal alertcondition(barstate.isconfirmed and allAlerts, 'CROCOBOT MASTER', 'Unified signal detected across CROCOBOT modules. Check dashboard.')