Also, when using Bid and Ask, they will only be correct for the Chart Symbol,use OrderClosePrice().
- In the presence of multiple orders (one EA multiple charts, multiple EA's, manual trading) you must count down when closing/deleting/modifying in a position loop and check OrderSelect when dealing with multiple orders. Get in the habit of always counting down. Loops and Closing or Deleting Orders - MQL4 forum What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
- You must RefreshRates after sleep and between multiple server calls.
- Using OrdersTotal directly and/or no Magic number filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.) Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 forum
WHRoeder:
- You must RefreshRates after sleep and between multiple server calls.
Just to build on this, it is worth noting OrderClosePrice() remains static from the point the order gets selected.
So even if you RefreshRates, OrderClosePrice() will not change until you select the order again. Therefore it could well be outdated if there is a delay between selecting the order and closing the order.
honest_knave: Just to build on this, it is worth noting OrderClosePrice() remains static from the point the order gets selected.
| Correct, but you must RefreshRates before selecting an order so it can be set correctly. |
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
Hi....
I am running on 5 digits account and my EA not close the orders.... Could somebody help me ?
This is my code: