I caught the algotrading bug recently and I've been wanting to backtest a couple of strategies involving ETFs. Right now I'm only looking at the open, close, daily high/low. The problem however is that you have to account for dividends and splits, which I'm not sure how to do (Admittedly, I haven't looked too deeply into it). Any advice on how to do that? Let's say I want to backtest some strategy involving UPRO; would I be fine just using yahoo finance historical prices as is, or would I have to manipulate it in some way? Also, what would be the ideal backtesting software/service to use?
Harsh answer - if you have to ask this question here, then stop it now.
Thing is, you will be fooled by bad data - you will find strategies that works in a backtest but not in production. And the reason will be because you missed some important finance concept (like taxes, dividends, stock splits etc).
In this field 99% of success in my opinion is knowing what you don’t know. And only model that small part that you know you know and are fairly sure about it.
Ps. By stop it now - I mean stop algo simulations and learn about those concepts, make sure you understand perfectly what data you are putting into your backtest.
Fair point. Right now I'm just doing it as a hobby. I'm not going to be making any real trades for a while and even when I do I don't plan on making money from it (at least not for some time).
Depending on your provider, but there could be an "Adjusted Close" (Yahoo has it) which includes stock splits and dividends. I tried a few backtesting libraries, thought backtesting.py[1] was easy to work with and straight to the point.
Thanks. I've heard that yahoo finance historical price data is usually pretty accurate, but can get it wrong sometimes. Is there a better source for price data, or is yahoo finance good enough in your experience?