Skip to main content

Manage Trading Accounts

List, enable, disable, and disconnect your trading accounts.

List Trading Accounts

Retrieve all connected trading accounts:

response = trading_account_api.list_trading_accounts()
accounts = response.data

for account in accounts:
print(f"{account.trading_account_id}")
print(f" Venue: {account.venue}")
print(f" Type: {account.account_type}")
print(f" Status: {account.status}")
print(f" Nickname: {account.nickname}")

Filter by Venue

response = trading_account_api.list_trading_accounts(
venue=cadenza_client.Venue.BINANCE
)

Filter by Status

response = trading_account_api.list_trading_accounts(
status=cadenza_client.TradingAccountStatus.CONNECTED
)

Enable Trading Account

Enable a disabled trading account to resume trading:

response = trading_account_api.enable_trading_account(
cadenza_client.EnableTradingAccountRequest(
trading_account_id=trading_account_id
)
)

account = response.data
print(f"Status: {account.status}") # ENABLED

Disable Trading Account

Temporarily disable a trading account. This prevents new orders but doesn't affect existing positions:

response = trading_account_api.disable_trading_account(
cadenza_client.DisableTradingAccountRequest(
trading_account_id=trading_account_id
)
)

account = response.data
print(f"Status: {account.status}") # DISABLED

When to Disable

  • Maintenance - Temporarily pause trading during system maintenance
  • Risk Management - Quickly stop new orders during high volatility
  • Investigation - Pause trading while reviewing account activity

Disable vs Disconnect

ActionEffectReversible
DisablePrevents new orders, keeps connectionYes (Enable)
DisconnectRemoves account completelyNo (must reconnect)

Disconnect Trading Account

Permanently disconnect a trading account from Cadenza:

response = trading_account_api.disconnect_trading_account(
cadenza_client.DisconnectTradingAccountRequest(
trading_account_id=trading_account_id
)
)

print(f"Disconnected: {response.data.status}") # DISCONNECTED

Disconnection Effects

EffectDescription
StatusAccount status becomes DISCONNECTED
OrdersOpen orders remain on exchange
PortfolioNo longer synced in Cadenza
WebSocketSubscription channels closed
CredentialRemains active (can connect other accounts)
warning

Disconnection is permanent. To reconnect, you must call connectTradingAccount again.

Update Trading Account

Update the nickname of a trading account:

response = trading_account_api.update_trading_account(
cadenza_client.UpdateTradingAccountRequest(
trading_account_id=trading_account_id,
nickname="New Nickname"
)
)

account = response.data
print(f"Updated nickname: {account.nickname}")

Account Operations History

View the history of operations on a trading account:

response = trading_account_api.list_trading_account_operations(
trading_account_id=trading_account_id
)

for operation in response.data:
print(f"{operation.operation_type}: {operation.created_at}")

Error Handling

Error CodeDescription
400Invalid request parameters
401Authentication required
404Trading account not found
409Cannot disable account with open orders
422Invalid state transition