Gold Custom Indicator Focused On Selling Built Using Grok
Gold Custom Indicator Focused On Selling Built Using Grok
Working!
//@version=5
// Gold Sell Indicator
indicator("Gold Sell Indicator", overlay=true)
// Input parameters
rsiPeriod = input.int(14, "RSI Period", minval=1)
rsiOverbought = input.int(70, "RSI Overbought Level", minval=50, maxval=100)
bbPeriod = input.int(20, "Bollinger Period", minval=1)
bbDev = input.float(2.5, "Bollinger Deviation", minval=0.1, step=0.1)
volPeriod = input.int(20, "Volume MA Period", minval=1)
// Calculate RSI
rsi = ta.rsi(close, rsiPeriod)
// Calculate Bollinger Bands
[bbUpper, bbMiddle, bbLower] = ta.bb(close, bbPeriod, bbDev)
// Volume Moving Average
volMA = ta.sma(volume, volPeriod)
// Sell Conditions
// 1. Price touching or exceeding upper Bollinger Band
priceAtUpperBB = close >= bbUpper
// 2. RSI in overbought territory
rsiOverboughtCond = rsi >= rsiOverbought
// 3. Volume spike (volume > 2x moving average)
volumeSpike = volume > volMA * 2
// Combined sell signal
sellSignal = priceAtUpperBB and rsiOverboughtCond and volumeSpike
// Plotting
plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
// Visual aids
plot(bbUpper, "Upper BB", color=color.gray, linewidth=1)
plot(bbMiddle, "Middle BB", color=color.gray, linewidth=1)
plot(bbLower, "Lower BB", color=color.gray, linewidth=1)
// Alerts
alertcondition(sellSignal, title="Gold Sell Signal", message="Potential selling opportunity detected on Gold!")
// Additional panel for RSI
rsiPlot = hline(rsiOverbought, "Overbought", color=color.red, linestyle=hline.style_dashed)
Built using #Grok
No comments: