int i=HistoryTotal(); if(OrderSelect(i-1, SELECT_BY_POS, MODE_HISTORY)==true) { if(OrderProfit()<0) Sleep(900000); }
int i=HistoryTotal(); if(OrderSelect(i-1, SELECT_BY_POS, MODE_HISTORY)==true) { if(OrderProfit()<0) Sleep(900000); }
Thanks Slawa, unfortunately this didn't help.
After debugging my EA I can say for sure that the proper order is selected yet the sleep function has no effect.
Could there be a problem with the sleep function? (Maybe there is a problem with sleep() in the strategy tester?)
I'm using the AL Trade: Meta Trader 4.00 Build 193
Regarding Strategy Tester read "Testing Features and Limits in MetaTrader 4" please.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
For some reason it doesn't work.
I’ve already checked that the proper order was selected.
The script looks like this:
int i=HistoryTotal();
OrderSelect(i,SELECT_BY_TICKET);
if(OrderProfit()<0)
{
Sleep(900000);
}
If any one has experience with this function and has an idea what the problem is I’d appreciate your kind help!