There is a question about the optimization improvement. I've read the article optimization-improvements, but it seems that the improvement works in the scenario of single strategy optimization.
In this strategy auto-generation case, the problem is that trading data are the same and strategy is switching. Is this possible that the data file is only read-once and switching between strategies only?
My current structure is like:
signals = itertools.product(EntryList, ExitList)
for sig, exit in signals:
cerebro = bt.Cerebro()
fromdate = datetime.datetime(2014, 1, 1)
todate = datetime.datetime(2015, 1, 1)
data = bt.feeds.GenericCSVData(...)
cerebro.optstrategy(MasterStrategy, signal=sig, exsig1=exit, [paras]...)
In such structure, the data is loaded every time in the loop and file reading is very time-consuming.
It seems not working if I simply move the code before adddata out of the for loop.
Is it possible that the file is read only once?
Have you got any good suggestions to improve the performance please?