Backtesting.Start optional algo parameters

Created at 07 Feb 2025, 13:55
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!
CL

claudiorubbiani

Joined 29.03.2021

Backtesting.Start optional algo parameters
07 Feb 2025, 13:55


Hi everyone,

the new backtesting features of cTrader 5 are amazing!

From my plugin, I want to backtest my algo and I able to pass all the parameters like symbol, starting capital and start and end backtest dates.

Something like this works really well:

BacktestingProcess backtestSession = ctraderEnvironment.Plugin.Backtesting.Start(wahooBacktest.WahooRobot, nextTask.SymbolName, nextTask.TimeFrame, nextTask.BacktestingSettings);
 

Since my Algo is accepting some parameters, I want to pass these parameters from the plugin: 

BacktestingProcess backtestSession = ctraderEnvironment.Plugin.Backtesting.Start(wahooBacktest.WahooRobot, nextTask.SymbolName, nextTask.TimeFrame, nextTask.BacktestingSettings, "My first Text parameter", 2, "My second Text parameter");
 

As soon as I add these optional parameters, my algo receives in input these values:

cTrader.Automate.Domain.Shared.Messaging.Serializable.SerializableAlgoParameterValue`1[System.String]

 

Could you please provide some guidance on how to create these parameters from the plugin? I also tried something like this

object[]  _myAlgoParameters  = new object[]

{
    "MySampleString",
    1,
    12345,
};

But nothing seems to work.

Thanks a lot and keep up the hard work.

---

Claudio

 


@claudiorubbiani
Replies

firemyst
08 Feb 2025, 03:54 ( Updated at: 14 Feb 2025, 18:19 )

Duplicate of this thread:

https://community.ctrader.com/forum/ctrader-algo/46280/

 

 


@firemyst