cBot Crashes in Cloud when using the new "ProtectionType" parameter

Created at 09 Jan 2025, 05:31
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!
ysftrades's avatar

ysftrades

Joined 09.04.2024

cBot Crashes in Cloud when using the new "ProtectionType" parameter
09 Jan 2025, 05:31


Hi All,

I'm using cTrader 5.1.111 terminal.

A new parameter, ProtectionType, has been added to the function for placing and modifying orders with stop loss and take profit.
Following are the functions' signatures;

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

public TradeResult ModifyPosition(Position position, double? stopLoss, double? takeProfit, ProtectionType? protectionType)

It is not clear to me what the new parameter does. As mentioned in the Help section, it has three fields; ProtectionType.None, ProtectionType.Relative and ProtectionType.Absolute.

When the new parameter is used and the cBot runs in the terminal, there appear to be no issues.
However when the cBot runs in the cloud, it crashes logging the following error;

09/01/2025 04:10:22.119 Error | Crashed in OnStart with TypeLoadException: Could not load type 'cAlgo.API.ProtectionType' from assembly 'cAlgo.API, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3499da3018340880'.

So at the moment, I'm using the function without the new parameter. The algorithm displays Warnings about the function being obsolete during the Build, but the cBot works fine both in the terminal and in the cloud.

Could anyone explain what the new parameter does and whether the cloud issue is solvable?


@ysftrades