how to get opened positions StopLoss money?
Created at 04 Sep 2020, 07:22
TR
how to get opened positions StopLoss money?
04 Sep 2020, 07:22
hi there
i want get and count all opened positions [StopLoss money] , but i don't know how to do
i want get this value of all opened positions (eg $216.66)
any one have ides?
thank you very much
Replies
trander002
04 Sep 2020, 11:46
RE:
PanagiotisCharalampous said:
Hi trander002,
Here is an example
var totalSL = 0.0; foreach (var position in Positions) { var slAmount = (position.EntryPrice - position.StopLoss) * (Symbol.PipValue / Symbol.PipSize) * position.VolumeInUnits - (position.Commissions * 2); Print("Position ID: " + position.Id + " Stop Loss Amount: " + (-Math.Round((double)slAmount,2))); totalSL += (double)slAmount; } Print("Total SL " + (-Math.Round(totalSL, 2)));
Best Regards,
Panagiotis
thank you very much, it can work
@trander002
PanagiotisCharalampous
04 Sep 2020, 08:42
Hi trander002,
Here is an example
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous