DhanHQ Update : Safer participation of retail investors in Algo Trading - Static IP, MPP & Rate Limits

Hello API & Algo Traders,

Over the last few months, there has been a lot of discussion around the new regulatory framework for retail algorithmic trading in India. The intent from regulators and exchanges has been very clear: enable innovation and participation in algo trading, while ensuring the ecosystem remains safe, transparent, and fair for all market participants. We have been discussing these too with all of our users on this community & across channels.

At Dhan, we have been actively working behind the scenes to ensure our systems, APIs, and infrastructure are aligned with the upcoming regulatory requirements. As we discussed the same on all the possible changes back in September (Guidelines on Algorithmic Trading for Retail Traders), we are now close to the final implementation stage for them. Most of these changes will happen seamlessly for you, but there are a few important updates that you should be aware of to remain compliant and continue trading smoothly.

Below are the key changes that will be implemented soon as part of the upcoming deadline of 31st March, 2026:

1. Market Price Protection (MPP) on APIs

Implementation Date: 21st March

Market orders will no longer be allowed through APIs as per the regulatory framework.

Going forward, whenever a market order is sent through APIs, it will automatically be converted into a limit order with Market Price Protection (MPP) applied. The limit price will be calculated within a predefined MPP range. Since market orders will now convert to limit orders, it is important that your strategy or system checks the order execution status at your end.

2. Updated Rate Limits for Orders API

Implementation Date: 21st March

As part of the regulatory framework, the maximum order rate limit has been revised. The rate limit for placing orders through APIs will change to 10 orders per second.

Earlier, the limit was 25 orders per second. If you are running high-frequency strategies or batch order placements, you should review your strategy logic and ensure it remains within the updated rate limits.

3. Static IP Whitelisting

Implementation Date: 1st April

To improve accountability and security in algorithmic trading, Static IP registration will now be mandatory for API trading. All API orders must originate from registered static IP addresses.

You need to register your static IP address on the Dhan (web.dhan.co or DhanHQ API). If you are using third-party algo tools or platforms, make sure they are using a static IP that is registered for your account

From the date of implementation of this new framework, orders originating from unregistered IP addresses will not be accepted.This is an important step towards creating a safer and more accountable algo trading ecosystem. You must have already started receiving alerts from Dhan, if you have not yet configured static IP or using different IP then the one registered.

The objective behind these changes is to prevent unintended trades, reduce operational risks, bring more transparency to algorithmic trading & scale retail participation in algos

At Dhan, we have ensured that all required infrastructure and platform changes are already in place so that you can continue building and running your strategies smoothly. All you need to do is make the few adjustments mentioned above to stay compliant and keep trading without interruptions.

If you have any questions or need help implementing these changes, feel free to ask in this thread or reach out to our support team at apihelp@dhan.co.

The future of retail algo trading in India is just getting started. And we are here to ensure your setups are compliant and ready for all possibilities in the market.

3 Likes

Can we configure a local host and get rid of the problem of static ip idea is not to spend on any third party service and use local laptop for executing the current algo.

Hello @Dpwd

Even in this scenario, your ISP will provide an IP which will be captured. And this is where you can ask your ISP to give you a static IP instead.

Can we get increased Orders per second limit if we register our algo according to the guidelines?

@Chaxu_Garg Read point#3 here.

The future of retail algo trading in India is just getting started and ended with th Statics ip rules

2 Likes

Hi, how your infrastructure manage basket orders through API? I trade bull call or bear put spread and I place my buy order first and them sell orders, I place them at market so I get the good execution and I don’t get stopped out on my sell order due to margin. Any thought given to margin calculation where market orders may affect the margin utilisation?

Use oracle cloud instances, cheap and efficient, you get static ip for each compute instance.

How will TradingView users executing their orders through Dhan webhook handle these requirements ?

I read it, there has been no update on it after that post, if I want to register my algo what is the process @Hardik

@Hardik please update the plan for Dhan webhook users. Thanks.

Hey @Bhavin_J

Webhooks will continue to be used as it has been till now, no changes related to APIs will impact webhooks.

1 Like

Hi Hardik, any plans to bring Super orders on Webhooks?

Hi @jaison two big updates are expected on Super Orders soon, post that we will consider bringing this on Webhooks as well.

2 Likes

Have you moved the 21st march deadline? My market orders were proceed without converting to limit orders on 23rd March.

@Hardik @PravinJ Hi are there any plans that @Dhan will launch renting static ip just like algo test or quantman platforms offering, just want to know any such ideas in planning level.

1 Like

Hello @Chandrashekar_Nagraj @Rem_555

All API changes are live now, added an update - Now Live: API Regulatory Changes on DhanHQ

No, but we are trying to simplify the entire stack for an algo trader, you will be hearing from us soon

Hello @Hardik , Dhan Team,

I’ve place 2 orders since morning in BANKNIFTY via DHANHQ API. The order were placed successfully.

However, in the algorithm I use the following REST CALL (dhan.get_order_by_id(order_id)) to update the order details and the price retrieved is completely random due to which the order is getting squared off by the algorithm.

ORDER 1: BANKNIFTY 28 APR 51300 CALL | ‘orderId’: ‘32226040122407’ | Order filled at 1917.45, Squared off @ 1908.7

order_details_response (attempt 1) :

{‘status’: ‘success’, ‘remarks’: ‘’, ‘data’: [{‘dhanClientId’: ‘’, ‘orderId’: ‘32226040122407’, ‘exchangeOrderId’: ‘1800000053174631’, ‘correlationId’: ‘1100960759-1775025015926’, ‘orderStatus’: ‘TRADED’, ‘transactionType’: ‘BUY’, ‘exchangeSegment’: ‘NSE_FNO’, ‘productType’: ‘INTRADAY’, ‘orderType’: ‘LIMIT’, ‘validity’: ‘DAY’, ‘tradingSymbol’: ‘BANKNIFTY-Apr2026-51300-CE’, ‘securityId’: ‘67420’, ‘quantity’: 30, ‘disclosedQuantity’: 0, ‘price’: 2115.0, ‘triggerPrice’: 0.0, ‘afterMarketOrder’: False, ‘boProfitValue’: 0.0, ‘boStopLossValue’: 0.0, ‘legName’: ‘NA’, ‘createTime’: ‘2026-04-01 12:00:15’, ‘updateTime’: ‘2026-04-01 12:00:15’, ‘exchangeTime’: ‘2026-04-01 12:00:15’, ‘drvExpiryDate’: ‘2026-04-28’, ‘drvOptionType’: ‘CALL’, ‘drvStrikePrice’: 51300.0, ‘omsErrorCode’: ‘0’, ‘omsErrorDescription’: ‘TRADE CONFIRMED’, ‘algoId’: ‘0’, ‘remainingQuantity’: 0, ‘averageTradedPrice’: 1917.45, ‘filledQty’: 30}]}

order_details_response (attempt 1) :

{‘status’: ‘success’, ‘remarks’: ‘’, ‘data’: [{‘dhanClientId’: ‘’, ‘orderId’: ‘32226040122507’, ‘exchangeOrderId’: ‘1800000053185703’, ‘correlationId’: ‘1100960759-1775025017893’, ‘orderStatus’: ‘TRADED’, ‘transactionType’: ‘SELL’, ‘exchangeSegment’: ‘NSE_FNO’, ‘productType’: ‘INTRADAY’, ‘orderType’: ‘LIMIT’, ‘validity’: ‘DAY’, ‘tradingSymbol’: ‘BANKNIFTY-Apr2026-51300-CE’, ‘securityId’: ‘67420’, ‘quantity’: 30, ‘disclosedQuantity’: 0, ‘price’: 1720.0, ‘triggerPrice’: 0.0, ‘afterMarketOrder’: False, ‘boProfitValue’: 0.0, ‘boStopLossValue’: 0.0, ‘legName’: ‘NA’, ‘createTime’: ‘2026-04-01 12:00:17’, ‘updateTime’: ‘2026-04-01 12:00:17’, ‘exchangeTime’: ‘2026-04-01 12:00:17’, ‘drvExpiryDate’: ‘2026-04-28’, ‘drvOptionType’: ‘CALL’, ‘drvStrikePrice’: 51300.0, ‘omsErrorCode’: ‘0’, ‘omsErrorDescription’: ‘TRADE CONFIRMED’, ‘algoId’: ‘0’, ‘remainingQuantity’: 0, ‘averageTradedPrice’: 1908.7, ‘filledQty’: 30}]}

ORDER 2: BANKNIFTY 28 APR 51400 CALL | ‘orderId’: ‘34226040119907’ | Order filled at 1980, Squared off @ 1969.95

order_details_response (attempt 1) :

{‘status’: ‘success’, ‘remarks’: ‘’, ‘data’: [{‘dhanClientId’: ‘’, ‘orderId’: ‘34226040119907’, ‘exchangeOrderId’: ‘1700000131813430’, ‘correlationId’: ‘1100960759-1775032979807’, ‘orderStatus’: ‘TRADED’, ‘transactionType’: ‘BUY’, ‘exchangeSegment’: ‘NSE_FNO’, ‘productType’: ‘INTRADAY’, ‘orderType’: ‘LIMIT’, ‘validity’: ‘DAY’, ‘tradingSymbol’: ‘BANKNIFTY-Apr2026-51400-CE’, ‘securityId’: ‘67422’, ‘quantity’: 30, ‘disclosedQuantity’: 0, ‘price’: 2175.0, ‘triggerPrice’: 0.0, ‘afterMarketOrder’: False, ‘boProfitValue’: 0.0, ‘boStopLossValue’: 0.0, ‘legName’: ‘NA’, ‘createTime’: ‘2026-04-01 14:12:59’, ‘updateTime’: ‘2026-04-01 14:12:59’, ‘exchangeTime’: ‘2026-04-01 14:12:59’, ‘drvExpiryDate’: ‘2026-04-28’, ‘drvOptionType’: ‘CALL’, ‘drvStrikePrice’: 51400.0, ‘omsErrorCode’: ‘0’, ‘omsErrorDescription’: ‘TRADE CONFIRMED’, ‘algoId’: ‘0’, ‘remainingQuantity’: 0, ‘averageTradedPrice’: 1980.0, ‘filledQty’: 30}]}

order_details_response (attempt 1) :

{‘status’: ‘success’, ‘remarks’: ‘’, ‘data’: [{‘dhanClientId’: ‘’, ‘orderId’: ‘22226040126707’, ‘exchangeOrderId’: ‘1700000131912636’, ‘correlationId’: ‘1100960759-1775032992416’, ‘orderStatus’: ‘TRADED’, ‘transactionType’: ‘SELL’, ‘exchangeSegment’: ‘NSE_FNO’, ‘productType’: ‘INTRADAY’, ‘orderType’: ‘LIMIT’, ‘validity’: ‘DAY’, ‘tradingSymbol’: ‘BANKNIFTY-Apr2026-51400-CE’, ‘securityId’: ‘67422’, ‘quantity’: 30, ‘disclosedQuantity’: 0, ‘price’: 1785.0, ‘triggerPrice’: 0.0, ‘afterMarketOrder’: False, ‘boProfitValue’: 0.0, ‘boStopLossValue’: 0.0, ‘legName’: ‘NA’, ‘createTime’: ‘2026-04-01 14:13:12’, ‘updateTime’: ‘2026-04-01 14:13:12’, ‘exchangeTime’: ‘2026-04-01 14:13:12’, ‘drvExpiryDate’: ‘2026-04-28’, ‘drvOptionType’: ‘CALL’, ‘drvStrikePrice’: 51400.0, ‘omsErrorCode’: ‘0’, ‘omsErrorDescription’: ‘TRADE CONFIRMED’, ‘algoId’: ‘0’, ‘remainingQuantity’: 0, ‘averageTradedPrice’: 1969.95, ‘filledQty’: 30}]}

Request you to look at this urgently and update/fix the function.

The static IP address edit is restricted for 7 days. It should be enabled for users who travel frequently for office work or who are changing networks if wifi does not work

We are unable to add the same static IP address for another family member’s account, which means we require the individual’s network sources

Why is it mandatory to add a static IP Address?