Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

bar replay time

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

    bar replay time

    i used a work around to get the DateTime during barreplay so i can connect timestamp of specific events in my trading system during market replay. how can i do the same in NT8
    here is a function i used in NT 7 but cannot fathom how to do it in NT8
    Code:
    private DateTime currentTime()
            {
                DateTime a = DateTime.Now;
                try
                {
    
                    a = Bars.MarketData.Connection.Options.Provider == Cbi.Provider.Replay ? Bars.MarketData.Connection.Now : DateTime.Now;
                }
                catch (Exception e)
                {
    
                    Print( "There was an error : Printfing datetime" + e.ToString());
                    Print( e.StackTrace);
    
    
    
                }
                return a;
            }

    #2
    Hello junkone,

    For NinjaTrader 8, use Cbi.Connection.PlaybackConnection.Now.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      how do I check if I am in a playback mode?

      Comment


        #4
        Hello junkone,

        You can find the connection name through the OnConnectionStatusUpdate event with the ConnectionStatusEventArgs.Connection.Options.Name

        Below is a link to an example.
        http://ninjatrader.com/support/forum...140#post462140
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, Today, 06:46 AM
        0 responses
        9 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, Yesterday, 05:21 PM
        0 responses
        14 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        15 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        82 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        48 views
        0 likes
        Last Post PaulMohn  
        Working...
        X