Support and resistan in persantage changes required not in period

///// Chaloke.com Peak-Trough System 1.0 ///// 
 
X=1; 
Constant= 0.000; 
 
UpperO= Ref(Peak(C,X),-1); 
LowerO= Ref(Trough(C,X),-1); 
Upper= UpperO*(1 + Constant ); 
Lower= LowerO*(1 - Constant ); 
 
Buy = Cross(C, Upper);  //  i wont to  buy   on increse Lower or descrese Lower   
Sell= Cross(Lower,C);   //  i wont to  sell  on increse upper or descrese upper

 
Color=IIf(BarsSince(Buy)<BarsSince(Sell),ParamColor("Bullish",colorBrightGreen),ParamColor("Bearish",colorRed));
Plot(C,"CDC Peak & Trought V.1.005",Color,64); 
Plot(Zig(C,X),"",ParamColor("Zigzag",colorWhite),styleDashed); 
Plot(Upper,"",ParamColor("Upper",colorBlue),styleDashed); 
Plot(Lower,"",ParamColor("Lower",colorOrange),styleDashed); 
PlotShapes(shapeUpArrow*Buy,ParamColor("UpArrow",10),0,L); 
PlotShapes(shapeDownArrow*Sell,ParamColor("DownArrow",11),0,H);
 
any alternative for suport and resistant increse dicrese codes line hhv(h,period to percentage  change)

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.