Skip to content

Ticks data load takes long time and get aborted before backtest starts. #6

@ys2310

Description

@ys2310

For FX cross pairs, it seems that the cTrader loads the specified backtest data (AUDNZD in this example) plus each leg with USD (AUDUSD, NZDUSD) and each leg with account currency leg (AUDJPY, NZDJPY). For ticks data backtest, this takes long time and get aborted erorr even before the backtest starts.

Option1. (Recommend)
Don't load ticks data every time for a new ctrader-cli backtest from the internet. Reuse the stored ticks in the machine just like GUI cTrader does.

Option2.
Set the abort time longer so that backtest won't get aborted before fully loading the necessary ticks.

Following is the command I used. Linux_Test1.algo just prints Hello World.

docker run --rm --name ctrader.console.run.ga-ab7edaf4 --mount type=bind,src=/home/ubuntu/cAlgo/Robots,dst=/mnt/Robots -e CTID=test@gmail.com -e PWD-FILE=/mnt/Robots/ctrader-cli.pwd -e ACCOUNT=1234567 -e SYMBOL=AUDNZD -e PERIOD=m1 -e START=01/01/2024 -e END=30/12/2025 -e DATA-MODE=Ticks -e BALANCE=10000 -e COMMISSION=30 -e SPREAD=0
ghcr.io/spotware/ctrader-console:5.5.17 backtest /mnt/Robots/Linux_Test1.algo --environment-variables --full-access --exit-on-stop

...
Progress | Loading AUDNZD, m1 | 100.00 % |
...
Progress | Loading AUDJPY, m1 | 100.00 % |
...
Progress | Loading NZDJPY, m1 | 100.00 % |
...
Progress | Loading AUDUSD, m1 | 100.00 % |
...
Progress | Loading NZDUSD, m1 | 100.00 % |

Error | CBot instance [Linux_Test1, AUDNZD, m1] aborted by timeout.
{
"Equity":,
"NetProfit":-,
"MaxBalanceDrawdownPercentages":-,
"MaxEquityDrawdownPercentages":-,
"MaxBalanceDrawdown":-,
"MaxEquityDrawdown":-,
"WinningTrades":-,
"LosingTrades":-,
"TotalTrades":-,
"AverageTrade":-,
"ProfitFactor":-,
"Fitness":
}
Message expected
System.InvalidOperationException: Message expected
at cTrader.Console.Infrastructure.StateMachine.Strategies.BacktestReportSavingStateStrategy.DoEnter() in /src/cTrader/cTrader.Console.Infrastructure/StateMachine/Strategies/BacktestReportSavingStateStrategy.cs:line 38
at cTrader.Console.Infrastructure.StateMachine.Strategies.ConsoleStateStrategyBase.Enter() in /src/cTrader/cTrader.Console.Infrastructure/StateMachine/Strategies/ConsoleStateStrategyBase.cs:line 15
at cTrader.Console.Infrastructure.StateMachine.ConsoleApplicationLifecycleStateMachine.OnMovedToLifecycleState(IConsoleApplicationLifecycleStateStrategy newStateStrategy) in /src/cTrader/cTrader.Console.Infrastructure/StateMachine/ConsoleApplicationLifecycleStateMachine.cs:line 39
at cTrader.Console.Infrastructure.StateMachine.ConsoleApplicationLifecycleStateTransition.InternalMoveTo(ConsoleApplicationLifecycleState state) in /src/cTrader/cTrader.Console.Infrastructure/StateMachine/ConsoleApplicationLifecycleStateTransition.cs:line 33
at cTrader.Console.Infrastructure.StateMachine.ConsoleApplicationLifecycleStateTransition.<>c__DisplayClass7_0.b__0() in /src/cTrader/cTrader.Console.Infrastructure/StateMachine/ConsoleApplicationLifecycleStateTransition.cs:line 23
at cTrader.Console.Infrastructure.Dispatcher.ConsoleThreadDispatcher.<>c__DisplayClass12_0.g__ExecuteAction|0() in /src/cTrader/cTrader.Console.Infrastructure/Dispatcher/ConsoleThreadDispatcher.cs:line 86

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions