> 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.

# ConnectOptions

## Definition

**ConnectOptions** is an abstract class used to configure options for a specific configured [Connection](/developer/desktop-sdk/references/add-on/account-class/connection). An instance of **ConnectOptions** can be passed into the **Connection.Connect()** method to initiate a connection, as seen in the example below.

For a complete, working example of this class in use, download the framework example located on our [Developing AddOns Overview](/developer/desktop-sdk/guides/educational-resources/addon-development-overview/developing-add-ons).

## Properties

Properties accessible from an instance of **ConnectOptions** include:

***

* BrandName
* A string representing the provider name

***

* CanEnableHds
* A bool determining the connection can use NinjaTrader Historical Data Servers. Related properties include **HasHdsAlwaysEnabled** and **IsHdsEnabled**

***

* CanManageOrders
* A bool determining orders can be managed on the Connection. Related properties include **IsDataProviderOnly**

***

* Mode
* A **NinjaTrader.Cbi.Mode** object representing the current mode of the connection (**Mode.Live** or **Mode.Simulation**)

| Name | The user-configured name of the Connection | Provider | The provider configured in the Connection |
| ---- | ------------------------------------------ | -------- | ----------------------------------------- |

## Examples

```csharp
// Connecting to a configured connection
private Connection Connect(string connectionName)
{
    // Get the configured account connection by using the string passed into this custom Connect() method
    // We will lock the ConnectOptions collection to avoid in-flight changes causing any issues
    ConnectOptions connectOptions = null;
    lock (Core.Globals.ConnectOptions)
        connectOptions = Core.Globals.ConnectOptions.FirstOrDefault(o => o.Name == connectionName);
 
    // If connection is not already connected, connect to it
    lock (Connection.Connections)
        if (Connection.Connections.FirstOrDefault(c => c.Options.Name == connectionName) == null)
        {
            Connection connect = Connection.Connect(connectOptions);
 
            // Only return connection if successfully connected
            if (connect.Status == ConnectionStatus.Connected)
                return connect;
            else
                return null;
        }
}
```