Hello guys,
I have just started learning AFL and Amibroker. Have 0 to none knowledge yet.
So decided to solve simple tasks first to practice.
I want to edit RSI indicator so that it fills areas above 70 with solid RED and areas below 30 with solid GREEN. Everything inbetween those ideally to not fill with any color, but for the time being to fill it with black is fine.
However I can't figure it out.
I've used one of the examples on the web and successfully achieved desired result for the CCI using code below:
periods = Param( "Periods", 14, 2, 200, 1 );
r = CCI (periods);
minValue = Param ("Min",-100, -200, 0, 1);
maxValue = Param ("Max",100, 0, 200, 1);
Plot( r, _DEFAULT_NAME(), ParamColor( "White", colorWhite ), ParamStyle("Style") );
PlotOHLC( r,r,0,r, "", IIf(r > 0, colorRed, colorGreen), styleCloud | styleClipMinMax, minValue, maxValue );
For the RSI I am using the following:
SetChartOptions(0,0,chartGrid30|chartGrid70);
periods = Param( "Periods", 15, 1, 200, 1 );
r = RSI (periods);
minValue = Param ("Min",30, 0, 100, 1);
maxValue = Param ("Max",70, 0, 100, 1);
Plot( r, _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
PlotOHLC( r,r,0,r, "", IIf (r < minValue, colorGreen, IIf (r > maxValue, colorRed, colorBlack)), styleCloud | styleClipMinMax, minValue, maxValue );
And as you can see it's not exactly what I am aiming for.
Could anyone please offer any advice where I should look to plot RSI similar to what I got for CCI already?
Huge thanks for your support.