PROTECTED SOURCE SCRIPT

Momentum Burst Detector

42
//version=5
indicator("Momentum Burst Detector", overlay=true)

// Inputs
length = input.int(20, title="Consolidation Length")
volMultiplier = input.float(2.0, title="Volume Spike Multiplier")
rsiThreshold = input.int(60, title="RSI Threshold")
breakoutBuffer = input.float(0.5, title="Breakout Buffer (%)")

// Calculations
highestHigh = ta.highest(high, length)
lowestLow = ta.lowest(low, length)
priceRange = highestHigh - lowestLow
breakoutLevel = highestHigh + (priceRange * breakoutBuffer / 100)
volumeAvg = ta.sma(volume, length)
rsi = ta.rsi(close, 14)

// Conditions
isBreakout = close > breakoutLevel
isVolumeSpike = volume > volumeAvg * volMultiplier
isMomentum = rsi > rsiThreshold

momentumBurst = isBreakout and isVolumeSpike and isMomentum

// Plotting
plotshape(momentumBurst, title="Momentum Burst", location=location.abovebar, color=color.orange, style=shape.triangleup, size=size.small)
bgcolor(momentumBurst ? color.new(color.orange, 85) : na)

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。