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 DJ888, 04-16-2024, 06:09 PM
          4 responses
          12 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by terofs, Today, 04:18 PM
          0 responses
          6 views
          0 likes
          Last Post terofs
          by terofs
           
          Started by nandhumca, Today, 03:41 PM
          0 responses
          5 views
          0 likes
          Last Post nandhumca  
          Started by The_Sec, Today, 03:37 PM
          0 responses
          3 views
          0 likes
          Last Post The_Sec
          by The_Sec
           
          Started by GwFutures1988, Today, 02:48 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Working...
          X