Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Daily data is shifted

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

    Daily data is shifted

    Hello,
    My strategy runs intraday but looks at daily charts at well.
    I've added daily bar data with the following code in the init section:
    Code:
    Add(PeriodType.Minute, 1); // Adds a minute chart to Barsarray[1]
    			
    			Add(PeriodType.Day, 1); // Adds a Daily chart to Barsarray[2]
    and I access it here for example:
    Code:
    (Math.Abs(Lows[2][0]- Opens[2][0]
    So I've realized that the data that is being returned is offset by two days. That is, what the program reports as data from may 5th is actually data from may 3rd (for example).
    I realized this by comparing the values of Open[2][0] / Close/ High for a particular day with the data from yahoo and google finance.
    How do I fix this?
    I am using data from Kinetick.
    Thanks
    Tal

    #2
    Hi Tal, thanks for the post - if you check the daily chart directly using Kinetick on your setup, would the dates be correct or shifted as well?

    What time zone is your PC set up in and which session template are you using for your charts and running the strategy please?

    Thanks,
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand
      If I upon a chart I get an off shift of one day. (I am looking at SPY and am using the flash crash of may 6 2010 as a reference point). When I open a chart it is labeled as 7th of may, When I check the strategy it happens on the 8th.

      Session Template: default 24/7
      Time Zone of my computer : GMT +2
      Thanks
      Tal

      Comment


        #4
        Thanks Tal, please try using the 'US Equities RTH' template for example - would that correct the data for you?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Hi
          This corrects it for the charts but not for the strategy.
          The strategy now sees the dta if may 6th as may 7th (an improvment but not a solution).
          Also, I would like to be able to run the strategy 24/7 to enjoy to pre and post market.

          Comment


            #6
            Please leave it on this session template to ensure correct data visualization, the daily bar session is set by the provider - so the amount of data included in the bar does not change dynamically here with changing templates.

            When you do you exactly try to access the 6th data? You could do so after the bar has closed, so the 7th would be the first possible location to do so.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Hmmm.
              I want to see if the daily move is larger then a certain percent. So I'm taking to lowest low of the data and subtracting that from the daily open bar.
              It wont be much help to do it on the next bar.

              Comment


                #8
                You can do this in realtime or Market Replay as the intrabar formation is then known, but if you're backtesting first possible location would be the following bar...
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by xiinteractive, 04-09-2024, 08:08 AM
                5 responses
                13 views
                0 likes
                Last Post NinjaTrader_Erick  
                Started by swestendorf, Today, 11:14 AM
                2 responses
                5 views
                0 likes
                Last Post NinjaTrader_Kimberly  
                Started by Mupulen, Today, 11:26 AM
                0 responses
                2 views
                0 likes
                Last Post Mupulen
                by Mupulen
                 
                Started by Sparkyboy, Today, 10:57 AM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by TheMarlin801, 10-13-2020, 01:40 AM
                21 responses
                3,917 views
                0 likes
                Last Post Bidder
                by Bidder
                 
                Working...
                X