How to calculate profit by SymbolName from Multiple positions

Created at 06 Sep 2022, 07:39
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!
MongolTrader's avatar

MongolTrader

Joined 12.02.2015

How to calculate profit by SymbolName from Multiple positions
06 Sep 2022, 07:39


I want to calculate profit/loss by SymbolName from Multiple positions. Please tell me how to productive code this


@MongolTrader
Replies

PanagiotisCharalampous
06 Sep 2022, 08:21

Hi MongolTrader,

See below

 Positions.Where(p => p.SymbolName == SymbolName).Sum(p => p.NetProfit);

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous