Parameter stopLossPips and takeProfitPips in PendingOrder
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?
Replies
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
ysftrades
07 Jan 2025, 15:13
( Updated at: 08 Jan 2025, 08:29 )
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
Hi Panagiotis,
Thank you for sharing that.
This a new parameter that is added.
I looked up the Help section to try and understand what does the ProtectionType parameter do.
I understand that they are three values to choose from; ProtectionType.None, ProtectionType.Relative and ProtectionType.Absolute
I couldn't understand what is their effect. Could you be kind enough to elaborate what do they do to an order or position?
Thank you
@ysftrades
firemyst
26 Jan 2025, 06:35
( Updated at: 14 Feb 2025, 18:19 )
RE: RE: Parameter stopLossPips and takeProfitPips in PendingOrder
ysftrades said:
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
Hi Panagiotis,
Thank you for sharing that.
This a new parameter that is added.
I looked up the Help section to try and understand what does the ProtectionType parameter do.
I understand that they are three values to choose from; ProtectionType.None, ProtectionType.Relative and ProtectionType.Absolute
I couldn't understand what is their effect. Could you be kind enough to elaborate what do they do to an order or position?
Thank you
Seems like even @Panagiotis doesn't know since there's been no response… he's been awfully quiet. Wonder if he's still around or on vacation or something?
@firemyst
protraderde
03 Jan 2025, 13:58
+1
@panagiotis ?
@protraderde