Hi all,
Great forum, I'm new to the mql4 programming, so it would be great if you could humour me a bit to start with.
I want to make sure that the last trade was closed at least 40 mins before opening the next trade (I'm using an ma crossover system and it's an attempt to cut out some of the wipsaws). I have coded the time check as below so far, but don't know if it's doable that way.
Any help would be greatly appreciated.
Cheers,
Tristan :)
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_HISTORY)==true)
{
if OrderCloseTime() - OrderOpenTime > 2400;
{
ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,0,0,NULL,0,0,Green);
}
}
phy
i see you helping out a lot around here, i will call you the forum sage.
thanks :)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
Great forum, I'm new to the mql4 programming, so it would be great if you could humour me a bit to start with.
I want to make sure that the last trade was closed at least 40 mins before opening the next trade (I'm using an ma crossover system and it's an attempt to cut out some of the wipsaws). I have coded the time check as below so far, but don't know if it's doable that way.
Any help would be greatly appreciated.
Cheers,
Tristan :)
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_HISTORY)==true)
{
if OrderCloseTime() - OrderOpenTime > 2400;
{
ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,0,0,NULL,0,0,Green);
}
}