Category Archives: Python

Backtesting – Tool Review

Backtesting – the pillar of trading and investing. I know what all the naysayers say, but with all due respect, they got this one wrong. 🙂 In finance, and in time series in general, history repeats itself. Natural phenomena follow patterns, so does crowd behavior. Earth temperatures are not going to rise forever, so wouldn’t the current bull market. Enough rambling though.

My readers know that my main tool for backtesting has been Tradelib, a Java library which I have developed and used over the past couple of years. Working on some new (or rather old) project, I decided to take another look what’s around, and the results surprised me.
Read More

Deep Learning for the Walk-Forward Loop

In the previous posts in these series (here, here and here) I used conventional machine learning to forecast the trading opportunities. Lately however I have been trying to move more and more towards deep learning. My first attempt was to extend the walk-forward loop to support neural networks, the building blocks of deep learning.

Read More

Walk-Forward Strategy Performance

The previous post introduced forecasting using multiple series and also suggested another form of improvement – namely filtering out low probability forecasts. Can we improve the forecasts by any of these approaches, and if yes, by how much?
Read More

Better Model Selection for Evolving Models

For quite some time now I have been using R’s caret package to choose the model for forecasting time series data. The approach is satisfactory as long as the model is not an evolving model (i.e. is not re-trained), or if it evolves rarely. If the model is re-trained often – the approach has significant computational overhead. Interestingly enough, an alternative, more efficient approach allows also for more flexibility in the area of model selection.

Read More