Its not going to sleep forever. Theres allot of different ways to limit orders to just one. Sleep isn't one of them.
Its not going to sleep forever. Theres allot of different ways to limit orders to just one. Sleep isn't one of them.
Hi ubzen,
I only want to open a pending order when Minute()==57 and then I place a Sleep()=180000 so it had to open only one order and sleep for 3 minutes. The 3 minutes later it is not Minute()==57 and it should wait for the next hour and Minute()==57.
Is there another possible way to place only one pending order per hour?
Kind regards
Hi ubzen,
I only want to open a pending order when Minute()==57 and then I place a Sleep()=180000 so it had to open only one order and sleep for 3 minutes. The 3 minutes later it is not Minute()==57 and it should wait for the next hour and Minute()==57.
Is there another possible way to place only one pending order per hour?
Kind regards
How about if( Minute() != 57 ) return from start?
IMO, If someone do-not have intro to programming learned then you're wisting your time. I'm not a big fan of learning by guessing. Try reading the book.
Hi guys,
I´m very frustrated because my Sleep-function doesn´t work. Everytime my system open a pending order, and I only wnat to open one order, it opened more than one order.
Why does the Sleep-function not work?
Diificult to tell without indentation of the braces, but as far as I can tell, return(0) comes before Sleep().
So you exit the start function without calling sleep, so the code will run again at the next tick.
Play videoPlease edit your post.
For large amounts of code, attach it.
- Compile your code. Your sleep is outside of start so what you posted will NOT compile
- What are Function return values ? How do I use them ? - MQL4 forum

- 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 guys,
I´m very frustrated because my Sleep-function doesn´t work. Everytime my system open a pending order, and I only wnat to open one order, it opened more than one order.
Why does the Sleep-function not work?