Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 AaronKoRn, Today, 09:49 PM
        0 responses
        7 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Today, 08:42 PM
        0 responses
        9 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Today, 07:51 PM
        0 responses
        10 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,980 views
        3 likes
        Last Post jhudas88  
        Started by rbeckmann05, Today, 06:48 PM
        0 responses
        9 views
        0 likes
        Last Post rbeckmann05  
        Working...
        X