need afl based on price

#1
Code is based on RSI
_SECTION_BEGIN("MODIFIED RSI ");
SetChartBkColor(ParamColor("Panel color ",colorBlack));
RP = Param("RSI",14,2,20,1);
UL= Param("Upper Limit",70,0,100,1);
LL= Param("Lower Limit",30,0,100,1);
PlotGrid(UL,colorBlue);
PlotGrid(LL,colorBlue);
R= RSIa(C, RP);
Plot(R, "MODIFIED RSI", colorLime, styleThick);
MaxGraph=10;
Period1=Param("Period 1", 10, 5, 50, 1);
Period2=Param("Period 2", 10, 5, 50, 1);
EMA1= EMA(R,Period1);
EMA2= EMA(EMA1,Period2);
Overbought=70;
Oversold=30;
Plot(Overbought,"Overbought Zone",colorBlue);
Plot(Oversold,"Oversold Zone",colorGreen);

MaxGraph=10;
Period1=Param("Period 1", 10, 5, 50, 1);
Period2=Param("Period 2", 20, 5, 50, 1);
EMA1= EMA(R,Period1);
EMA2= EMA(EMA1,Period2);
Difference= EMA1 - EMA2;
ZeroLagEMA= EMA1 + Difference;
PR=abs(ZeroLagEMA);

Graph0=PR;

MoveAvg=MA(PR,8);

//Graph1=MoveAvg; //Remove the // if you want a Crossover MA to plot
//Graph1Color=colorRed;

Graph0Style=4;
upbar= PR>= MoveAvg AND PR>= Ref(PR,-1) ;
downbar=(PR < MoveAvg) OR PR>= MoveAvg AND PR< Ref(PR,-1) ;
barcolor = IIf( downbar,colorRed, IIf( upbar, colorBrightGreen, 7));
Graph0BarColor = ValueWhen( barcolor != 0, barcolor );
Graph2=20;
Graph3=80;

Graph2Style=Graph3Style=Graph4Style=1;
Graph4Color=2;
Graph2Color=5;
Graph3Color=4;
Overbought=70;
Oversold=30;
Buy =Cross(upbar,downbar) AND R>EMA1;
//Buy = Cross(R,EMA1) AND R > EMA2;
//Sell = Cross(Overbought, R) AND Cross(EMA2,R);
Sell = Cross(downbar,upbar);

PlotShapes(IIf(Sell, shapeDownArrow , shapeNone), colorRed);
PlotShapes(IIf(Buy, shapeUpArrow , shapeNone), colorGreen);

_SECTION_END();
 

Similar threads

Zerodha – Open Paperless Account

Open online account with Zerodha. Free delivery trading and Max Rs 20 for Intraday, F&O, Currency and Commodity Trading. Intraday High leverage with MIS, CO and BO.

Name:Phone:
Email:City:
State:
Are you a day trader?