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

# Disconnect()

## Definition

Disconnects from the data connection.

## Syntax

`\<connection\>.Disconnect()`

## Examples

```csharp
private void OnExecutionUpdate(object sender, ExecutionEventArgs e)
{
   // If an execution triggers after 9pm, disconnect from the account's data source
   if (e.Time > new DateTime(now.Year, now.Month, now.Day, 21, 0, 0))
       myAccount.Connection.Disconnect();
}
```