How to close orders in a certain order?
Loop through all your open orders and find the one with the biggest loss using OrderProfit(), same for the next, etc, etc . . . or if you have lots of orders and want to get creative use an arry to hold the profit/loss figures and ticket numbers and sort the array from biggest loss (-ve profit) to biggest profit then run through the array in order and close the orders.
Thank you. In fact I know what to do. I can not program it! So if you want to help...
Grigor:
So if you want to help...
I just did . . . I'm not about to write your code for you though, if you need that go here: Write my code for me ! !
So if you want to help...
Hi,
Can you help solve this issue:
Suppose that exist a signal to close ALL open market orders in terminal.
EA must close all orders in following order:
first close order with biggest LOSS, last order with biggest PROFIT?
Thank you.