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

Time.GetValueAt() and Time[0] returns different results for different bar types

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

    Time.GetValueAt() and Time[0] returns different results for different bar types

    Hello.
    I found that Times[0].GetValueAt(CurrentBars[0]) and Times[0][0] returns different values for daily bars.
    And even more: GetValueAt()completely miss some bars.
    Please, look at screenshots.
    Is this expected behaviour?
    Attached Files
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello fx.practic thanks for your post.

    I ran your test script but all of my dates are matching up using Kinetick and Sept. NQ daily chart. Please let me know what data feed you're using so I can try the same thing. You can also try to reset your saved historical data in case this is causing the problem. Shut down NT> navigate to Documents\NinjaTrader 8\db> delete the cache, day, minute, and tick folders> restart NT and test.

    I look forward to hearing of your results.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello, Chris
      Thank you for the answer.

      I removed all cache and see the same behaviour.
      I using Kinetick for both minutes and daily bars.

      Can you, please, run it on exactly daily or monthly bars on your side?
      Same problems I can see on the weekly bars.

      Attached Files
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        Hello,

        It looks like Times[0].GetValueAt(CurrentBars[0]) ignores a session template and Times[0][0] does not. I asked our product management team if that would be expected or not. If you need the DateTime to follow the session template, then Times[0][0] would be the item to use.

        Best regards.
        Last edited by NinjaTrader_ChrisL; 08-23-2019, 01:49 PM.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Thank you, ChrisL
          This issue bother me, because there are few parts of code where I can use GetValue() only.
          Look forward for your reply.
          fx.practic
          NinjaTrader Ecosystem Vendor - fx.practic

          Comment


            #6
            Here is another example of different dates form same bar on Daily.
            Attached Files
            fx.practic
            NinjaTrader Ecosystem Vendor - fx.practic

            Comment


              #7
              Hello, thanks for your patience.

              I found that it's expected for the session template to be ignored with daily/monthly bars. If you need the session end time of these bars you can use GetSessionEndTime().
              Chris L.NinjaTrader Customer Service

              Comment


                #8
                Thank you, Chris.
                fx.practic
                NinjaTrader Ecosystem Vendor - fx.practic

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by jeronymite, 04-12-2024, 04:26 PM
                3 responses
                44 views
                0 likes
                Last Post jeronymite  
                Started by Barry Milan, Yesterday, 10:35 PM
                7 responses
                20 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by AttiM, 02-14-2024, 05:20 PM
                10 responses
                179 views
                0 likes
                Last Post jeronymite  
                Started by ghoul, Today, 06:02 PM
                0 responses
                9 views
                0 likes
                Last Post ghoul
                by ghoul
                 
                Started by DanielSanMartin, Yesterday, 02:37 PM
                2 responses
                13 views
                0 likes
                Last Post DanielSanMartin  
                Working...
                X