Comparing 2 ways to delete pending order
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?
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?