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

Can Native Real-Time Timestamps be Read in OnBarUpdate?

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

    Can Native Real-Time Timestamps be Read in OnBarUpdate?

    I'm running NinjaTrader version 8.0.23.2 64-bit connected to Kinetick (via IQFeed). Per my interpretation of the NT8 Help Guide topic "Data by Provider," I believe each tick that NT receives in real-time from Kinetick/IQFeed comes with a "Native Real-Time Timestamp." I'm currently developing an indicator that I intend to use with Daily bars, and with Calculate set to "On each tick." Within OnBarUpdate, is there any way for me to read the "Native Real-Time Timestamp" of the tick that triggered the OnBarUdate call and, if yes, how?

    Thank you very much in advance for any guidance you might provide.

    #2
    On second thought, I might be totally misguided here. I'm assuming the "Native Real-Time Timestamps" for ticks associated with Daily bars look something like "03.05.2021 14:59:00:480," not just "03.05.2021." So, I should really ask this first: Do "Native Real-Time Timestamps" for ticks associated with Daily bars contain date and time information, or just date information?

    Comment


      #3
      Hello NtFan,

      Real-time updates will update OnMarketData().
      https://ninjatrader.com/support/help...marketdata.htm

      Or you can add a 1 tick series to have OnBarUpdate() update with the time for each tick.
      https://ninjatrader.com/support/help...dataseries.htm
      https://ninjatrader.com/support/help...inprogress.htm
      https://ninjatrader.com/support/help...urrentbars.htm
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Hi ChelseaB,

        Thank you very much for the suggestions. Both of them are interesting, but each has a drawback:

        1. Using OnMarketUpdate the timestamps are out-of-date because OnMarketUpdate is called after OnBarUpdate (per the NT8 Help Guide).
        2. Using a 1-tick series the timestamps that are up-to-date, but my indicator takes quite a while to load when it's first applied to a chart.

        Ideally I'd have access to a method like OnMarketUpdate that is called before OnBarUpdate. Please let me know if such a method is available, otherwise I'll forge ahead with 1 or 2.

        Thanks again for your guidance.

        NtFan

        Comment


          #5
          Hello NtFan, thanks for your reply.

          The only available method for instantaneous market data access would be the OnMarketData method. When the time comes when OnMarketData and OnBarUpdate should be called, OnBarUpdate will be called first because a new bar must be formed with OnBarUpdate. The stream of data from OnMarketData will remain constant whereas OnBarUpdate will only call once each bar (if Calculate == Calculate.OnBarClose), but the times that OnBarUpdate will be called, it will show up before OnMarketData.

          Please let me know if I can assist any further.
          Chris L.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by elirion, Today, 09:48 PM
          0 responses
          1 view
          0 likes
          Last Post elirion
          by elirion
           
          Started by set2win, 08-04-2021, 09:23 AM
          39 responses
          1,001 views
          0 likes
          Last Post WaleeTheRobot  
          Started by md4866, Today, 08:15 PM
          0 responses
          8 views
          0 likes
          Last Post md4866
          by md4866
           
          Started by mjbatts91, Yesterday, 04:48 PM
          2 responses
          23 views
          0 likes
          Last Post mjbatts91  
          Started by pibrew, Today, 06:10 PM
          1 response
          22 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X