I have an idea how to speed up backtesting of strategies using deep learning dramatically. Reason for the slow backtesting is the R-Bridge being incredibly slow.

The workaround with the neural_train() function is really elegant, where you circumvent the R bridge and feed the signals and the objective as a *.csv file. Wouldn't it be possible, to use a similar trick for backtesting?

When a machine learning algo is trained, predictions will be calculated for each row of signals anyways. Why not just put these predictions in a cache, where they can be read from Zorro?

By the way, I wrote two indicators in R that were next to unusable because backtesting was so slow. By implementing a cache on the Lite-C side, I was able to get huge performance gains, because I save a lot of requests to the R session! (The indicators keep most of their values for several bars and the other values can easily be updated within the cache).