Backtesting on continous series takes much longer

 

Hi everyone!

I'm programming an strategy on MetaTrader5 and I've found myself in a rather strange situation while doing backtests. My strategy is for operating on future indexes, specifically the brazilian ones.

The problem is as follows:

  • Running a backtest on WDOV20 between days 09/01/2020 (September 1st) and 09/16/2020, using OHLC model, takes aproximatelly 0.5 seconds.
  • Running a backtest on WDO$, WDO$N, WDO@, etc, (continuous series), for the same period (09/01 to 09/16), using OHLC, takes aproximatelly 10 seconds (20x longer)
And it makes no sense at all since the only thing that changed between those tests is the symbol. I just realized it today because the symbol changed from WDOV20 to WDOX20 on October 1st, and since the old symbol (WDOV20) was excluded I only have access to the data through the Continuous series.
I've already discarded download times because I've got pretty fast internet and I'm sure the data is cached.

It's impossible for me to run optimizations on the strategy while on the continous symbol, since every backtest takes 10 seconds and I need to run 10000 or more. Running optimizations on the normal symbol works just fine.


Has anyone had any similar problems?

 
Lucas Pevidor:

Hi everyone!

I'm programming an strategy on MetaTrader5 and I've found myself in a rather strange situation while doing backtests. My strategy is for operating on future indexes, specifically the brazilian ones.

The problem is as follows:

  • Running a backtest on WDOV20 between days 09/01/2020 (September 1st) and 09/16/2020, using OHLC model, takes aproximatelly 0.5 seconds.
  • Running a backtest on WDO$, WDO$N, WDO@, etc, (continuous series), for the same period (09/01 to 09/16), using OHLC, takes aproximatelly 10 seconds (20x longer)
And it makes no sense at all since the only thing that changed between those tests is the symbol. I just realized it today because the symbol changed from WDOV20 to WDOX20 on October 1st, and since the old symbol (WDOV20) was excluded I only have access to the data through the Continuous series.
I've already discarded download times because I've got pretty fast internet and I'm sure the data is cached.

It's impossible for me to run optimizations on the strategy while on the continous symbol, since every backtest takes 10 seconds and I need to run 10000 or more. Running optimizations on the normal symbol works just fine.


Has anyone had any similar problems?

Create a custom symbol with the data from all symbols, then test with it's cumulative history