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

Getting tick timestamp in market replay

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

    Getting tick timestamp in market replay

    Hi,

    To get a tick timestamp in market replay, when using 10 min bars, do I have to define an OnMarketUpdate and just save it for every tick, or is there a way to get it only when I want it. This would be quite a useful feature from a performance perspective.

    thanks
    Dave

    #2
    Furthermore, and even worse, it appears that OnMarketData is called after OnBarUpdate? This means that any tick timestamp I set in OnMarketData will be the previous tick time when OnBarUpdate gets called.

    Any ideas what the solution to all this is?

    thanks
    Dave

    Comment


      #3
      Dave, which CalculateOnBarClose setting do you use? Perhaps it would easiest for you to add a 1 tick chart to the strategy to get the more granular timestamps - http://www.ninjatrader-support.com/H...struments.html
      BertrandNinjaTrader Customer Service

      Comment


        #4
        Calculate on bar close = false, which is how I'm getting all the intra-bar ticks.

        Is that the only way to do it? Add a 1 tick series?

        How about my question about event order? It's a shame if you can't use all your market data info before the bar update call?

        Comment


          #5
          There is no guarantee that OnMarketData() will be called before OnBarUpdate(). What guarantee there is is that for every OnMarketData() there will be an OnBarUpdate() when using CalculateOnBarClose.

          If you want the current time as a tick comes in during realtime you could try using DateTime.Now.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_Josh View Post
            There is no guarantee that OnMarketData() will be called before OnBarUpdate(). What guarantee there is is that for every OnMarketData() there will be an OnBarUpdate() when using CalculateOnBarClose.

            If you want the current time as a tick comes in during realtime you could try using DateTime.Now.
            That's a shame. Why is there a bar update for every market data? Isn't a bid update a market data event that would have no bar update?

            I specifically said 'during market replay'. Are you saying there's no way to get the time of a tick during market replay? The T&S window has it? Why is it so hard for Ninja Script to have it?

            Comment


              #7
              Sorry for the confusion. For ever Last event in OnMarketData() you will get one in OnBarUpdate().

              It is not hard to get it in NinjaScript. Its in e.Time for OnMarketData and Depth.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_Josh View Post
                Sorry for the confusion. For ever Last event in OnMarketData() you will get one in OnBarUpdate().

                It is not hard to get it in NinjaScript. Its in e.Time for OnMarketData and Depth.
                It is hard to get if you want to use it as part of your strategy, which I do. Strategy is driven by OnBarUpdate, and it's impossible to get it in OnBarUpdate. I'd say that was hard!

                Comment


                  #9
                  What is your end game requirement for getting these timestamps then? You still have the option to get them from a secondary bars object.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    OK, so I need to add a 1 tick secondary bar object. So I probably need to set my 10 min bar to calc on close true, and run everything of the one tick bar update?

                    I still think it's a lot of effort for something that sounds easy to supply.

                    thanks for your help
                    Dave

                    Comment


                      #11
                      Dave, yes I think that's the best way to go - http://www.ninjatrader-support.com/H...struments.html
                      BertrandNinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by andrewtrades, Today, 04:57 PM
                      1 response
                      8 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Started by chbruno, Today, 04:10 PM
                      0 responses
                      6 views
                      0 likes
                      Last Post chbruno
                      by chbruno
                       
                      Started by josh18955, 03-25-2023, 11:16 AM
                      6 responses
                      436 views
                      0 likes
                      Last Post Delerium  
                      Started by FAQtrader, Today, 03:35 PM
                      0 responses
                      7 views
                      0 likes
                      Last Post FAQtrader  
                      Started by rocketman7, Today, 09:41 AM
                      5 responses
                      19 views
                      0 likes
                      Last Post NinjaTrader_Jesse  
                      Working...
                      X