// Downloaded From https://www.WiseStockTrader.com _SECTION_BEGIN("Narayan_Chouhan"); function PercentR( periods ) { return -100 * ( HHV( H, periods ) - C )/( HHV( H, periods ) - LLV( L, periods ) ); } WR=PercentR( 50); M1=MACD(12, 26); S1=Signal(12,26,9); SMA=MA(C, 20 ); PlotOHLC(O,H,L,C,"",1,64); Plot(sma,"",3,1); bcond1=wr>-80; bcond2=C>sma; bcond3=m1>s1; Buy =(bCond1 AND bCond2 AND bCond3); scond1 = wr<-20; scond2=C