Luandre Ezra:
The account information is global so you cannot be sure which instance of the EA( in case multiple are running ) opened a position. So I won't use that method.
Hi,
I opened 2 pending order and after the other is filled I want to delete the other one. To do so,
1. I loop into PositionsTotal() and finding if there's an open trade,
2. loop into OrdersTotal() and delete it if there's an open position.
While I looked into the internet I found another way to do it, it compares Balance and Equity.
By doing this, if there's one pending order being filled then the balance and equity would not be equal and delete the pending order. Has anyone using this kind of way and does this has disadvantage over my way?

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 opened 2 pending order and after the other is filled I want to delete the other one. To do so,
1. I loop into PositionsTotal() and finding if there's an open trade,
2. loop into OrdersTotal() and delete it if there's an open position.
While I looked into the internet I found another way to do it, it compares Balance and Equity.
By doing this, if there's one pending order being filled then the balance and equity would not be equal and delete the pending order. Has anyone using this kind of way and does this has disadvantage over my way?