Features
Now, let’s take a look at how to add Angel One account in Stocks Developer.
Our system integrate with Angel Broking using their Smart API. Hence, you must generate an API key by registering to Angel Broking Smart API.
Platforms
Angel account can be onboarded in following ways:
- SMART_API => This integration uses Angel’s Smart API & it is the recommended platform
- SMART_API_M => This integration also uses Smart API, however it uses OAuth based login which requires you to manually login into your account once in a day before you start trading. This approach does not require your trading account credentials.
We have given below details of each platform.
SMART_API Platform [Recommended]
Here’s the demo video of the setup process, followed by each step mentioned in detail.
Demo video
How to generate Smart API private key?
Note: Set-up process including TOTP is one time activity. No need to do it everyday.
- Go to https://smartapi.angelbroking.com/ & sign up.
- Click Add App button
- App Name: MyTradingApp (do not give any space in the app name)
- Redirect URL: https://webx.stocksdeveloper.in/auth/angel
- Postback URL: https://apix.stocksdeveloper.in/postback/angel
- Static IP: See below “Static IP Setup“
- Click the Create App button
- To view your API Key. Go to menu (My Profile -> My APIs)
- Go to AutoTrader Web menu (Settings -> Trading Accounts)
- Click Create button
- Select Broker: Angel
- Add your login id & MPIN (the one that you use on https://trade.angelone.in/)
- Add TOTP Key
- Add API Key generated in previous step (click view button in smartapi dashboard). It is displayed on top.
- Click Validate button
- Once you see a success message, click Save button
How to activate TOTP?
Note: Set-up process including TOTP is one time activity. No need to do it everyday.
- Generate TOTP Secret Key
- Install Google Authenticator app on your phone
- We need the secret key that is provided by Angel Smart API when you enable the TOTP
- Login to (https://smartapi.angelbroking.com/enable-totp)
- Enter OTP received in sms/email
- Now you will see a QR Code & Secret Key
- Scan this QR Code in Google Authenticator (this will be useful for your manual login)
- Save the Secret Key or keep this page open
- Copy the TOTP Key in AutoTrader Web
- In AutoTrader Web, go to menu (Settings -> Trading Accounts)
- Click on your Angel login id (to go to edit mode)
- You will see that there is a new field called TOTP Secret Key
- You need to copy the secret TOTP key to TOTP Secret Key (field)
- Click Validate & Save
SMART_API_M Platform [OAuth]
Steps in brief
- This method does NOT need TOTP setup
- Setup Angel’s Smart API as explained here
- Once you do the API setup, you will get API Key is all we need
Add Angel account to the system
- Go to menu (Settings -> Trading Accounts)
- Click Create button
- Select Broker => Angel
- Select Platform => SMART_API_M
- Add API Key
- Click Validate
- You will be redirected to Angel website
- On successful login to Angel, your account will be saved
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?“