Crypto Breakout Indicator
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © FittestTrader

//@version=5
indicator("Crypto Breakout Indicator", overlay=true)

//INPUTS
Bars = input (6)
minimum  = input.int(1, "Min Breakout %")
maximum  = input.int(20, "Max Breakout %")
Volume = input.int(10, "Min Volume Breakout %")
MovingAverage = input (200)
Consolidation  = input.int(15, "Consolidation Range")
RSIOS = input.int(75, "Maximum Allowed RSI for Entry")
RSIEntry = input.int(50, "Minimum Allowed RSI for Entry")
BBR = input.int(1, "Maximum Allowed BB% for Entry")
//INPUTS

//Calculation
highest=ta.highest(high, Bars)[1]
lowest=ta.lowest(low,Bars) [1]
diff= ((highest/lowest) - 1)*100
minbo =  highest * ((minimum/100)+1)
maxbo = highest * ((maximum/100)+1)
Vol = ((volume / volume[1]) - 1) * 100
MA = ta.ema(close,MovingAverage)
RSI=ta.rsi(close,14)

//Calculation

length = input.int(20, minval=1)
src = input(close, title="Source")
mult = input.float(2.0, minval=0.001, maxval=50, title="StdDev")
basis = ta.sma(src, length)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev
bbr = (src - lower)/(upper - lower)

Breakout = diff < Consolidation and close > minbo and close < maxbo  and Vol > Volume  and close > MA and bbr<=BBR 

plotshape(Breakout,"Breakout",shape.labelup ,location.belowbar ,#26a69a,text="B",textcolor=color.white,size=size.normal) 
alertcondition(Breakout,'Upper Breakout','Price Broke Out')

