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
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