Releases: dhan-oss/DhanHQ-py
Release list
v2.3.0rc1
Add major new features for v2.3.0 release candidate:
- Conditional Orders: Price/indicator-based alert system to trigger orders automatically
- Global Stocks: Trade US stocks with orders, holdings, margin, and market status APIs
- Global Stocks Live Feed: Real-time WebSocket feed for US stock trades and OHLC data
- P&L Based Exit: Auto square-off on cumulative profit/loss thresholds
- Multi-leg Margin Calculator: Calculate combined margin for multi-leg strategies with hedge benefits
Also includes:
- Enhanced FullDepth callback handling
- New Portfolio.exit_all_positions() method
- Updated documentation links and README
- Comprehensive examples and unit tests
- Python 3.10+ requirement and Dev Status classifier
v2.2.0
v2.2.0 — What’s New
This release significantly expands the capabilities of the DhanHQ Python Library, bringing deeper market data access, improved instrument coverage, and new order-management utilities.
🔍 Deeper Market Data
You can now access the full market depth (up to 200 levels) directly via DhanHQ APIs, fully supported in the Python library. This enables advanced order-book analysis, liquidity tracking, and high-precision trading strategies.
🕒 Expired Options Data
The library now supports fetching expired options data across both NSE and BSE instruments. This makes it easier to backtest strategies, analyse historical derivatives behavior, and perform post-expiry research without external data sources.
⚡ Super Orders
Super Orders are now available in the Python library—smart orders designed to help manage risk and profit targets more efficiently. This simplifies the execution of advanced trading logic while maintaining tighter control over exits.
🔐 IP Management via API
You can now set, modify, and manage IP restrictions for your account directly from the Python library. Sample code for IP management is available under the examples section to help you get started quickly.
🚀 Improvements & Enhancements
Along with these major updates, v2.2.0 includes multiple internal improvements and expanded API coverage, making more DhanHQ functionality accessible directly through the Python SDK.
v2.2.0rc1
v2.2.0 — What’s New
This release significantly expands the capabilities of the DhanHQ Python Library, bringing deeper market data access, improved instrument coverage, and new order-management utilities.
🔍 Deeper Market Data
You can now access the full market depth (up to 200 levels) directly via DhanHQ APIs, fully supported in the Python library. This enables advanced order-book analysis, liquidity tracking, and high-precision trading strategies.
🕒 Expired Options Data
The library now supports fetching expired options data across both NSE and BSE instruments. This makes it easier to backtest strategies, analyse historical derivatives behavior, and perform post-expiry research without external data sources.
⚡ Super Orders
Super Orders are now available in the Python library—smart orders designed to help manage risk and profit targets more efficiently. This simplifies the execution of advanced trading logic while maintaining tighter control over exits.
🔐 IP Management via API
You can now set, modify, and manage IP restrictions for your account directly from the Python library. Sample code for IP management is available under the examples section to help you get started quickly.
🚀 Improvements & Enhancements
Along with these major updates, v2.2.0 includes multiple internal improvements and expanded API coverage, making more DhanHQ functionality accessible directly through the Python SDK.
v2.2.0 is currently available as a pre-release.
With the release of v2.2.0, there are breaking changes introduced since v2.1.0, which may impact existing integrations.
If you prefer stability, we recommend continuing with the current stable version.
To try the pre-release version, install it explicitly using:
pip install --pre dhanhq
v2.1.0
v2.0.2
v2.0.1
v2
v2.0 - What's New
DhanHQ v2 extends execution capability with live order updates, market quotes and forever orders on superfast APIs. Some of the key highlights from this version are:
- Fetch LTP, Quote (with OI) and Market Depth data directly on API, for upto 1000 instruments at once with Market Quote API.
- Option Chain API which gives OI, greeks, volume, top bid/ask and price data of all strikes of a particular underlying.
- Place, modify and manage your Forever Orders, including single and OCO orders to manage risk and trade efficiently with Forever Order API.
- Order Updates are sent in real time via websockets, which will update order status of all your orders placed via any platform -
order_update. - Intraday Minute Data now provides OHLC with Volume data for last 5 trading days across timeframes such as 1 min, 5 min, 15 min, 25 min and 60 min -
intraday_minute_data. - Full Packet in Live Market Feed (
marketfeed). - Margin Calculator (
margin_calculator) and Kill Switch (kill_switch) APIs.
Breaking Changes
- Replaced
intraday_daily_minute_dataandhistorical_minute_chartsas functions from v1.2.4 quantityfield needs to be placed order quantity instead of pending order quantity in Order Modification- EPOCH time instead of Julian time in Historical Data API, and same changed for
convert_to_date_timefunction historical_daily_datatakessecurity_idas argument instead ofsymbol- Nomenclature changes in
get_order_by_corelationIDtoget_order_by_correlationID.
You can read about all other updates from DhanHQ V2 here: DhanHQ Releases.
v1.3.3
v1.3.2
v1.3
Adding class for Market Feed data
Live Market data is via DhanHQ Websockets - which establishes connection between your local and server.
Highlights of Python Client:
- Initiate and Authorise Connection
- Maintain Connection
- Subscribe to Instruments
- Parse receiving data from binary