PROTECTED SOURCE SCRIPT

Waheeds buy and sell signals

40
//version=6
indicator("RSI Extremes Gradient Candles", overlay=true)

rsi = ta.rsi(close, 14)

// Gradient ratios
rsiAboveRatio = math.max(math.min((rsi - 70) / 30, 1), 0)
rsiBelowRatio = math.max(math.min((30 - rsi) / 30, 1), 0)

// RGB values
redAbove = math.round(255 * rsiAboveRatio)
orangeAbove = math.round(165 * (1 - rsiAboveRatio))

redBelow = math.round(255 * rsiBelowRatio)
orangeBelow = math.round(165 * (1 - rsiBelowRatio))

// Final colors
colorAbove70 = color.rgb(247, 247, 247)
colorBelow30 = color.rgb(0, 255, 17)


// Default light blue for all other candles
defaultColor = color.rgb(0, 0, 0) // Light blue

// Assign candle color
color candleColor = na
candleColor := rsi > 70 ? colorAbove70 :
rsi < 30 ? colorBelow30 :
defaultColor

barcolor(candleColor)
// Detect RSI cross above 30
rsiCrossAbove30 = ta.crossover(rsi, 30)

// Plot arrow below candle when RSI crosses above 30
plotshape(rsiCrossAbove30,title="RSI Cross Above 30",location=location.belowbar,color=color.green,style=shape.triangleup,size=size.small)
// RSI and its MA
rsiMA = ta.sma(rsi, 14)

// Track if RSI was recently below 30
wasBelow30 = ta.lowest(rsi, 3) < 30 // You can adjust the lookback

// Crossover condition
rsiCrossAboveMA = ta.crossover(rsi, rsiMA) and wasBelow30

// RSI and its MA



// Plot green dot on RSI panel
plotshape(rsiCrossAboveMA, title="RSI Cross Above MA After <30",location=location.absolute,color=color.green,style=shape.circle,size=size.small)
rsiBelow26 = rsi < 26

plotshape(rsiBelow26,title="RSI Below 26",location=location.absolute,color=color.red,style=shape.circle,size=size.small)
plotshape(rsiBelow26,title="RSI Below 26",location=location.absolute,color=color.red,style=shape.circle,size=size.small)

// Mid-zone crossover condition
rsiMidZone = rsi > 31 and rsi < 69
rsiCrossMidZone = ta.crossover(rsi, rsiMA) and rsiMidZone

// Plot white circle on RSI panel
plotshape(rsiCrossMidZone,title="RSI Mid-Zone Crossover",location=location.absolute,color=color.white,style=shape.circle,size=size.small)

// Trend state logic
rsiSlope = rsi - rsi[1]

rsiMACrossUp = ta.crossover(rsi, rsiMA)
rsiMACrossDown = ta.crossunder(rsi, rsiMA)

// Optional volatility filter
atr = ta.atr(14)
volatilityThreshold = atr > ta.sma(atr, 14)

// Adaptive trend signal
bullTrend = rsiMACrossUp and rsiSlope > 0 and volatilityThreshold
bearTrend = rsiMACrossDown and rsiSlope < 0 and volatilityThreshold

// Plot trend state
bgcolor(bullTrend ? color.new(color.green, 85) :
bearTrend ? color.new(color.red, 85) :
na, title="Trend Background")

plotshape(bullTrend, title="Bull Trend Start", location=location.belowbar, style=shape.labelup, color=color.green, text="↑")
plotshape(bearTrend, title="Bear Trend Start", location=location.abovebar, style=shape.labeldown, color=color.red, text="↓")

rsiExtremeHigh = rsi > 75 // You can change this to 80 if preferred

plotshape( rsiExtremeHigh,title="RSI > 75 Circle",location=location.abovebar,color=color.orange,style=shape.circle,size=size.small)

isWhiteRSIAbove78 = rsi > 75
isRedBody = close < open

whiteRedCandle = isWhiteRSIAbove78 and isRedBody

plotshape(whiteRedCandle, title="White Candle with Red Body (RSI > 75)", location=location.abovebar, color=color.orange, style=shape.circle, size=size.small)

// Orange circle on white-filled, red-bodied candles (RSI > 75 and close < open)
isWhiteFill = rsi > 75 // This triggers colorAbove70


plotshape(isWhiteFill and isRedBody,title="White Candle with Red Body (RSI > 75)",location=location.abovebar,color=color.orange,style=shape.circle,size=size.small)

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.