RSI + CCI INDICATOR
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © saurabhbrokerwala

//@version=5
indicator("RSI + CCI INDICATOR", overlay = true)

//INPUT CONTROLS
L_RSI = input.int(title = "rsi", defval = 14, minval = 1, maxval = 30, step = 1 )
L_CCI = input.int(title = "CCI", defval = 20, minval = 1, maxval = 30, step = 1 )


// TRADING INDICATORS

RSI = ta.rsi(close,L_RSI) /// 14 period RSI
CCI = ta.cci((high+low+close)/3,L_CCI) // 20 period CCI


/// BUY AND SELL RULES


BUY = ta.crossover(RSI,50) and ta.crossover(CCI,+10)
SELL = ta.crossunder(RSI,49) and ta.crossunder(CCI,-10)


plotshape(BUY , title = "buy", text = "BUYSIGNAL", color = color.new(color.green,0), style = shape.triangleup, textcolor = color.white, location = location.belowbar, size = size.small)
plotshape(SELL , title = "sell", text = "SELLSIGNAL", color = color.new(color.red,0), style = shape.triangledown, textcolor = color.white, location = location.abovebar, size = size.small)




