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...
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,
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.