OPEN-SOURCE SCRIPT

Altcoin Breakout Detector

164
//version=5
indicator("Altcoin Breakout Detector", overlay=true)
resistanceLevel = input.float(50.0, "Resistance Level", minval=0.0, maxval=100.0)
breakoutZoneTop = input.float(25.0, "Breakout Zone Top", minval=0.0, maxval=100.0)
shortMA = ta.sma(close, 5) // 5-period moving average for trend confirmation

// Define buy signal conditions
lastPrice = close
secondLastPrice = close[1]
lastVolume = volume
avgVolume = ta.sma(volume, 20) // 20-period simple moving average of volume
buySignal = lastPrice > resistanceLevel and secondLastPrice <= resistanceLevel and lastVolume > avgVolume * 1.5 and lastPrice > shortMA

// Plot buy signal
plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)

// Highlight breakout zone
hline(breakoutZoneTop, "Breakout Zone", color=color.orange, linestyle=hline.style_dashed)
bgcolor(color.new(color.orange, 90)) // Constant shading for the breakout zone (0 to 25.00)

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.