Strategy tester bug Open = Close

 

Hi,

I am running the code :

  if(TotalOpenOrders() == 0 && IsNewBar())
         { 
            double C_O =  Open[0];
            double C_C =  Close[0];
            
            Print("C-A");
            Print(C_O);
            Print(C_C);
        }


and I get Open = Close all the time!


 



Any idea why ?  Open should differ from Close !

Thanks !

 
Because it's a new bar.
 
Alain Verleyen:
Because it's a new bar.

Oh **** ! Thanks Alain ! I didn't understand the whole thing like that. I thought OnTick function gave the last bar already formed. 

Thanks for the clarification. It helps a lot !


Moderator: Please mind your language on this forum. Thankyou.

Reason: