Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

timestamp granularity

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

    timestamp granularity

    I note the the trace logs show time in milliseconds

    I would like to access milliseconds from code via the trade timestamps. This has nothing to do with bid/ask, etc. I just need more accurate time...i.e. sequence is of little importance

    Is this possible with a Zenfire feed?

    thanks

    #2
    Hello ATI user,

    Thank you for your post.

    Unfortunately this option is not available at this time within NinjaTrader however, I will forward this to our development team for future considerations.
    Christopher J.NinjaTrader Customer Service

    Comment


      #3
      Note: If you want PC clock time the moment you receive an event you can use DateTime.Now which I believe has milliseconds. Otherwise accessing timestamps like Time[0] will unfortunately not be available with millisecond granularity.
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        thanks Josh

        Comment


          #5
          Josh

          Print (DateTime.Now); returns seconds from OnBarUpdate

          which specific 'event' did you have in mind that would return milliseconds?

          thanks

          Comment


            #6


            Granularity is 10 milliseconds. You need to be actually accessing the millisecond property of it.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              ATI User,

              Use something like the following,

              ---------------------------------------------------------------
              #region Variables

              private DateTime MicroSeconds;

              private string format = "hh.mm:ss.fff";

              private string formatfff = "fff";
              -----------------------------------------------------------------
              protected override void OnMarketData(MarketDataEventArgs e)

              or

              protected override void OnBarUpdate()



              MicroSeconds = DateTime.Now;

              string MicroTimeStamp = MicroSeconds.ToString(format);

              string MicroTimeStampfff = MicroSeconds.ToString(formatfff);

              -------------------------------------------------------------

              Use Print command to verify timestamp format.


              RJay
              RJay
              NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

              Comment


                #8
                thanks RJay

                wish I had seen your post 30 mins ago...I fumbled around and got something similar...

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Hwop38, 05-04-2026, 07:02 PM
                0 responses
                162 views
                0 likes
                Last Post Hwop38
                by Hwop38
                 
                Started by CaptainJack, 04-24-2026, 11:07 PM
                0 responses
                312 views
                0 likes
                Last Post CaptainJack  
                Started by Mindset, 04-21-2026, 06:46 AM
                0 responses
                245 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by M4ndoo, 04-20-2026, 05:21 PM
                0 responses
                350 views
                0 likes
                Last Post M4ndoo
                by M4ndoo
                 
                Started by M4ndoo, 04-19-2026, 05:54 PM
                0 responses
                179 views
                0 likes
                Last Post M4ndoo
                by M4ndoo
                 
                Working...
                X