View Single Post
  #5 (permalink)  
Old 11-07-2006, 08:37 PM
Mr.Marketz Mr.Marketz is offline
Senior Member
 
Join Date: Feb 2006
Posts: 234
Mr.Marketz is on a distinguished road
Quote:
Originally Posted by Michel
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
Thanks Michel,

I might have to leave this one to the pros.

MM
Reply With Quote