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 rhyminkevin, Yesterday, 04:58 PM
        5 responses
        62 views
        0 likes
        Last Post dp8282
        by dp8282
         
        Started by realblubb, Today, 09:28 AM
        0 responses
        2 views
        0 likes
        Last Post realblubb  
        Started by AaronKoRn, Yesterday, 09:49 PM
        1 response
        18 views
        0 likes
        Last Post Rikazkhan007  
        Started by ageeholdings, Today, 07:43 AM
        0 responses
        12 views
        0 likes
        Last Post ageeholdings  
        Started by pibrew, Today, 06:37 AM
        0 responses
        4 views
        0 likes
        Last Post pibrew
        by pibrew
         
        Working...
        X