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 love2code2trade, Yesterday, 01:45 PM
                4 responses
                28 views
                0 likes
                Last Post love2code2trade  
                Started by funk10101, Today, 09:43 PM
                0 responses
                7 views
                0 likes
                Last Post funk10101  
                Started by pkefal, 04-11-2024, 07:39 AM
                11 responses
                37 views
                0 likes
                Last Post jeronymite  
                Started by bill2023, Yesterday, 08:51 AM
                8 responses
                45 views
                0 likes
                Last Post bill2023  
                Started by yertle, Today, 08:38 AM
                6 responses
                26 views
                0 likes
                Last Post ryjoga
                by ryjoga
                 
                Working...
                X