Specification
I have an indicator I built for Pinescript that allows to put multiple length CCIs in one spot without any weird re-scaling done to it. I would like to convert it into MQL4 to get me off of Tradingview. I tried overlaying multiple CCIs in MT4 and they all have different scales it seems when I change the lengths. That's not quite what I'm looking to do. I'll post the code and a picture below. You'll notice in the indicator window that I have one of them as an area plot that is transparent. If this is able to be done in MT4 as well that would be good. If not, no big deal.
I would like the capability to change the lengths, colors, and line type of this indicator. As well as to add new levels to it as is already able to be done in the stock MT4 CCI.
Let me know if this is something that is feasible.
I would also like the source code for this project for my own education as well.
//@version=5
indicator(title='Commodity Channel Index', shorttitle='CCI', format=format.price, precision=2, timeframe='')
length1 = input.int(20, minval=1, title='Fast')
length2 = input.int(56, minval=1, title='Medium')
length3 = input.int(120, minval=1, title='Slow')
src1 = input(close, title='Source')
src2 = input(close, title='Source')
src3 = input(close, title='Source')
ma1 = ta.sma(src1, length1)
ma2 = ta.sma(src2, length2)
ma3 = ta.sma(src3, length3)
cci1 = (src1 - ma1) / (0.015 * ta.dev(src1, length1))
cci2 = (src2 - ma2) / (0.015 * ta.dev(src2, length2))
cci3 = (src3 - ma3) / (0.015 * ta.dev(src3, length3))
plot(cci1, 'CCI Fast', color=color.new(#ffffff, 0))
plot(cci2, 'CCI Medium', color=color.new(#000000, 0))
plot(cci3, color=color.new(#000000, 68), title='CCI Slow')
band4 = hline(200, 'Upper Band', color=#C0C0C0, linestyle=hline.style_dashed)
band3 = hline(-200, 'Upper Band', color=#C0C0C0, linestyle=hline.style_dashed)
band1 = hline(100, 'Upper Band', color=#C0C0C0, linestyle=hline.style_dashed)
band0 = hline(-100, 'Lower Band', color=#C0C0C0, linestyle=hline.style_dashed)
band5 = hline(0, 'Lower Band', color=#C0C0C0, linestyle=hline.style_solid)