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

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.
                JimNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Mongo, Today, 11:05 AM
                0 responses
                1 view
                0 likes
                Last Post Mongo
                by Mongo
                 
                Started by Tim-c, Today, 10:58 AM
                0 responses
                1 view
                0 likes
                Last Post Tim-c
                by Tim-c
                 
                Started by traderqz, Yesterday, 09:06 AM
                3 responses
                22 views
                0 likes
                Last Post NinjaTrader_ThomasC  
                Started by f.saeidi, Today, 10:19 AM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by kujista, Today, 06:23 AM
                5 responses
                18 views
                0 likes
                Last Post kujista
                by kujista
                 
                Working...
                X