unrelised pips code pls

Created at 03 Feb 2024, 19:36
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!
AS

asad_rehman47

Joined 01.12.2023

unrelised pips code pls
03 Feb 2024, 19:36


can you please share the calgo code that calculates unrelized pips for all open trades and monitors the trades and changes in the pips to displays latest unrelised pips.

also what to display todays pips made plus running pips in open trades.

can this be displayed as widget


cTrader Automate
@asad_rehman47
Replies

firemyst
04 Feb 2024, 04:14 ( Updated at: 05 Feb 2024, 06:57 )

You've posted this in the wrong forum.

Try here: 

https://ctrader.com/forum/calgo-support

 

To do the first thing you want, just loop through all open positions, and sum up the “Pips” property of each position:

double totalPips = 0;
foreach (Position p in Positions)
	totalPips += p.Pips;

@firemyst