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 doihaveto13, Today, 12:46 PM
        2 responses
        4 views
        0 likes
        Last Post doihaveto13  
        Started by Vitamite, Today, 12:48 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by lorem, 04-25-2024, 09:18 AM
        15 responses
        64 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by owen5819, 05-11-2024, 02:24 PM
        3 responses
        21 views
        0 likes
        Last Post owen5819  
        Started by MrAdamSK, 04-02-2024, 11:25 PM
        3 responses
        41 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Working...
        X