Skip to main content

Broker Health

The Broker Health feature in XeroLite provides real-time monitoring of your Interactive Brokers (IB) connection status. It displays connection information for each configured broker, including account numbers and account types, helping you quickly verify that XeroLite is properly connected to TWS or IB Gateway.

Overview

Broker Health shows:

  • Real-time connection status for each broker
  • Account numbers linked to each broker
  • Account types (e.g., Paper Trading, Live Account)
  • Visual status indicators (connected/disconnected)
  • Error messages and troubleshooting tips when connection fails

Accessing Broker Health

Broker Health is located in the left sidebar of the XeroLite interface:

  1. Log in to XeroLite
  2. Look at the left sidebar (if collapsed, click to expand)
  3. Find the Broker Health section at the top of the sidebar
  4. Connection status is displayed automatically

Understanding Broker Health Display

Expanded View

When the sidebar is expanded, Broker Health shows:

Overall Status Header

  • Connection Icon: Visual indicator (connected/disconnected image)
  • Status Badge: Colored dot indicator:
    • 🟢 Green: All brokers connected
    • 🟡 Yellow: Some brokers connected (partial connection)
    • 🔴 Red: All brokers disconnected
  • Status Text: "Connected" or "Disconnected"

Individual Broker Information

For each configured broker, you'll see:

  • Broker Name: Name of the broker connection
  • Account Numbers: List of account numbers linked to this broker
  • Connection Status Badge:
    • 🟢 "Connected" (green badge) - Broker is online and ready
    • 🔴 "Disconnected" (red badge) - Broker is offline
  • Account Type Badge: Account type (e.g., "PAPER", "LIVE", "N/A")
  • Info Icon (ℹ️): Hover to see detailed connection information or error messages

Collapsed View

When the sidebar is collapsed, Broker Health shows a compact view:

  • Small Icon: Connection/disconnection image
  • Status Dot: Colored indicator in the corner:
    • 🟢 Green: All connected
    • 🟡 Yellow: Partial connection
    • 🔴 Red: All disconnected
  • Tooltip: Hover to see "IBKR connected" or "IBKR disconnected"

Status Indicators

Connection Status Colors

ColorMeaningDescription
🟢 GreenAll ConnectedAll brokers are online and ready to receive orders
🟡 YellowPartial ConnectionSome brokers are connected, but not all
🔴 RedDisconnectedAll brokers are offline or connection failed

Status Badges

  • "Connected" (Green Badge): Broker is online and ready
  • "Disconnected" (Red Badge): Broker is offline or connection failed

Understanding Account Information

Account Numbers

Broker Health displays all account numbers linked to each broker:

  • Multiple Accounts: If a broker has multiple accounts, all are listed
  • Account Format: Account numbers are displayed exactly as configured in TWS
  • Finding Account Numbers: Use Broker Health to find account numbers for use in alert requests (see Multi-Account Support)

Account Types

The account type badge shows:

  • PAPER: Paper trading account (for testing)
  • LIVE: Live trading account (real money)
  • N/A: Account type not available or not detected

Error Messages and Troubleshooting

Common Error Messages

When you hover over the info icon (ℹ️) next to a disconnected broker, you may see:

"Enable ActiveX and Socket Clients" Error

Error Message: "Couldn't connect to TWS/IB Gateway."

Solution:

  1. Open TWS or IB Gateway
  2. Go to Edit → Global Configuration... → API → Settings
  3. Ensure "Enable ActiveX and Socket Clients" is checked ✅
  4. Set the connection port to 7497 (for paper trading) or 7496 (for live trading)
  5. Click OK to save
  6. Restart TWS/IB Gateway
  7. Check Broker Health again

Connection Failed

Error Message: "Connection failed"

Possible Causes:

  • TWS/IB Gateway is not running
  • Wrong port number configured
  • Firewall blocking connection
  • XeroLite cannot reach TWS/IB Gateway

Solutions:

  1. Verify TWS/IB Gateway is Running:

    • Ensure TWS or IB Gateway is open and logged in
    • Check that it's not minimized or hidden
  2. Check Port Configuration:

    • Verify the port in TWS matches XeroLite's connection settings
    • Default ports: 7497 (paper), 7496 (live)
  3. Check Firewall:

    • Ensure firewall allows connections on the configured port
    • Add XeroLite and TWS to firewall exceptions if needed
  4. Verify Network:

    • Ensure XeroLite and TWS are on the same machine or network
    • Check for network connectivity issues
  5. Restart Services:

    • Restart TWS/IB Gateway
    • Restart XeroLite
    • Check Broker Health again

Using Broker Health

Monitoring Connection Status

  1. Check Status Regularly:

    • Monitor Broker Health before placing orders
    • Verify connection is green before trading
    • Watch for status changes during trading sessions
  2. Before Placing Orders:

    • Ensure Broker Health shows "Connected" (green)
    • Verify the correct broker is connected
    • Check that account numbers are displayed correctly
  3. Troubleshooting Connection Issues:

    • Click the info icon (ℹ️) to see error details
    • Follow the troubleshooting steps in the tooltip
    • Refer to Connect XeroLite to IB for setup instructions

Finding Account Numbers

Broker Health is a quick way to find account numbers:

  1. Expand the sidebar (if collapsed)
  2. Look at the Broker Health section
  3. Find your broker in the list
  4. Note the account numbers displayed under the broker name
  5. Use these account numbers in alert requests with the acc_no field (see Multi-Account Support)

Multiple Broker Support

Understanding Multiple Brokers

XeroLite supports connecting to multiple brokers simultaneously:

  • Different TWS Instances: Connect to different TWS/IB Gateway instances
  • Different Accounts: Each broker can have different account numbers
  • Independent Status: Each broker's connection status is monitored independently

Status Indicators for Multiple Brokers

  • All Connected (🟢 Green): All brokers are online
  • Partial Connection (🟡 Yellow): Some brokers connected, some disconnected
  • All Disconnected (🔴 Red): No brokers are connected

Best Practices

  • Monitor All Brokers: Check status of all brokers before trading
  • Verify Correct Broker: Ensure orders are routed to the intended broker
  • Account Verification: Double-check account numbers match your expectations

Troubleshooting

Broker Health Shows Disconnected

Problem: Broker Health always shows "Disconnected" even when TWS is running

Solutions:

  1. Verify TWS/IB Gateway is running and logged in
  2. Check API settings in TWS (Enable ActiveX and Socket Clients)
  3. Verify port number matches (7497 for paper, 7496 for live)
  4. Check XeroLite connection settings
  5. Restart both TWS and XeroLite
  6. Review Connect XeroLite to IB guide

Account Numbers Not Displayed

Problem: Broker Health shows connected but no account numbers

Solutions:

  1. Verify TWS is properly logged in with account access
  2. Check that accounts are properly linked in TWS
  3. Restart TWS and XeroLite
  4. Verify account permissions in TWS

Status Changes Frequently

Problem: Connection status flickers between connected and disconnected

Solutions:

  1. Check network stability
  2. Verify TWS is not being restarted automatically
  3. Check for firewall or antivirus interference
  4. Review TWS connection logs
  5. Ensure stable network connection

Wrong Account Type Displayed

Problem: Account type shows "N/A" or incorrect type

Solutions:

  1. This is usually informational only and doesn't affect functionality
  2. Verify account type in TWS directly
  3. Account type detection may vary by TWS version

Summary

Broker Health provides essential connection monitoring:

  • ✅ Real-time connection status for all brokers
  • ✅ Account numbers and account types display
  • ✅ Visual status indicators (green/yellow/red)
  • ✅ Error messages with troubleshooting tips
  • ✅ Support for multiple brokers
  • ✅ Quick access to account information

Always check Broker Health before placing orders to ensure XeroLite is properly connected to Interactive Brokers.