I’ve been re-viewing a Udemy Course Trading Tactics by Triumph at Trading. It’s all about backtesting. Actually it’s not ALL about backtesting, just why you should do it, some best practices, and a handy spreadsheet to keep track of and analyze results. He doesn’t even discuss specific strategies. So basically it’s about analysing backtest results by various metrics.
So it got me thinking, since I’m seriously reviewing my approach to backtesting before launching into a variety of strategies. Many courses I’ve done, on Udemy and elsewhere (Quantra being the other main site I use) have backtesting and analysis code provided, but it’s all a bit haphazard. Some time ago I bought a book by Chris Conlan called Algorithmic Trading with Python which includes some fairly well structured code for analysing individual backtests and entire portfolios. He adopts an OO approach too, which is a bit rare with Python programmers but is very familiar to me since I taught Java for 16 years! He even uses type hinting for everything. So if I’m going to use some prepackaged code for analysis I might just go with that. Anyway, time to review the book. Actually that’s a bit of a challenge since most of my books are still in boxes after moving here six months ago, and I don’t really want to unpack them all looking for that one book. I can just review all the code examples and refresh my memory of Compound Annual Growth Rate (CAGR) and Sortino Ratio, and all those other metrics so beloved of financial analysts. The book basically explains the concepts and then acts as a manual for his codebase. If I get stuck with the code I guess I can just start unpacking those boxes.
So, I’ve opened the directory containing all the code examples and files for his ‘application’ as a project in PyCharm, assigned an appropriate Docker image as a remote interpreter, and away we go. I’m glad I’ve sorted out my environment/package management issues at last, hoping I don’t run into further problems with that.
ETA: I decided I need the book after looking at the code. Luckily I found it in the second (of eight) boxes, so not too many piles of books spread around on the floor. I think I’ll need to write a couple of classes implementing the strategies I want to use, but that should be fairly straight-forward. I’m not really sure what might be different with the backtesting this time round, compared with all those previous times when I got good backtest results but poor actual results. I’m probably just intending to do the same thing as before but expect a different result. Not very smart.