View Single Post
  #4 (permalink)  
Old 11-03-2006, 09:29 PM
Michel Michel is offline
Senior Member
 
Join Date: Feb 2006
Posts: 513
Michel is on a distinguished road
PHP Code:
double   LastUpdate CurTime();
//----
if (MathAbs(CurTime()-LastUpdate)> UpdateInterval*60
This will never work, as at each tick you assign at lastUptade the value Curtime(), then, immediately after, you check if there is a difference between both...no.
The right way is:
PHP Code:
if(CurTime() >= LastUpdate UpdateInterval*60)
{
   
BlahBlahBlah;
   
LastUpdate CurTime();

My 2 cents : Why this time trick ? you can check all your orders every tick and close those which have reached your target !

EDIT : sorry, I didn't see it is a Script and not an EA, so there is another reason why it doesn't work : a script is executed only once : if you want to check something periodically, you have to write some loop in the code

Last edited by Michel; 11-03-2006 at 09:38 PM.
Reply With Quote