Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cbi.Connection

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

    Cbi.Connection

    NT Team,

    The below snippet identifies where the Connection is to Market Replay.
    Code:
    if (Cbi.Connection.PlaybackConnection != null)
     { do something }
    Is there a similar snippet which identifies where the Connection is Live or to Market Replay? Or more simply, where there is any Connection?

    (I am unsure of the behaviour of "Cbi.Connection.ClientConnection")

    #2
    Hello Shansen.

    Thank you for the post.

    You can use OnConnectionStatusUpdate to get all information about your current connection:



    Code:
    private void OnConnectionStatusUpdate(ConnectionStatusEventArgs e)
        	{
    	        /* For multi-threading reasons, work with a copy of the ConnectionStatusEventArgs to prevent situations
    	         where the ConnectionStatusEventArgs may already be ahead of us while in the middle processing it. */
    	        ConnectionStatusEventArgs eCopy = e;
    			
    			Print(eCopy.Connection.Options.Name);
    
    }
    Please let us know if we may be of any further assistance.

    Comment


      #3
      For completeness, what is Cbi.Connection.ClientConnection?

      Comment


        #4
        Hello. Thank you for the reply.

        This item is used internally in NinjaTrader, it is not documented so It is not meant to be used in a script.

        Please let us know if you have any questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        43 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        20 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        29 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        46 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        38 views
        0 likes
        Last Post CarlTrading  
        Working...
        X