
Dhanhq
Connects Claude to the DhanHQ broker API for programmatic trading on Indian exchanges like NSE, BSE, and MCX. You get order placement with safety guardrails (confirmation prompts, lot size validation, default to limit orders), live and historical market data, option chains with Greeks, portfolio queries, and WebSocket feeds for real-time updates. The skill enforces practical constraints like static IP requirements for order execution and active data plan checks before fetching quotes. Especially useful if you're building algo trading setups or need to automate F&O strategies on Indian markets without writing all the boilerplate yourself.
- skills.sh installs
- 1.4K
- GitHub stars
- 42
- last updated
- Jul 14, 2026
Install
$ npx -y skills add dhan-oss/dhanhq-skills --skill dhanhq --agent claude-codeInstalls into .claude/skills of the current project.
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
Sponsors
Details
- Repository
- github.com/dhan-oss/dhanhq-skills
- First seen
- Jul 14, 2026