Sample code to Remove all stop loss

Created at 22 Feb 2022, 11:59
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!
CT

ctid1373829

Joined 19.07.2019 Blocked

Sample code to Remove all stop loss
22 Feb 2022, 11:59


Hi, 

Will be grateful if can share any sample code which can be used to "Remove all Stop Loss" in a cTrader instance by a single command / bot in the following scenario.

10 pairs / each pair has 2 to 3 open positions / each position has its individual stop loss.

Thanks


Replies

PanagiotisCharalampous
22 Feb 2022, 13:13

Hi there,

Here you go

            foreach (var position in Positions)
            {
                position.ModifyStopLossPips(null);
            }

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

ctid1373829
22 Feb 2022, 13:52

RE:

PanagiotisCharalampous said:

Hi there,

Here you go

            foreach (var position in Positions)
            {
                position.ModifyStopLossPips(null);
            }

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

Thanks!