Strategy tester bug Open = Close

To add comments, please log in or register
Lou Jo
45
Lou Jo  

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 !

Alain Verleyen
38701
Alain Verleyen  
Because it's a new bar.
Lou Jo
45
Lou Jo  
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.

To add comments, please log in or register