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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        52 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        142 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        160 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        96 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X