Quote:
Originally Posted by Yannis
The Sleep() function won't do the trick cause it will suspend everything for the number of milliseconds you will use.
What you need to do is to keep the time of the order's closure (if you want this 'hibernation' to start after the order is closed) or the current time at the moment you want in a variable, add that time + (minutes of delay x 60) to a second variable and then check if current time is greater than 1st variable and less than 2nd variable then only run your SL/TP functions only and skip new orders entry code.
I think i didn't confuse you more :-)
I will be off in a while but i can send you a code snippet tomorrow if you haven't found your way with that. Just tell me how you define the time at which you want this feature to come in play (order closure or any other moment) and how long would you want to skip new orders and simply babysit eventual current orders.
Yannis
|
Thx Yannis for that quick answer!
Yeah its clear.
What i want exacly is the EA to wait at least next bar to close position by the rules and as i said still apply MM -Babysit could be an exellent option. But if the EA could wait just until nextbar before closing by the rules, that would be perfect. Not an exact time, just wait for nextbar.
That way i would avoid the EA to close position on the same bar at Stoch dips and also would be able to apply a eachtickmode instead of a ElapsedTime order managment that cause innacurate entry.
You think we could do something like that? Like if lastradebar = current bar... no trade... i'm so newb.
Your help is very welcome!