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
            Gets a DateTime object that is set to the current date and time on this computer, expressed as the local time.


            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 Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                601 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                347 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                103 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                559 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                558 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X