Backtesting.Start optional algo parameters
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
Replies
vanderlinde.jacques
23 Feb 2025, 16:01
Hi,
Anyone that can help us?
Greetings
Jacques
@vanderlinde.jacques
vanderlinde.jacques
10 Feb 2025, 12:34 ( Updated at: 14 Feb 2025, 18:21 )
Hi there,
I have the same problem, cannot change the bot's input parameter values when calling Backtesting.start.
I have currently the following:
object[] RobotParameters = new object[] {0.02, 1, 30};
theBacktestingProcess = Backtesting.Start(_selectedRobotType, "EURUSD", TimeFrame.Minute5, backtestingSettings,RobotParameters);
But when looking at the Backtesting results, I can see that it used the default parameters of the bot.
Please help!
@vanderlinde.jacques