Trading toolkit for Dhan on NSE, BSE, and MCX, covering orders, portfolio, market data, and option chains.

skills.sh installs
1.5K
GitHub stars
44
last updated
Jul 14, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers order placement, modification, and cancellation, plus portfolio holdings, positions, fund limits, and margin checks
  • Includes live and historical market data, option chains with Greeks, instrument ID resolution, and WebSocket feeds for quotes and order updates
  • Enforces confirmation before live orders, LIMIT by default, a Rs. 50,000 notional warning, F&O lot-size checks, and no CNC or MTF outside equities
  • Designed for Python developers automating Indian market trading through a Dhan broker account, with static IP and Data Plan prerequisites noted

Install

$ npx -y skills add dhan-oss/dhanhq-skills --skill dhanhq -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

DhanHQ — Indian Market Trading Skill

Setup

Stable install:

pip install dhanhq

Use the current SDK branch when you need newer v2 capabilities such as 200-level depth or the latest helper coverage:

pip install --upgrade dhanhq

Minimal initialization:

from dhanhq import DhanContext, dhanhq

dhan_context = DhanContext("YOUR_CLIENT_ID", "YOUR_ACCESS_TOKEN")
dhan = dhanhq(dhan_context)

Environment-variable setup:

import os
from dhanhq import DhanContext, dhanhq

dhan_context = DhanContext(
    os.environ["DHAN_CLIENT_ID"],
    os.environ["DHAN_ACCESS_TOKEN"],
)
dhan = dhanhq(dhan_context)

If generating scripts for this repo, prefer:

from scripts.dhan_helpers import get_client

dhan, dhan_context = get_client()

Safety Rules — Always Enforce

Details

Repository
github.com/dhan-oss/dhanhq-skills
Categories
Finance & Trading, Data Science & Analytics, Python
First seen
Jul 14, 2026

Similar to Dhanhq

More Finance & Trading