Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtest with Yahoo data doesn't work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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?

    #2
    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.
    Ray S.NinjaTrader Customer Service

    Comment


      #3
      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?

      Comment


        #4
        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.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          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!

          Comment


            #6
            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.

            Comment


              #7
              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

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              111 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              59 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              38 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              41 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              78 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X