Sort Positions by Profit

Created at 14 May 2015, 05:07
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
deklin's avatar

deklin

Joined 31.12.2014

Sort Positions by Profit
14 May 2015, 05:07


Is there a way to order the Positions so that when I loop through them, they are processed in order of the greatest Net Profit to the smallest Net Profit?

foreach (var position in Positions) ClosePosition(position);

 


@deklin
Replies

SwXavi
17 May 2015, 03:00

You can store the profit/losses of a list and use sort to organize it.


@SwXavi