Skip to main content

Dhan

How To Connect Your Dhan Account ?

Buildalgos.com simplifies algorithmic trading by offering easy integration with multiple brokers, including Dhan.
This guide walks you through the steps to connect your Dhan account with Buildalgos, enabling you to automate your trading strategies effortlessly.


Step 1: Login to Your Dhan Account

  1. Go to https://login.dhan.co/ and log in with your Dhan credentials.
  2. Click on your profile picture in the top-right corner.
  3. Select Access DhanHQ API’s.

alt text

Step 2: Generate API Key

Important: Select API Key Mode

Before generating your keys, ensure the toggle is switched to API Key (NOT Access Token).

This is required because BuildAlgos authenticates using:

  • API Key
  • API Secret

If the toggle is left on Access Token, the generated keys will NOT work with BuildAlgos.

alt text


Step 3: Create App

  1. Click Generate.

alt text

  1. Under the Generate New API Key section, enter the following details:
  • Application Name
  • Redirect URL
  • Click Generate API Key
  1. Use the following Redirect URL (MANDATORY):
    https://buildalgos.com/login/Dhan/`your_account_name`

    ⚠️ Important:
    The your_account_name must be the same Account Name you will enter later while adding your Dhan account on BuildAlgos (in Step 7).

    Example:
    If your Account Name is dhan1, then your Redirect URL will be:
    https://buildalgos.com/login/Dhan/dhan1

alt text


Step 4: Generate API Key

  1. After registration, you will receive:
    • API Key
    • API Secret
      Store them securely, you will need these keys to connect your Dhan account to Buildalgos.

Step 5: Login To Buildalgos.com

  1. Go to https://buildalgos.com/login
  2. Log in using your Buildalgos credentials.

alt text


Step 6: Add Broker

  1. Go to https://buildalgos.com/dashboard/brokers
  2. Click Add Broker
  3. Select Dhan from the list.

alt text


Step 7: Enter Credentials

  1. Client ID → Your Dhan account Client ID
  2. Account Name → Enter the same Account Name that you used while generating the Redirect URL in Step 3.
  3. API Key → API Key generated in Step 3
  4. API Secret → API Secret generated in Step 3
  5. Click Add Account.

alt text


Step 8: Start Trading!

  1. Once your broker is added, it will appear in your dashboard. Click Login.
  2. You will be redirected to the Dhan website — enter your login details.
  3. After successful authentication, Buildalgos will show “Logged In Successfully”.
  4. To start trading, click the Play icon under the Trade section.
  5. To stop/pause trading, click the Pause icon.
  6. Your Dhan account is now fully connected to Buildalgos!

By completing the steps in this guide, you've successfully set up your Dhan account to work with Buildalgos. You're now ready to optimize your strategies and make smarter, data-driven decisions. If you need help or run into any issues, feel free to consult the Buildalgos resources. Happy trading!