How do you call a function from within a second function? Online help is not cutting it - page 2
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
Why is this code:
Not having my desired effect of only selecting the order if its OrderOpenTime() is larger than the previous one?
Because you are comparing the same ticket! You might as well be using this, because it does the same thing.
Awesome posts btw Ill sort this out hopefully so confused thx
Awesome posts btw Ill sort this out hopefully so confused thx
If you're looking for the absolute most simple implementation without any other functionality then you could try this.
If you're looking for the absolute most simple implementation without any other functionality then you could try this.
awesome this looks it!! lemme check it out, you the best help online ever
Thanks a zillion zillion zillion zillion, I finally got it down with your
Do not do this when there is any delay inside the loop (server calls, sleep etc.) Any delays and you could break out of the loop prematurely and miss other valid orders.
Loops and Closing or Deleting Orders - MQL4 and MetaTrader 4 - MQL4 programming forum
What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
Do not do this when there is any delay inside the loop (server calls, sleep etc.) Any delays and you could break out of the loop prematurely and miss other valid orders.
Those examples whroeder provided would face the same challenge if a new order arrived. If you want to totally avoid order-collision issues then don't use either of our examples and instead restart the loop if it detects a new order.
No need. The current code didn't add a new order, so no need to look at new ones.
No need. The current code didn't add a new order, so no need to look at new ones.
No, but an EA on a separate thread could have, isn't that the point you were trying to make? Otherwise calling OrderSelect outside of the loop declaration and inside of the for-block is redundant because you're checking the iterator twice, once in the for loop and once again in the OrderSelect function. What would cause OrderSelect to return false other than array out of range?