cBot Crashes in Cloud when using the new "ProtectionType" parameter
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 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?
firemyst
10 Jan 2025, 00:25 ( Updated at: 10 Jan 2025, 06:10 )
I've asked this earlier - wanting to know what the parameters do, and still waiting for a response as well:
https://community.ctrader.com/forum/cbot-support/46002/
@firemyst