> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# Connection

## Definition

The Connection class can be used to monitor connection related events as well as accessing connection related information.

## Static Connection Class Events and Properties

| Method                                                                                                     | Description                                 |
| ---------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| [CancelAllOrders()](/developer/desktop-sdk/references/add-on/connection-class/cancelallorders)             | Cancels all orders                          |
| [Connect()](/developer/desktop-sdk/references/add-on/connection-class/connect)                             | Connects to a connection                    |
| [ConnectionStatusUpdate](/developer/desktop-sdk/references/add-on/connection-class/connectionstatusupdate) | Event handler for connection status updates |

## Events and Properties from Connection instances

| Property                                                                             | Description                                                                                                                                                                                                                                                               |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Accounts](/developer/desktop-sdk/references/add-on/account-class)                   | List of accounts from the connection                                                                                                                                                                                                                                      |
| [Disconnect()](/developer/desktop-sdk/references/add-on/connection-class/disconnect) | Disconnects from the connection                                                                                                                                                                                                                                           |
| [Options](/developer/desktop-sdk/references/add-on/account-class/connectoptions)     | The connection's configuration options                                                                                                                                                                                                                                    |
| [PriceStatus](/developer/desktop-sdk/references/add-on/connection-class/pricestatus) | A ConnectionStatus representing the status of the price feed. Possible values are:<br />• ConnectionStatus.Connected<br />• ConnectionStatus.Connecting<br />• ConnectionStatus.ConnectionLost<br />• ConnectionStatus.Disconnecting<br />• ConnectionStatus.Disconnected |
| [Status](/developer/desktop-sdk/references/add-on/connection-class/status)           | A ConnectionStatus representing the status of the order feed. Possible values are:<br />• ConnectionStatus.Connected<br />• ConnectionStatus.Connecting<br />• ConnectionStatus.ConnectionLost<br />• ConnectionStatus.Disconnecting<br />• ConnectionStatus.Disconnected |

## Examples

```csharp
// Example of accessing information on all connected connections  
public class MyAddOnTab : NTTabPage  
{  
  public MyAddOnTab()  
  {  
    // Print information about all connected connections  
    lock (Connection.Connections)  
      foreach(Connection c in Connection.Connections)  
          NinjaTrader.Code.Output.Process(string.Format("Connection: {0} Provider: {1}", c.Options.Name, c.Options.Provider), PrintTo.OutputTab1);  
   
    // Other required NTTabPage members left out for demonstration purposes. Be sure to add them in your own code.  
  }  
}
```