MyAlgoGuru Help
Education Glossary Open the app
Help/Reference/Foundation

Broker Connectivity & Account Management

Connect one or more broker accounts (Dhan, Upstox, Axis Securities), authenticate them, and choose which account feeds live market data — a common experience across every broker.

Where you will find this

Broker connect / OAuth redirect, Compliance & Algo-ID setup, Broker accounts, Broker master & capabilities, Connection & session health.

Purpose

MyAlgoGuru talks to your broker through an adapter, so orders, positions and market data look the same whoever the broker is. You add an account, authenticate it (OAuth redirect or API token depending on the broker), and it becomes available for trading. One account is your live data feed — Upstox by default when present.

Credentials & compliance

Broker credentials are encrypted at rest and never shown back to you. Live trading additionally depends on static-IP whitelisting with your broker and an Algo-ID registered for automated orders — both part of the SEBI/NSE retail-algo requirements.

The Broker Connectivity & Account Management module enables MyAlgoGuru to connect with one or more supported brokers, authenticate trading accounts and maintain active broker sessions for order execution and market interaction.

It provides the foundation for all trading-related functionality within the application.

Objectives

The module will:

  • Support connectivity with multiple broker platforms.
  • Allow users to configure one or more broker accounts.
  • Manage broker authentication.
  • Maintain broker sessions.
  • Monitor broker connectivity.
  • Provide broker account information to other business modules.
  • Abstract broker-specific implementations behind a common business model.

Functional Scope

The module includes:

  1. Broker Master
  2. Broker Account Configuration
  3. Broker Authentication
  4. Broker Session Management
  5. Broker Connection Monitoring
  6. Broker Account Discovery
  7. Broker Capability Management
  8. Multi-Broker Support
  9. Broker Health Monitoring

Supported Broker Model

The platform will support integration with multiple broker providers.

Each broker integration will operate independently.

The addition of new brokers does not affect existing broker integrations.

Broker Master

The platform will maintain a master list of supported brokers.

Each broker definition will maintain business information including:

  • Broker Name
  • Broker Type
  • Operational Status
  • Supported Features
  • Connection Status

The Broker Master is centrally managed.

Broker Account Configuration

You can configure one or more broker accounts.

Each configured account will belong to a supported broker.

Users may configure:

  • Multiple accounts with different brokers.
  • Multiple accounts where supported by the broker.

Every configured broker account remains independent.

Broker Authentication

Each configured broker account will support authentication with the respective broker.

Authentication will establish a broker trading session.

Authentication success is recorded.

Authentication failure is reported.

Broker Session Management

The platform will maintain broker sessions independently for every configured broker account.

The platform will support:

  1. Login
  2. Logout
  3. Session Validation
  4. Session Expiry Detection
  5. Session Renewal
  6. Session Status Monitoring

Each broker account will maintain its own session lifecycle.

Broker Connection Status

Every broker account will maintain a connection status.

Typical statuses include:

  • Connected
  • Disconnected
  • Authentication Required
  • Session Expired
  • Connection Failed
  • Maintenance

Connection status is available throughout the application.

Broker Account Discovery

Following successful authentication, the platform will retrieve available trading account information from the broker where supported.

Retrieved information may include:

  • Trading Account
  • Client Identifier
  • Exchange Access
  • Product Availability

Broker account information will become available to authorised business modules.

Broker Capability Management

Each broker may support different business capabilities.

The platform will maintain capability information including, where applicable:

  1. Equity Trading
  2. Futures Trading
  3. Options Trading
  4. Commodity Trading
  5. Order Placement
  6. Order Modification
  7. Order Cancellation
  8. Position Retrieval
  9. Holdings Retrieval
  10. Margin Retrieval
  11. Option Chain Support
  12. Market Data Support

Business modules will utilise broker capability information before attempting operations.

Multi-Broker Support

The platform will support simultaneous connectivity to multiple brokers.

Each broker connection will operate independently.

Failure of one broker connection does not affect other connected brokers.

Business modules is capable of operating across multiple broker accounts.

Broker Health Monitoring

The platform will continuously monitor broker connectivity.

Health monitoring will detect conditions including:

  • Authentication Failure
  • Session Expiry
  • Connection Failure
  • Service Unavailability

Broker health information is available for operational monitoring.

Broker Availability

Broker availability will determine whether trading operations can be performed.

Business modules will verify broker availability before initiating trading activity.

Unavailable broker connections will prevent trading operations for the affected broker account only.

Broker Logout

You can terminate broker sessions.

Logout will invalidate the broker session.

Trading operations will no longer be permitted until successful authentication is performed again.

Broker Account Ownership

Every configured broker account will belong to a user within the current application deployment.

Ownership is maintained throughout the lifecycle of the broker account.

Historical ownership information is preserved.

Broker Usage

Configured broker accounts is available for use by authorised business modules including:

  • Manual Trading Terminal
  • Strategy Execution
  • Webhook Signal Execution
  • Order Management
  • Position Management
  • Portfolio Management
  • Risk Management

Business Rules

  • Every broker account will belong to one supported broker.
  • Every broker account will belong to one application deployment.
  • Broker authentication is completed before trading operations are permitted.
  • Every broker account will maintain an independent session.
  • Broker connection failures does not affect other broker accounts.
  • Business modules will verify broker availability before execution.
  • Broker logout will terminate trading capability for that broker account.
  • Historical broker ownership will always be preserved.
  • Broker capability will determine whether a business operation is permitted.

Audit Requirements

The platform will maintain an audit trail for broker connectivity activities.

Audit events includes, where applicable:

  • Broker Account Configuration
  • Broker Authentication
  • Broker Logout
  • Session Expiry
  • Session Renewal
  • Connection Failure
  • Connection Recovery
  • Broker Status Changes

Historical audit records is preserved.

Out of Scope

The following are outside the scope of this module:

  • Order Placement Logic
  • Trading Strategies
  • Risk Validation
  • Portfolio Analytics
  • Position Management
  • Market Data Processing
  • Broker-specific implementation details

These are addressed in their respective business modules.

The Paper Trading account

Paper Trading is an account like any other in the list, except that its fills are simulated. It has a switch, and its owner holds that switch: turning it off hides its books without deleting anything, and turning it back on returns them.

  • A paper position is a simulated position in the Paper account. There is no broker book behind it, so it is reconciled against the simulated book rather than a real one.
  • A paper order needs no broker order id, because no broker ever saw it.
  • Automations can submit to a paper account, which is how a strategy is watched live without committing money.
Square off means two different things

The control carries one label and runs two paths: a paper deployment is squared in the simulated book, a live one at the broker. Worth being explicit about which account a deployment is on before describing what squaring it off will do.

How each broker signs in

Every broker is reached through an adapter, so orders, positions and market data look the same whoever the broker is. Authentication is where they differ, and the differences are real rather than cosmetic.

  • Some brokers use an OAuth redirect. A few need a client id entered first; a couple need no fields at all before the redirect.
  • Some publish a non-browser credential login, which lets a node sign itself in unattended from a stored seed. Not every broker offers this, and the ones that do not cannot be automated this way.
  • Token lifetimes differ sharply. At least one expires in minutes rather than daily and is renewed by a background worker — so "I was logged in a moment ago" is not evidence that something is broken.
  • Disconnecting tells the broker, ending the session there rather than only forgetting it locally.
  • A second login no longer retires the first, so more than one broker account can be connected at once.
Green means available

A green account means the broker session is live and the account is usable — not merely that a record exists. A healthy session is still not the same as a warm instrument master: a cold master rejects orders even on a connected account.

Connect a broker account

  1. Add an account and pick the broker.
  2. Enter the required credentials (an API key/secret, or complete the OAuth redirect) — the fields adapt to the broker.
  3. Authenticate. A green status means the session is live and the account can trade.
  4. Optionally set this account as your live data feed using the radio next to it.