
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
No, I need to close all chart symbol orders.
Yes, with correct magicnumber.
This is a bit weird.
Yeah!
Same here! That I was thought this part of close order function so weird but it works.
Here is example
https://docs.mql4.com/series/refreshrates
Sorry please do not blame me. Still confusing.
I need to ask something, and need to do it step by step cause lack of my code knowledge.
Q1: Could I use while()?
Q2: Could I use sleep()?
Q3: Could RefreshRates() solve my issue? ( is that last thing that I solve my issue, please? )
Please, let me know about that, because I do not want to hurt my close order function.
You could use while but then you need also add a counter that breaks out of the loop after X number of tries otherwise you risk the expert to get stuck in an enless loop.
And you spak of your issue but i have no idea what is the issue.
If your issue is about the close price then you can just use,
Respectively and add the OrderType() switch for OP_BUY and OP_SELL.
And you spak of your issue but i have no idea what is the issue.
I just need to say my issue is: sometimes my Close Open Orders function left some open orders. I want to close all my open orders at once all the time.
---
2nd time edited
Could I replace all of my Bid and Ask functions to MarketInfo(), please?
What part of "You must RefreshRates after sleep and between multiple server calls if you want to use the Predefined Variables (Bid/Ask) or before OrderSelect to use OrderClosePrice() instead." was unclear?
RefreshRates() I do not understand where could I put it.
Thanks for your comments.
I just need to say my issue is: sometimes my Close Open Orders function left open open orders. I want to close all my open orders at once all the time.
---
2nd time edited
Could I replace all of my Bid and Ask functions to MarketInfo(), please?
Yes if you are handling a position that is not the chart symbol.
Thanks a lot I will replace all of them, so let's see what happen on Monday.
Have a nice weekend.