Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DateTime.Now vs Market Replay

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

    DateTime.Now vs Market Replay

    I have posted before re the time in the Orders and Executions showing the computer time instead of the time of the data.

    I now had the same issue occur when trying to use DateTime.Now (which will only picks up the current computer time) in Market Replay.

    Also, in market replay, DateTime gives a date from April instead of today's date (11 sep).

    So...I can not use my strategy in market replay as it will never be able to compare the DateTime.Now with the DateTime and get values that are meaningful.

    Will this be changed in NT7?

    Thanks.

    #2
    DateTime.Now is not related to anything in the Market Replay. It is a C# property and takes the current date and time as defined on your local computer.

    Gets a DateTime object that is set to the current date and time on this computer, expressed as the local time.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      DateTime.Now is not related to anything in the Market Replay. It is a C# property and takes the current date and time as defined on your local computer.

      http://msdn.microsoft.com/en-us/libr...etime.now.aspx
      OK, but what can we use in place of DateTime.Now that will work in both Market Replay and real time. There should be some way to access the replay time.

      I tried using Time[0], but that gives me the time at the end of the current bar, which is no good.

      I could compare the MarketDataEventArgs times to DateTime.Now, and take the difference, but this will not work if I pause or speed up the replay.

      I could use MarketDataEventArgs.MarketData.Last.Time, but if there are no trades for a while this will fall behind the actual replay time as well.

      I think I need a replacement for DateTime.Now anyway, since my local PC might get out of sync with the exchange time.

      Comment


        #4
        This is on our list already, thanks for the suggestion.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X