This forum is now read-only. You can discuss you questions on Forums of MQL4.community and MQL5.community

LastTradeTime


Back to topics list
avatar
44
FrankC 2005.05.27 00:19 
In mql II, to wait 5min. before opening new trades:

if CurTime - LastTradeTime < 300 Then Exit;

Any idea how to do it in MT4?

TIA.
avatar
120
hdb 2005.05.27 01:20 
this is what I do :

if (MathAbs(CurTime()-LastUpdate)> UpdateInterval*60) // we update the first time it is called and every UpdateInterval minutes
{
LastUpdate = CurTime();

... etc

LastUpdate is initialised to zero so the script is exectued a first time, then it waits UpdateInterval minutes.

Hope it helps,

Back to topics list