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
protraderde
03 Jan 2025, 13:58
+1
@panagiotis ?
@protraderde