Rerun backtests with different start dates
I'm testing asset allocations using decades of monthly data and I want to make sure the starting month doesn't have an outsized impact on the results. Is there a way to do that?
The best idea i have so far is to create a strategy that takes a start date as a parameter and use optstrategy to pass that in for every different start date I want to test. Then the algo just wouldnt do anything before the start date. However that impacts the analyzers which consider the start date by the start of the data.
@brettelliot I would think the easiest way is to just pass start and end date arguments to data feed calls for each data set.
data = btfeeds.GenericCSVData( dataname=filename, fromdate=start_date, todate=end_date, ... )
@davidavr I planned on using
optstrategywhich means the data feeds are loaded once before running the backtests.
I guess i could skip using
optstrategyand build my own loop that runs a single threaded backtest for each month. I might lose multithreads but I also don't have to adjust analyzers.
Ill give it a shot!
run-out last edited by
@brettelliot You can use python multiprocessing to run seperate backtest.