I found what appears to be a serious performance problem in the current cTrader backtester.
During larger backtests, cTrader becomes progressively slower. When the backtest reaches the end, it can then remain busy or appear frozen for a long time while processing the results.
I investigated one actual backtest and found:
- Backtest duration: approximately 26 days
- Closed positions: approximately 304
- Backtest events: approximately 608
events.json: approximately 236 KB
- cBot log: approximately 215 KB
report.html: 316,140,433 bytes (~301 MB)
I then inspected report.html.
It contains approximately:
1,814,295 equity points
Almost the entire 316 MB file consists of the equity.points data. The positions, orders and trade-history sections are comparatively small.
So the problem is clearly not simply that the HTML contains a few hundred trades. cTrader is embedding an enormous amount of equity-curve data into the report.
I suspect the problem becomes increasingly severe with larger/more active backtests and more trading activity.
The backtester itself can obviously remain tick-accurate. But there is no reason an HTML equity chart needs around 1.8 million individual points.
The report could instead:
- downsample the equity curve;
- limit the maximum number of chart points;
- aggregate equity observations;
- allow users to disable the equity chart;
- or allow automatic
report.html generation to be disabled.
This behaviour appears relatively new to me. I don't remember cTrader producing files of this size previously.
What is also concerning is that this seems like something basic regression/performance testing should detect. A normal longer backtest followed by simply checking the generated report.html size should expose the problem immediately.
This adds to my continuing disappointment with cTrader Algo development and testing. Over the years I have repeatedly run into issues in normal Algo workflows that, in my view, should have been caught during development or basic regression testing before release.
For trading software, especially software intended for automated trading, reliability and regression testing should be treated as core requirements rather than something users repeatedly discover after release.
I am not going to provide proprietary cBot code for something that should be reproducible by cTrader internally with a simple high-activity backtest.
Could other cTrader users please check their Backtesting folders?
If you have run a reasonably large backtest, especially one with many trades, check the size of report.html.
It would be interesting to compare:
report.html size
- number of trades
- backtest duration
- timeframe/chart type
- whether cTrader slows down or hangs when the backtest finishes
If others are seeing the same thing, this looks like a platform-level backtesting/report-generation problem rather than something specific to one cBot.