This is the third post in the Backtesting in Excel and R series and it will show how to backtest a simple strategy in R. It will follow the 4 steps Damian outlined in his post on how to backtest a simple strategy in Excel.
Step 1: Get the data
The getSymbols function in quantmod makes this step easy if you can use daily data from Yahoo Finance. There are also “methods” (not in the strict sense) to pull data from other sources (FRED, Google, Oanda, R save files, databases, etc.
(This is a guest post by Damian from Skill Analytics and ETF Prophet)
Let me start by saying that I’m not an expert in backtesting in Excel – there are a load of very smart bloggers out there that have, as I would say, “mad skillz” at working with Excel including (but not limited to) Michael Stokes over at marketsci.com, Jeff Pietch over at etfprophet.com and the folks (David and Corey) over at cssanalytics.
This first post of the Backtesting in Excel and R series will provide some resources to help smooth the transition from the familiarity and comfort of Excel to the potentially strange and intimidating world of R.
I made my voyage from Excel to R more than 5 years ago and learned mostly by trial and error (and reading the R manuals). Most people don’t prefer my approach of “keep at it until you figure it out”, so I don’t have a lot of personal advice to share.
This post is the introduction to a series that will illustrate how to backtest the same strategy in Excel and R. The impetus for this series started with this tweet by Jared Woodard at Condor Options. After Soren Macbeth introduced us, Jared suggested backtesting a simple DVI strategy in Excel and R.
The three-post series will show you:
Resources that make it easier to move from Excel to R How to test DVI in Excel How to test DVI in R Since I know next to nothing about testing strategies in Excel, I will be writing posts 1 and 3.