Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reading the current Market Replay time

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

    Reading the current Market Replay time

    From within a NinjaScript is there a way to programmatically read the current Market Replay time - that is, the current running (or paused) time which is displayed at the top of the Market Replay window next to the word "Replay"?

    I'm able to access the time from candle data, but that is not sufficient for my purpose.

    Thanks!

    #2
    Originally posted by cmt_Robert View Post
    From within a NinjaScript is there a way to programmatically read the current Market Replay time - that is, the current running (or paused) time which is displayed at the top of the Market Replay window next to the word "Replay"?

    I'm able to access the time from candle data, but that is not sufficient for my purpose.

    Thanks!
    I honestly don't think that is possible.

    You might be able to with AutoIt3 or some other scripter type hack job... but then it wouldn't be "for real", now would it??

    Comment


      #3
      Originally posted by cmt_Robert View Post
      From within a NinjaScript is there a way to programmatically read the current Market Replay time - that is, the current running (or paused) time which is displayed at the top of the Market Replay window next to the word "Replay"?

      I'm able to access the time from candle data, but that is not sufficient for my purpose.

      Thanks!
      Code:
      DateTime now = (Bars.MarketData.Connection.Options.Provider == Cbi.Provider.Replay ? Bars.MarketData.Connection.Now : DateTime.Now);

      Comment


        #4
        Originally posted by koganam View Post
        Code:
        DateTime now = (Bars.MarketData.Connection.Options.Provider == Cbi.Provider.Replay ? Bars.MarketData.Connection.Now : DateTime.Now);

        Bookmarked...although I'm not sure what can be gain??!

        Maybe the ToS prophet analyzer is being developed here in NT_REPLAY!?

        Comment


          #5
          Hello cmt_Robert,

          Thank you for your post.

          In NinjaTrader 7 it is Bars.MarketData.Connection.Now.
          In NinjaTrader 8 it is Cbi.Connection.PlaybackConnection.Now.

          Comment


            #6
            Originally posted by sledge View Post
            Bookmarked...although I'm not sure what can be gain??!

            Maybe the ToS prophet analyzer is being developed here in NT_REPLAY!?
            Mostly to determine the elapsed chart time, because it is possible to pause Market Replay. Using this ensures that when you restart, your relative times are still correct.

            "Multi-time frame" you say? Sure, but that is more resource intensive.

            Comment


              #7
              Could someone at Support (or community) advise what this should be updated to for today's NinjaTrader 8.0.26.0 ?

              old/was, that does not compile anymore:

              a) DateTime now = (Bars.MarketData.Connection.Options.Provider == Cbi.Provider.Replay ? Bars.MarketData.Connection.Now : DateTime.Now);

              I've got a partial update for NinjaTrader 8.0.26.0, but I'm still missing the "what" and "what.for.ReplayConnection" below:

              b) DateTime now = what == what.for.ReplayConnection ? Connection.PlaybackConnection.Now : DateTime.Now;


              Thanks for your help!


              Comment


                #8
                Hello yodaler,

                You can reference the BarTimer indicator source code, and what you're looking for would be:

                Code:
                DateTime now = (Cbi.Connection.PlaybackConnection != null ? Cbi.Connection.PlaybackConnection.Now : Core.Globals.Now);
                Let us know if there is anything else we can do to help.
                Last edited by NinjaTrader_ChelseaB; 12-15-2022, 04:31 PM.

                Comment


                  #9
                  Very nice. This solves many issues.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  568 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  330 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
                  548 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  548 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X