Features
Now, let’s take a look at how to add Dhan account in Stocks Developer.
Letβs understand how to add a Dhan account in AutoTrader Web.
AutoTrader Web uses Dhan trading APIs which are complete FREE.
Demo
Step 1 – Generate API Key
- Login to Dhan trading website
- Open menu on top right by clicking your profile picture
- Click Dhan HQ Trading APIs
- By default, it shows you “Access Token“. You need to switch to “API key” by clicking the toggle button.
- API Details:
- Application Name: MyTradingApp
- Redirect Url: https://webx.stocksdeveloper.in/auth/dhan
- Postback Url: https://apix.stocksdeveloper.in/postback/dhan
- Static IP: See below βStatic IP Setupβ
- Click Generate API Key (See screenshots below)
Step 2 – Setup TOTP
The same API page has an option to setup TOTP.
- Enable TOTP
- Scan the QR code in your authenticator app like “Google Authenticator”
- Important: Copy the TOTP Key (long 15 to 30 random characters)
- Save TOTP Key as we will need it in next step
- Click Enable TOTP button
Step 3 – Add your Dhan account
- Go to AutoTrader Web menu (Settings -> Trading Accounts)
- Click Create button
- Select Broker as Dhan
- Select Platform as DHAN_V2_AT_IPV6
- Dhan Client ID
- MPIN
- TOTP Key
- 10 digit Phone number registered with Dhan account
- API Key (shown on Dhan API screen)
- API Secret (shown on Dhan API screen)
- Give a nickname
- Click Validate & Save
- Thatβs it, you have successfully added your Choice account. Do not forget to read these known limitations.
Screenshots
Static IP Setup
This is a 2 step process:
1. Before Account Creation
- During creation of your API on the broker’s website, create API with a dummy IP address
- IP Type: IPv4
- Primary Static IP: Just google “what is my ip” & enter your IP (we will update this later, see below section “Static IP Setup”)
- Algo Registration Type: Non-Registered
- Now add your account in our system (as explained above) & then come back to Step 2 given below.
2. After Account Creation
Once your account is added in our system, then do the following:
- Get Static IP
- In our system, go to menu (Settings -> Trading Account)
- Click the “Pencil icon” next to your account to EDIT it
- Click “Get Static IP” button
- You will get static IPs unique to your account
- Assign Static IP in our newly created API on broker’s API screen
- IP Type: IPv6
- Primary Static IP: (You will be shown in the EDIT screen)
- Secondary Static IP: (You will be shown in the EDIT screen)
- Algo Registration Type: Non-Registered (less than 10 orders / second)
For further help, check this YouTube video showing “How to map Static IP?“