New to AFL help needed to color the bar depending on some indicator

#11
mehtaka, I am new to amibroker afl and trying hard to learn it. Could you please help me to achieve following.

My idea is to plot a up arrows ( green color ) at low price position of every bar when RSI > 70 and down arrows ( red color ) at high price position of every bar when RSI < 30.


My code is :

_SECTION_BEGIN(" My RSI of period 7");
periods = Param( "Periods", 7, 1, 200, 1 );

Bull = Cross(RSI(periods),70);
Bear = Cross(30,RSI(periods));

shape = Bull * shapeUpArrow + Bear * shapeDownArrow;
PlotShapes(shape, IIf( Bull , colorGreen, colorRed ), 0, IIf( Bull , Low, High ) );

_SECTION_END();

This code works ( when overlay to price graph ) but put a SINGLE Bull (up arrow)/Bear(down arrow) signal when RSI>70 and RSI <30 instead of putting for all bars when RSI > 70 and RSI < 30 respectively.

Please help me to correct the code.

Thanks
Sandipan

Dear sir

i think u should use this it is based on ur strategy



Uploaded with ImageShack.us

Thanks
Abhishek
 

Similar threads