Please help , I'm unable to code the following : 

Plus variable to register 1 when the close has positive change and also 
register 1 for the following unchanged close 

Minus variable to register 1 when the close has negative change and also 
register 1 for the following unchanged close 

I have tried coding the following but did not work 

PlusV=0;
PlusStay=0;

MinusV=0;
MinusStay=0;

PlusStay = IIf ( (C-Ref(C,-1) == 0 )AND  BarsSince (MinusV != Ref(MinusV,-1)) > 
BarsSince (PlusV != Ref(PlusV,-1)) , 1 , 0 ) ;

PlusV   = IIf ( C-Ref(C,-1) > 0 OR PlusStay, 1 , 0 )  ; 


MinusStay = IIf ( (C-Ref(C,-1) == 0 )AND  BarsSince (MinusV != Ref(MinusV,-1)) 
< BarsSince (PlusV != Ref(PlusV,-1)) , 1 , 0 ) ;

MinusV  = IIf ( C-Ref(C,-1) < 0 OR MinusStay, 1 , 0 )  ; 


It only register 1 when there is change in close but does not register 1 for 
the following unchanged C which I would like to register 1 following the most 
recent Plus or Minus Signals whichever may be the case.

Thank you. 

Reply via email to