Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Data Integrity Question

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

    Data Integrity Question

    Hi, So far I'm loving NT but I'm having difficulty reconciling a data issue. I'm trying to backtest SPY using a basic buy and hold (buy if close is greater then 0). I entered the backtest with a date of 1/3/00-today. The backtest worked fine. Here's my question: I've updated the instrument and the control center to split and dividend adjust data using the help documentation. However, the 1/3/00 entry price is signficantly different then the split/div adjusted price on Yahoo Finance's page.

    NT is showing a 1/3/00 entry price of 130.14. Yahoo Finance shows 145.44 unadjusted and 124.52 as the adjusted price. What am I missing?

    #2
    Hello oyz79,

    Am I correct you are connected to Yahoo when you backtest the SPY?

    Are you referring to the Open price with 'entry price'?
    JasonNinjaTrader Customer Service

    Comment


      #3
      Hi, Yes, I am using Yahoo and comparing NT's open entry price to the historical data available on Yahoo. NT's entry price is neither the split adjusted price on Yahoo or the non-adjusted Yahoo price, it is somewhere in between as if it is only using a partially adjusted price.

      Comment


        #4
        Please go to your Instrument Manager for the instrument of SPY and add split dates as needed. Then reload all of your historical data to get it to reflect the split information.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I'll try that, but I don't believe SPY has had any splits since it is just the s&p 500 tracking ETF

          Comment


            #6
            Hi, I appreciate your help. I checked what the instrument manager shows for historical SPY dividends and splits (no splits) vs. Yahoo's historical data and they match up. What else could I be doing wrong??

            Here is my code and I'm using it on a monthly signal going back to 1999.

            Here are my first entries/exits, which don't match up w/ Yahoo's split adjusted data for SPY, but it also isn't matching their non-adjusted date for SPY:

            buy 110.52, 4/30/99
            sell 109.48 10/31/99
            buy 118.04 11/30/99
            sell 127.26 10/31/00
            buy 98.93 4/30/02
            sell 92.67 5/31/02
            and so on...

            #region Using declarations
            using System;
            using System.ComponentModel;
            using System.Diagnostics;
            using System.Drawing;
            using System.Drawing.Drawing2D;
            using System.Xml.Serialization;
            using NinjaTrader.Cbi;
            using NinjaTrader.Data;
            using NinjaTrader.Indicator;
            using NinjaTrader.Gui.Chart;
            using NinjaTrader.Strategy;
            #endregion

            // This namespace holds all strategies and is required. Do not change it.
            namespace NinjaTrader.Strategy
            {
            /// <summary>
            /// Enter the description of your strategy here
            /// </summary>
            [Description("Enter the description of your strategy here")]
            public class SMA10MONTH : Strategy
            {
            #region Variables
            // Wizard generated variables
            private int myInput0 = 1; // Default setting for MyInput0
            // User defined variables (add any user defined variables below)
            #endregion

            /// <summary>
            /// This method is used to configure the strategy and is called once before any strategy method is called.
            /// </summary>
            protected override void Initialize()
            {

            CalculateOnBarClose = true;
            }

            /// <summary>
            /// Called on each bar update event (incoming tick)
            /// </summary>
            protected override void OnBarUpdate()
            {
            // Condition set 1
            if (CrossAbove(Close, SMA(10), 1))
            {
            EnterLong(DefaultQuantity, "");
            }

            // Condition set 2
            if (CrossBelow(Close, SMA(10), 1))
            {
            ExitLong("", "");
            }
            }

            #region Properties
            [Description("")]
            [Category("Parameters")]
            public int MyInput0
            {
            get { return myInput0; }
            set { myInput0 = Math.Max(1, value); }
            }
            #endregion
            }
            }

            Comment


              #7
              This has nothing to do with your strategy. Just pull up a chart of SPY and sync the two. You refer to split adjusted data from Yahoo. You need to adjust your data exactly as Yahoo has theirs.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                I'm clearly missing something here. How do I sync the instrument and yahoo? The NT chart shows split adjusted data that is way different from Yahoos data:

                Date Open High Low Close Avg Vol Adj Close*

                Mar-93 44.56 45.84 44.22 45.19 136,100 34.15



                NT;
                SPY Buy 1 17.41 3/31/1993 12:00:00 AM NT-00000 Entry 1L NT-00000 Buy 0 1 Back101
                Last edited by oyz79; 08-30-2009, 07:29 PM.

                Comment


                  #9
                  Please follow the instructions at the link below to update NinjaTrader with splits and dividends, see screenshot as well.


                  Could it be the Yahoo data you use to compare is not dividend adjusted?
                  Attached Files
                  JasonNinjaTrader Customer Service

                  Comment


                    #10
                    Yes, I've updated the dividends/splits using the procedure in the help section. Yahoo has both adjusted and unadjusted data in their database. In addition, the data that NT is importing does not even equal the non-adjusted historical data in Yahoo, it is somewhere in between. However, I reviewed all of the dividends and splits NT has listed for SPY and they are accurate and equal to those dividends listed in Yahoo.

                    I'm at a loss, anyone else ever experienced this issue?

                    Comment


                      #11
                      Can you please tell me where you retrieve the adjusted and non-adjusted historical data. Could you please paste links if possible.
                      JasonNinjaTrader Customer Service

                      Comment


                        #12
                        Historical pricing for SPY is here:



                        You can sort either just the dividends or daily data or monthly data. I've been looking at all 3 on Yahoo. The 'adj close' on Yahoo is the adjusted closing price (right hand column). The other columns of price data are unadjusted.

                        Comment


                          #13
                          I am not sure why the 'close adjusted' price does not resemble the Close price in NinjaTrader when splits are enabled. NinjaTrader acts like a radio receiver in that we display data as it is provided.

                          When I removed all splits in the Instrument Editor-->Misc-tab of the SPY and loaded a new SPY chart, OHLC resembled the data as per the link you provided.
                          JasonNinjaTrader Customer Service

                          Comment


                            #14
                            There should be no splits defined for SPY- I went to the instrument editor>misc and it shows no splits defined, and 65 dividends. My chart still looks the same with NT showing a Jan 1993 price below $17 for SPY.

                            It does the same thing for other securities like qqqq. Although for qqqq the discrepancy is much smaller but still significant.

                            The primary reason why I'm pursuing this is I'd like to start backtesting some trading strategies using your software and publish them on my blog, which should lead to some inbound traffic for your company. However, before I do so I need to feel comfortable with the data integrity since I could get questions from my readers which could make both of us look less then professional.

                            Comment


                              #15
                              My apologies, I meant to state dividends instead of splits.

                              What happens if you remove all dividens? It should resemble the data as per the link you provided, except the 'close adjusted' price.
                              JasonNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by zstheorist, Today, 07:52 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post zstheorist  
                              Started by pmachiraju, 11-01-2023, 04:46 AM
                              8 responses
                              150 views
                              0 likes
                              Last Post rehmans
                              by rehmans
                               
                              Started by mattbsea, Today, 05:44 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post mattbsea  
                              Started by RideMe, 04-07-2024, 04:54 PM
                              6 responses
                              33 views
                              0 likes
                              Last Post RideMe
                              by RideMe
                               
                              Started by tkaboris, Today, 05:13 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post tkaboris  
                              Working...
                              X