NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Strategy Analyzer

Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer.

Reply
 
Thread Tools Display Modes
Old 12-17-2008, 02:39 PM   #1
FireFly
Senior Member
 
Join Date: Apr 2007
Location: , ,
Posts: 150
Thanks: 0
Thanked 0 times in 0 posts
Default Backtest with Yahoo data doesn't work

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?
FireFly is offline  
Reply With Quote
Old 12-17-2008, 02:57 PM   #2
NinjaTrader_RJ
NinjaTrader Customer Service
 
NinjaTrader_RJ's Avatar
 
Join Date: Jul 2008
Location: Denver, CO, USA
Posts: 1,828
Thanks: 4
Thanked 19 times in 18 posts
Default

Quote:
Originally Posted by FireFly View Post
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.
NinjaTrader_RJ is offline  
Reply With Quote
Old 12-17-2008, 03:00 PM   #3
FireFly
Senior Member
 
Join Date: Apr 2007
Location: , ,
Posts: 150
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_RJStein View Post
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?
FireFly is offline  
Reply With Quote
Old 12-17-2008, 03:07 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

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.
NinjaTrader_Josh is offline  
Reply With Quote
Old 12-17-2008, 03:13 PM   #5
FireFly
Senior Member
 
Join Date: Apr 2007
Location: , ,
Posts: 150
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
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!
FireFly is offline  
Reply With Quote
Old 12-18-2008, 01:07 AM   #6
Anagoge
Senior Member
 
Join Date: Sep 2008
Posts: 183
Thanks: 0
Thanked 1 time in 1 post
Default

Quote:
Originally Posted by FireFly View Post
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.
Anagoge is offline  
Reply With Quote
Old 02-11-2009, 10:25 AM   #7
nescio
Junior Member
 
Join Date: Feb 2009
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
Default Very helpful

These posts were very helpful to me... thx... To my view too it makes sense to backtest indices for certain reasons as stated below
nescio is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Backtest won´t work on Indices - solved by recreating the Index as a Stock. tomcat Strategy Analyzer 5 03-23-2010 06:24 AM
Stop Loss work differently in Backtest and Real Time simulator stefy Strategy Development 3 08-28-2008 08:42 AM
wrong yahoo data? Hannes.S Charting 2 07-02-2008 01:34 AM
Streaming Yahoo Data DivineDragon Connecting 2 03-05-2008 01:34 PM
So does Gtc work in backtest? henry.omd Historical NinjaTrader 6.5 Beta Threads 10 12-30-2007 04:24 PM


All times are GMT -6. The time now is 12:09 AM.