position.NetProfit question

Goulk since: 17 Nov 2022;

  24 Mar 2023, 00:27
position.NetProfit question

Hello everyone!

I have a very simple question.

I tried to make the "PRINT" of the X.NETPROFIT a specific location is I saw that alone positive results such as: +23 +52 +68 ecc... ok...

Is it possible to get negative results?  Like -12 -32 -59 ecc...

I need this because in my strategy I have conditions that are activated when the position goes also in negative.

How do I get this? can I get it to a specific position?

Thx for your time,

var NetProfit = PositionLabelID.Where(x => x.TradeType == TradeType && x.Comment == "BOOBY").Sum(x => x.NetProfit);

print(NetProfit, " PROFIT")
PanagiotisChar's avatar

PanagiotisChar since: 15 Sep 2022;

  24 Mar 2023, 08:32

Hi there,

Is it possible to get negative results?  Like -12 -32 -59 ecc...

Yes it is. If your position has negative profit then it will print negative numbers.

How do I get this? can I get it to a specific position?

All positions have a NetProfit property e.g. Positions[0].NetProfit

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

Cofounder and Chief Technologist at Aieden Technologies

Goulk since: 17 Nov 2022;

  24 Mar 2023, 09:51
RE:

PanagiotisChar said:

Hi there,

Is it possible to get negative results?  Like -12 -32 -59 ecc...

Yes it is. If your position has negative profit then it will print negative numbers.

How do I get this? can I get it to a specific position?

All positions have a NetProfit property e.g. Positions[0].NetProfit

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

Thanks, It was my coding error. :D
Thx For your time.