View Full Version : Backtest with Yahoo data doesn't work
FireFly
12-17-2008, 02:39 PM
I have downloaded daily data of the S&P500 index from yahoo. When I try to do a backtest of NinjaTrader's built in moving average crossing strategy I don't get any entries when backtesting. But I can see in the charts that the averages cross so I should have entries.
On another instrument things work as expected. What am I overlooking?
NinjaTrader_RJ
12-17-2008, 02:57 PM
I have downloaded daily data of the S&P500 index from yahoo. When I try to do a backtest of NinjaTrader's built in moving average crossing strategy I don't get any entries when backtesting. But I can see in the charts that the averages cross so I should have entries.
On another instrument things work as expected. What am I overlooking?
Hello FireFly,
Thank you for your post.
You cannot place trades on Indices themselves, so there will be no trades in the backtest.
Test other instruments to verify.
FireFly
12-17-2008, 03:00 PM
Hello FireFly,
Thank you for your post.
You cannot place trades on Indices themselves, so there will be no trades in the backtest.
Test other instruments to verify.
Ah! I see...
So what is the easiest way around that? Maybe export the indexdata and import it again, creating a 'fake' share that holds the same data on which I can then place trades?
Or is there a simpler approach?
NinjaTrader_Josh
12-17-2008, 03:07 PM
You can try that if you want. There is no workaround to backtesting indexes because it doesn't make sense to trade on them. If you wanted to test the S&P500 I suggest you just use something like SPY or some other tradeable ETF that tracks the S&P.
FireFly
12-17-2008, 03:13 PM
You can try that if you want. There is no workaround to backtesting indexes because it doesn't make sense to trade on them. If you wanted to test the S&P500 I suggest you just use something like SPY or some other tradeable ETF that tracks the S&P.
Backtesting strategies on indices can make sense if you want to test if certain patterns have predictive powers. But you are right that in terms of 'trades' an index doesn't make sense. SPY will be close enough. Thanks for the suggestion!
Anagoge
12-18-2008, 01:07 AM
So what is the easiest way around that? Maybe export the indexdata and import it again, creating a 'fake' share that holds the same data on which I can then place trades?
I've done this, and it works fine. You create a new instrument, set it to be a stock, and tell NT that the Yahoo symbol for retrieving the data is ^GSPC (S&P 500, or whatever other index you prefer).
The reason I wanted to do this was to compare trading futures, ETFs, and index funds to the "idealized" trading of the index.
nescio
02-11-2009, 10:25 AM
:D These posts were very helpful to me... thx... To my view too it makes sense to backtest indices for certain reasons as stated below