// Downloaded From https://www.WiseStockTrader.com
AP=Param("LLV,HHV PERIOD",21,6,40,1);
ATRP=Param("ATR PERIOD",21,6,40,1);

A=LLV(C,AP);
B=HHV(C,AP);
D=A+2*ATR(ATRP);
E=B-ATR(ATRP);
F=IIf(O>Ref(D,-1),1,0);
G=IIf(C<Ref(E,-1),-1,0);
PlotOHLC(O,H,L,C,"",IIf(F==1 AND MFI(14)>50,colorGreen,IIf(G==-1,colorRed,colorTeal)),styleCandle);
PI=(H+L+C)/3;
Plot(D,"ATR RED LINE",colorRed,styleThick);
Plot(E,"ATR GREEN LINE",colorGreen,styleThick);
PlotOHLC(D,D,E,E,"",colorPink,styleCloud);

I=IIf(Cross(PI,E),1,0);
J=IIf(PI<Ref(E,-1),-1,0);
Buy=C>E  AND E>D AND MACD()>Signal() AND ADX()>Ref(EMA(ADX(),3),-1) AND PDI()>Ref(PDI(),-1);

Sell=HighestSinceBars(MACD()>Ref(MACD(),-1),C,Nth=1);



Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
PlotShapes(Buy*shapeUpArrow,colorGreen,0,yposition=L,Offset=-50);
PlotShapes(Sell*shapeDownArrow,colorRed,0,yposition=H,Offset=-50);
Title = Name() + " " + Date()+" " + EncodeColor( colorBlue ) +"***SARVANI CLOUD****" +EncodeColor( colorRed )
+ " OPEN.... " + O + "... HIGH... " + H + "... LOW... " + L + " ...CLOSE.... "+ C + "...VOLUME INC. %..." + ((V-EMA(V,7))/EMA(V,7))*100 + "\n";