Check out this code: Close All FIFO
So basically, they store the tickets in an array, and sort via time?
So every position I open, i should append the corresponding ticket to an array?
So I should just close the ticket corresponding with the first index in the array? And then once closed, remove it from the array?

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
I am running a long-only strategy that opens multiple long trades, and then sells them off one by one. The first position it sells should correspond with the ticket of the first position it had opened.
I have been browsing the forums for literally hours on end, as well as documentation, but have been unable to get it to work (Tried mostly with CTrade functions).
Can anyone point me in the right direction?