Get Aggregated Pips for a pair in positions

Created at 05 Aug 2016, 14:26
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!
CO

cousens

Joined 05.08.2016

Get Aggregated Pips for a pair in positions
05 Aug 2016, 14:26


Hello,

If I have 3 positions, GBPUSD (0.01), AUDNZD (0.01) and another GBPUSD (0.04), how can I get the aggrigated pips for GBPUSD?

Thanks,

Chris


@cousens
Replies

croucrou
05 Aug 2016, 17:35

Hi,

if noone gives you a better answer, try to:

1. find all positions by Symbol with Positions.Find,

2. measure each positions' pips by calculating difference between current price and entry price,

3. add up the pips of the all found positions for the Symbol.


@croucrou

cousens
06 Aug 2016, 13:13

RE:

Thanks croucrou but if you add them up manually, they don't = the aggregated pip total.  

I think that the lot size has something to do with it?

Thanks

croucrou said:

Hi,

if noone gives you a better answer, try to:

1. find all positions by Symbol with Positions.Find,

2. measure each positions' pips by calculating difference between current price and entry price,

3. add up the pips of the all found positions for the Symbol.

 


@cousens

croucrou
06 Aug 2016, 13:25

Your question has been about aggregating pips and not the position size, hasn't it?

If you asked about aggregated profit/loss, it's even easier to do.

Just in the 2. point, use Positon.NetProfit (or .GrossProfit) instead of the calculation.


@croucrou