Parameter stopLossPips and takeProfitPips in PendingOrder

Created at 01 Jan 2025, 02:57
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!
BA

baolinhhk9

Joined 23.11.2022

Parameter stopLossPips and takeProfitPips in PendingOrder
01 Jan 2025, 02:57


I got a warning :

Is this mean I has to change my code from takeProfitPips to takeProfit and stopLossPips to stopLoss?

But in this link https://help.ctrader.com/ctrader-algo/references/General/Robot/?h=placestoporder#placestoporder-21 , Ctrader also indicates that I has to use takeProfitPips and stopLossPips?

So what should I do?

Can I continue to use stopLossPips and takeProfitPips? Cbot that use stopLossPips and takeProfitPips will be wrong?


@baolinhhk9
Replies

protraderde
03 Jan 2025, 13:58

+1


@panagiotis ?


@protraderde

PanagiotisCharalampous
03 Jan 2025, 14:37

Hi all,

You just need to use the new parameter called protectionType and set explicitly what the protection type is.

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType)

Best regards,

Panagiotis


@PanagiotisCharalampous

baolinhhk9
03 Jan 2025, 15:38

RE: Parameter stopLossPips and takeProfitPips in PendingOrder

PanagiotisCharalampous said: 

Hi all,

You just need to use the new parameter called protectionType and set explicitly what the protection type is.

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType)

Best regards,

Panagiotis

really dont understand what you say. I find that Ctrader update the new Parameter. But please answer my old questions. Is my Cbot (clound cbot which is now running) has to be change? If I dont change the the old code, logic will be wrong? 

New signature made me had a lot of things to do. Older code is optimized and I have to do it one more time which my new signature. 


@baolinhhk9

baolinhhk9
03 Jan 2025, 15:43 ( Updated at: 05 Jan 2025, 10:30 )

RE: Parameter stopLossPips and takeProfitPips in PendingOrder

.


@baolinhhk9