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 CarlTrading, 03-31-2026, 09:41 PM
                1 response
                82 views
                1 like
                Last Post NinjaTrader_ChelseaB  
                Started by CarlTrading, 04-01-2026, 02:41 AM
                0 responses
                43 views
                0 likes
                Last Post CarlTrading  
                Started by CaptainJack, 03-31-2026, 11:44 PM
                0 responses
                64 views
                2 likes
                Last Post CaptainJack  
                Started by CarlTrading, 03-30-2026, 11:51 AM
                0 responses
                68 views
                0 likes
                Last Post CarlTrading  
                Started by CarlTrading, 03-30-2026, 11:48 AM
                0 responses
                56 views
                0 likes
                Last Post CarlTrading  
                Working...
                X