//@version=5 indicator("NITRO BOTTOM 2026", overlay=false) // ===================Stochastic Momentum Indicator=====================// q = input.int(10, title="%K Length", group="======Stochastic Momentum Settings======") r = input.int(3, title="%K Smoothing Length", group="======Stochastic Momentum Settings======") s = input.int(3, title="%K Double Smoothing Length",group="======Stochastic Momentum Settings======") nsig = input.int(3, title="Signal Length", group="======Stochastic Momentum Settings======") matype = input.string("ema", title="Signal MA Type", group="======Stochastic Momentum Settings======") overbought = input.float(75, title="Overbought Level", group="======Stochastic Momentum Settings======") oversold = input.float(-75, title="Oversold Level", group="======Stochastic Momentum Settings======") trima(src, length) => ta.sma(ta.sma(src,length),length) hma(src, length) => ta.wma(2*ta.wma(src, length/2)-ta.wma(src, length), math.round(math.sqrt(length))) dema(src, length) => 2*ta.ema(src,length) - ta.ema(ta.ema(src,length),length) tema(src, length) => (3*ta.ema(src,length) - 3*ta.ema(ta.ema(src,length),length)) + ta.ema(ta.ema(ta.ema(src,length),length),length) zlema(src, length) => ta.ema(src,length) + (ta.ema(src,length) - ta.ema(ta.ema(src,length),length)) smi = 100 * ta.ema(ta.ema(close-0.5*(ta.highest(q)+ta.lowest(q)),r),s) / (0.5 * ta.ema(ta.ema(ta.highest(q)-ta.lowest(q),r),s)) sig = matype=="ema" ? ta.ema(smi,nsig) : matype=="sma" ? ta.sma(smi,nsig) : matype=="wma" ? ta.wma(smi,nsig) : matype=="trima" ? trima(smi,nsig) : matype=="hma" ? hma(smi,nsig) : matype=="dema" ? dema(smi,nsig) : matype=="tema" ? tema(smi,nsig) : matype=="zlema" ? zlema(smi,nsig) : ta.ema(smi,nsig) p_smi = plot(smi, title="Stoch - SMI", color=#FF8000, transp=0) p_sig = plot(sig, title="Stoch - Signal", color=#804000, transp=0) p_bot = hline(oversold, title="Stoch - Oversold", color=#00FF00, linestyle=hline.style_dashed) p_top = hline(overbought, title="Stoch - Overbought", color=#FF0000, linestyle=hline.style_dashed) fill(p_bot, p_top, title="Stoch - Middle Region", color=color.black, transp=85) fill(p_sig, p_smi, title="Stoch - SMI/Signal Region", color=smi>sig?color.green:color.maroon, transp=50) fill(plot(oversold,color=color.lime,editable=false,transp=100), p_smi, title="Stoch - Oversold Region", color=smioverbought?#FF000040:#FFFFFF00) // =================== RSI =====================// ma(source, length, type) => switch type "SMA" => ta.sma(source, length) "Bollinger Bands" => ta.sma(source, length) "EMA" => ta.ema(source, length) "SMMA (RMA)" => ta.rma(source, length) "WMA" => ta.wma(source, length) "VWMA" => ta.vwma(source, length) rsiLengthInput = input.int(14, minval=1, title="RSI Length", group="======RSI Settings======") rsiSourceInput = input.source(close, "Source", group="======RSI Settings======") maTypeInput = input.string("SMA", title="MA Type", options=["SMA", "Bollinger Bands", "EMA", "SMMA (RMA)", "WMA", "VWMA"], group="---RSI-MA Settings---") maLengthInput = input.int(14, title="MA Length", group="---RSI-MA Settings---") bbMultInput = input.float(2.0, minval=0.001, maxval=50, title="BB StdDev", group="---RSI-MA Settings---") up = ta.rma(math.max(ta.change(rsiSourceInput), 0), rsiLengthInput) down = ta.rma(-math.min(ta.change(rsiSourceInput), 0), rsiLengthInput) rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down)) rsiMA = ma(rsi, maLengthInput, maTypeInput) isBB = maTypeInput == "Bollinger Bands" plot(rsi, "RSI", color=#7E57C2) plot(rsiMA, "RSI-based MA", color=color.yellow) rsiUpperBand = hline(80, "RSI Upper Band", color=#787B86) hline(50, "RSI Middle Band", color=color.new(#787B86, 50)) rsiLowerBand = hline(20, "RSI Lower Band", color=#787B86) fill(rsiUpperBand, rsiLowerBand, color=color.rgb(126, 87, 194, 90), title="RSI Background Fill") bbUpperBand = plot(isBB ? rsiMA + ta.stdev(rsi, maLengthInput) * bbMultInput : na, title = "Upper Bollinger Band", color=color.green) bbLowerBand = plot(isBB ? rsiMA - ta.stdev(rsi, maLengthInput) * bbMultInput : na, title = "Lower Bollinger Band", color=color.green) fill(bbUpperBand, bbLowerBand, color= isBB ? color.new(color.green, 90) : na, title = "Bollinger Bands Background Fill") // =================== Money Flow Index =====================// length = input.int(title="MFI - Length", defval=14, minval=1, maxval=2000, group="======Money Flow Index Settings======") src = hlc3 mf = ta.mfi(src, length) plot(mf, "MF", color=#7E57C2) overbought2=hline(80, title="MFI - Overbought", color=#787B86) hline(50, "MFI - Middle Band", color=color.new(#787B86, 50)) oversold2=hline(20, title="MFI - Oversold", color=#787B86) fill(overbought2, oversold2, color=color.rgb(126, 87, 194, 90), title="MFI - Background") // =================== ADX and DI =====================// len = input(14,title="ADX - Length" ,group="====== ADX and DI Settings======") th = input(20, title="ADX - Line", group="====== ADX and DI Settings======") TrueRange = math.max(math.max(high-low, math.abs(high-nz(close[1]))), math.abs(low-nz(close[1]))) DirectionalMovementPlus = high-nz(high[1]) > nz(low[1])-low ? math.max(high-nz(high[1]), 0): 0 DirectionalMovementMinus = nz(low[1])-low > high-nz(high[1]) ? math.max(nz(low[1])-low, 0): 0 SmoothedTrueRange = 0.0 SmoothedTrueRange := nz(SmoothedTrueRange[1]) - (nz(SmoothedTrueRange[1])/len) + TrueRange SmoothedDirectionalMovementPlus = 0.0 SmoothedDirectionalMovementPlus := nz(SmoothedDirectionalMovementPlus[1]) - (nz(SmoothedDirectionalMovementPlus[1])/len) + DirectionalMovementPlus SmoothedDirectionalMovementMinus = 0.0 SmoothedDirectionalMovementMinus := nz(SmoothedDirectionalMovementMinus[1]) - (nz(SmoothedDirectionalMovementMinus[1])/len) + DirectionalMovementMinus DIPlus = SmoothedDirectionalMovementPlus / SmoothedTrueRange * 100 DIMinus = SmoothedDirectionalMovementMinus / SmoothedTrueRange * 100 DX = math.abs(DIPlus-DIMinus) / (DIPlus+DIMinus)*100 ADX = ta.sma(DX, len) plot(DIPlus, color=color.green, title="ADX - DI+") plot(DIMinus, color=color.red, title="ADX - DI-") plot(ADX, color=color.navy, title="ADX") hline(th, color=color.black) // =================== Bollinger Bands =====================// length4 = input.int(20, minval=1) src4 = input(close, title="Source", group="======Bollinger Bands Settings======") mult = input.float(2.1, minval=0.001, maxval=50, title="StdDev", group="======Bollinger Bands Settings======") basis = ta.sma(src4, length4) dev = mult * ta.stdev(src4, length4) upper = basis + dev lower = basis - dev offset = input.int(0, "Offset", minval = -500, maxval = 500, group="======Bollinger Bands Settings======") plot(basis, "Basis", color=#FF6D00, offset = offset) p1 = plot(upper, "BB Upper", color=#2962FF, offset = offset) p2 = plot(lower, "BB Lower", color=#2962FF, offset = offset) fill(p1, p2, title = "BB Background", color=color.rgb(33, 150, 243, 95)) // =================== CONDITIONS =====================// // Conditions Inputs C_Input = input.int(2, minval=1, maxval=11, title="How many conditions combined", group="Conditions", tooltip="Its important to put the amount of conditions you want in here, otherwise it will not calculate correctly. Number has to be the same as checked boxes of conditions!") // RSI 1 Bool2 = input.bool(false, "RSI TOP", group="Conditions", inline="b0") Time2 = input.timeframe("D", title="", group="Conditions", inline="b0") greater2 = input.string(defval="greater than", title="", options=["greater than", "greater than/equal to", "less than", "less than/equal to"], group="Conditions", inline="b0") Value2 = input.float(defval=80.0, title="", group="Conditions", inline="b0") // Stoch 1 Bool6 = input.bool(false, "Stochastics top", group="Conditions", inline="b4") Time6 = input.timeframe("D", title="", group="Conditions", inline="b4") greater6 = input.string(defval="greater than", title="", options=["greater than", "greater than/equal to", "less than", "less than/equal to"], group="Conditions", inline="b4") Value6 = input.float(defval=75.0, title="", group="Conditions", inline="b4") // ADX DI+ Bool8 = input.bool(true, "ADX DI PLUS", group="Conditions", inline="b6") Time8 = input.timeframe("D", title="", group="Conditions", inline="b6") greater8 = input.string(defval="less than", title="", options=["greater than", "greater than/equal to", "less than", "less than/equal to"], group="Conditions", inline="b6") Value8 = input.float(defval=11.7, title="", group="Conditions", inline="b6") // ADX DI- Bool9 = input.bool(true, "ADX DI MINUS", group="Conditions", inline="b7") Time9 = input.timeframe("D", title="", group="Conditions", inline="b7") greater9 = input.string(defval="less than", title="", options=["greater than", "greater than/equal to", "less than", "less than/equal to"], group="Conditions", inline="b7") Value9 = input.float(defval=11.7, title="", group="Conditions", inline="b7") // RSI 2 Bool3 = input.bool(true, "RSI BOTTOM", group="Conditions", inline="b1") Time3 = input.timeframe("D", title="", group="Conditions", inline="b1") greater3 = input.string(defval="less than", title="", options=["greater than", "greater than/equal to", "less than", "less than/equal to"], group="Conditions", inline="b1") Value3 = input.float(defval=20.0, title="", group="Conditions", inline="b1") //Stoch 2 Bool7 = input.bool(true, "Stochastics bOTTOM", group="Conditions", inline="b5") Time7 = input.timeframe("D", title="", group="Conditions", inline="b5") greater7 = input.string(defval="less than", title="", options=["greater than", "greater than/equal to", "less than", "less than/equal to"], group="Conditions", inline="b5") Value7 = input.float(defval=-75.0, title="", group="Conditions", inline="b5") // MFI 1 Bool4 = input.bool(false, "MFI 1", group="Conditions", inline="b2") Time4 = input.timeframe("D", title="", group="Conditions", inline="b2") greater4 = input.string(defval="greater than", title="", options=["greater than", "greater than/equal to", "less than", "less than/equal to"], group="Conditions", inline="b2") Value4 = input.float(defval=80.0, title="", group="Conditions", inline="b2") // MFI 2 Bool5 = input.bool(false, "MFI 2", group="Conditions", inline="b3") Time5 = input.timeframe("D", title="", group="Conditions", inline="b3") greater5 = input.string(defval="greater than", title="", options=["greater than", "greater than/equal to", "less than", "less than/equal to"], group="Conditions", inline="b3") Value5 = input.float(defval=80.0, title="", group="Conditions", inline="b3") // BB Condition Bool10 = input.bool(false, "", group="Conditions", inline="b8") Time10 = input.timeframe("D", title="Outside BB Bands of ", group="Conditions", inline="b8") // Stoch Cross UP Bool11 = input.bool(false, "Stoch - Fast line cross UP slow line", group="Conditions", inline="b11") Time11 = input.timeframe("D", title="of", group="Conditions", inline="b11") // Stoch Cross DOWN Bool12 = input.bool(false, "Stoch - Fast line cross DOWN slow line", group="Conditions", inline="b12") Time12 = input.timeframe("D", title="of ", group="Conditions", inline="b12") // Getting Things of indicators in "timeframe": RSI1 = request.security(syminfo.tickerid, Time2, rsi, barmerge.gaps_on, barmerge.lookahead_off) RSI2 = request.security(syminfo.tickerid, Time3, rsi, barmerge.gaps_on, barmerge.lookahead_off) MFI1 = request.security(syminfo.tickerid, Time4, mf, barmerge.gaps_on, barmerge.lookahead_off) MFI2 = request.security(syminfo.tickerid, Time5, mf, barmerge.gaps_on, barmerge.lookahead_off) Stoch1 = request.security(syminfo.tickerid, Time6, sig, barmerge.gaps_on, barmerge.lookahead_off) Stoch2 = request.security(syminfo.tickerid, Time7, sig, barmerge.gaps_on, barmerge.lookahead_off) ADXPlus = request.security(syminfo.tickerid, Time8, DIPlus, barmerge.gaps_on, barmerge.lookahead_off) ADXMin = request.security(syminfo.tickerid, Time9, DIMinus, barmerge.gaps_on, barmerge.lookahead_off) BBUp = request.security(syminfo.tickerid, Time10, upper, barmerge.gaps_on, barmerge.lookahead_off) BBDown = request.security(syminfo.tickerid, Time10, lower, barmerge.gaps_on, barmerge.lookahead_off) StochFast1 = request.security(syminfo.tickerid, Time11, sig, barmerge.gaps_on, barmerge.lookahead_off) StochSlow1 = request.security(syminfo.tickerid, Time11, smi, barmerge.gaps_on, barmerge.lookahead_off) StochFast2 = request.security(syminfo.tickerid, Time12, sig, barmerge.gaps_on, barmerge.lookahead_off) StochSlow2 = request.security(syminfo.tickerid, Time12, smi, barmerge.gaps_on, barmerge.lookahead_off) // RSI1 RSI1_1 = RSI1 > Value2 ? 1 : 0 RSI1_2 = RSI1 >= Value2 ? 1 : 0 RSI1_3 = RSI1 < Value2 ? 1 : 0 RSI1_4 = RSI1 <= Value2 ? 1 : 0 CheckRSI1_1 = Bool2 and greater2=="greater than" and RSI1_1 == 1 ? 3 : 0 // if bool true and "greater than" and RSI with timeframe, all together == 1, output 3 otherwise 0 CheckRSI1_2 = Bool2 and greater2=="greater than/equal to" and RSI1_2 == 1 ? 3 : 0 CheckRSI1_3 = Bool2 and greater2=="less than" and RSI1_3 == 1 ? 3 : 0 CheckRSI1_4 = Bool2 and greater2=="less than/equal to" and RSI1_4 == 1 ? 3 : 0 // RSI2 RSI2_1 = RSI2 > Value3 ? 1 : 0 RSI2_2 = RSI2 >= Value3 ? 1 : 0 RSI2_3 = RSI2 < Value3 ? 1 : 0 RSI2_4 = RSI2 <= Value3 ? 1 : 0 CheckRSI2_1 = Bool3 and greater3=="greater than" and RSI2_1 == 1 ? 3 : 0 CheckRSI2_2 = Bool3 and greater3=="greater than/equal to" and RSI2_2 == 1 ? 3 : 0 CheckRSI2_3 = Bool3 and greater3=="less than" and RSI2_3 == 1 ? 3 : 0 CheckRSI2_4 = Bool3 and greater3=="less than/equal to" and RSI2_4 == 1 ? 3 : 0 // MFI1 MFI1_1 = MFI1 > Value4 ? 1 : 0 MFI1_2 = MFI1 >= Value4 ? 1 : 0 MFI1_3 = MFI1 < Value4 ? 1 : 0 MFI1_4 = MFI1 <= Value4 ? 1 : 0 CheckMFI1_1 = Bool4 and greater4=="greater than" and MFI1_1 == 1 ? 3 : 0 CheckMFI1_2 = Bool4 and greater4=="greater than/equal to" and MFI1_2 == 1 ? 3 : 0 CheckMFI1_3 = Bool4 and greater4=="less than" and MFI1_3 == 1 ? 3 : 0 CheckMFI1_4 = Bool4 and greater4=="less than/equal to" and MFI1_4 == 1 ? 3 : 0 // MFI2 MFI2_1 = MFI2 > Value5 ? 1 : 0 MFI2_2 = MFI2 >= Value5 ? 1 : 0 MFI2_3 = MFI2 < Value5 ? 1 : 0 MFI2_4 = MFI2 <= Value5 ? 1 : 0 CheckMFI2_1 = Bool5 and greater5=="greater than" and MFI2_1 == 1 ? 3 : 0 CheckMFI2_2 = Bool5 and greater5=="greater than/equal to" and MFI2_2 == 1 ? 3 : 0 CheckMFI2_3 = Bool5 and greater5=="less than" and MFI2_3 == 1 ? 3 : 0 CheckMFI2_4 = Bool5 and greater5=="less than/equal to" and MFI2_4 == 1 ? 3 : 0 // Stoch1 Stoch1_1 = Stoch1 > Value6 ? 1 : 0 Stoch1_2 = Stoch1 >= Value6 ? 1 : 0 Stoch1_3 = Stoch1 < Value6 ? 1 : 0 Stoch1_4 = Stoch1 <= Value6 ? 1 : 0 CheckStoch1_1 = Bool6 and greater6=="greater than" and Stoch1_1 == 1 ? 3 : 0 CheckStoch1_2 = Bool6 and greater6=="greater than/equal to" and Stoch1_2 == 1 ? 3 : 0 CheckStoch1_3 = Bool6 and greater6=="less than" and Stoch1_3 == 1 ? 3 : 0 CheckStoch1_4 = Bool6 and greater6=="less than/equal to" and Stoch1_4 == 1 ? 3 : 0 // Stoch2 Stoch2_1 = Stoch2 > Value7 ? 1 : 0 Stoch2_2 = Stoch2 >= Value7 ? 1 : 0 Stoch2_3 = Stoch2 < Value7 ? 1 : 0 Stoch2_4 = Stoch2 <= Value7 ? 1 : 0 CheckStoch2_1 = Bool7 and greater7=="greater than" and Stoch2_1 == 1 ? 3 : 0 CheckStoch2_2 = Bool7 and greater7=="greater than/equal to" and Stoch2_2 == 1 ? 3 : 0 CheckStoch2_3 = Bool7 and greater7=="less than" and Stoch2_3 == 1 ? 3 : 0 CheckStoch2_4 = Bool7 and greater7=="less than/equal to" and Stoch2_4 == 1 ? 3 : 0 // ADX + ADXP_1 = ADXPlus > Value8 ? 1 : 0 ADXP_2 = ADXPlus >= Value8 ? 1 : 0 ADXP_3 = ADXPlus < Value8 ? 1 : 0 ADXP_4 = ADXPlus <= Value8 ? 1 : 0 CheckADXP_1 = Bool8 and greater8=="greater than" and ADXP_1 == 1 ? 3 : 0 CheckADXP_2 = Bool8 and greater8=="greater than/equal to" and ADXP_2 == 1 ? 3 : 0 CheckADXP_3 = Bool8 and greater8=="less than" and ADXP_3 == 1 ? 3 : 0 CheckADXP_4 = Bool8 and greater8=="less than/equal to" and ADXP_4 == 1 ? 3 : 0 // ADX - ADXM_1 = ADXMin > Value9 ? 1 : 0 ADXM_2 = ADXMin >= Value9 ? 1 : 0 ADXM_3 = ADXMin < Value9 ? 1 : 0 ADXM_4 = ADXMin <= Value9 ? 1 : 0 CheckADXM_1 = Bool9 and greater9=="greater than" and ADXM_1 == 1 ? 3 : 0 CheckADXM_2 = Bool9 and greater9=="greater than/equal to" and ADXM_2 == 1 ? 3 : 0 CheckADXM_3 = Bool9 and greater9=="less than" and ADXM_3 == 1 ? 3 : 0 CheckADXM_4 = Bool9 and greater9=="less than/equal to" and ADXM_4 == 1 ? 3 : 0 // BB Check CheckBBOutside = Bool10 and (close > BBUp or close < BBDown) ? 3 : 0 // Stoch Crosses CheckCrossUPFast = Bool11 and (ta.crossover (StochFast1, StochSlow1)) ? 3 : 0 CheckCrossDownFast = Bool12 and (ta.crossunder(StochFast2, StochSlow2)) ? 3 : 0 // Conditions then: ConditionRSI1 = (CheckRSI1_1 ==3 or CheckRSI1_2 ==3 or CheckRSI1_3 ==3 or CheckRSI1_4 ==3) ? 4 : 0 // If RSI1 true and condition of it too then output 4 otherwise 0 ConditionRSI2 = (CheckRSI2_1 ==3 or CheckRSI2_2 ==3 or CheckRSI2_3 ==3 or CheckRSI2_4 ==3) ? 4 : 0 ConditionMFI1 = (CheckMFI1_1 ==3 or CheckMFI1_2 ==3 or CheckMFI1_3 ==3 or CheckMFI1_4 ==3) ? 4 : 0 ConditionMFI2 = (CheckMFI2_1 ==3 or CheckMFI2_2 ==3 or CheckMFI2_3 ==3 or CheckMFI2_4 ==3) ? 4 : 0 ConditionStoch1 = (CheckStoch1_1 ==3 or CheckStoch1_2 ==3 or CheckStoch1_3 ==3 or CheckStoch1_4 ==3) ? 4 : 0 ConditionStoch2 = (CheckStoch2_1 ==3 or CheckStoch2_2 ==3 or CheckStoch2_3 ==3 or CheckStoch2_4 ==3) ? 4 : 0 ConditionAPXP1 = (CheckADXP_1 ==3 or CheckADXP_2 ==3 or CheckADXP_3 ==3 or CheckADXP_4 ==3) ? 4 : 0 ConditionAPXM2 = (CheckADXM_1 ==3 or CheckADXM_2 ==3 or CheckADXM_3 ==3 or CheckADXM_4 ==3) ? 4 : 0 ConditionBBOutside = CheckBBOutside ==3 ? 4 : 0 ConditionCrossUP = CheckCrossUPFast ==3 ? 4 : 0 ConditionCrossDown = CheckCrossDownFast==3 ? 4 : 0 // Final Calculation c01= ConditionRSI1 + ConditionRSI2+ ConditionMFI1 + ConditionMFI2 + ConditionStoch1 + ConditionStoch2 + ConditionAPXP1 + ConditionAPXM2 + ConditionBBOutside + ConditionCrossUP + ConditionCrossDown c02 = (c01 / (4*C_Input)) == 1 ? 7 : 0 // c01 calculates every condition met is 4 and adds all the 4s together. this divided by input number times 4 needs to be equal to 1 and then output is 7 to alarm alertcondition(c02==7, title="New Setup", message="New Setup detected") plotshape(c02==7, title="New Alert", style=shape.circle, location=location.bottom, color=color.green, size=size.small)