How codetradesalgo-cmyk/dhan-api-tradingview-webhook-python works
This repository is a FastAPI webhook engine that accepts TradingView trade alerts, resolves symbols to cached Dhan security tokens, records order state in SQLite, submits orders asynchronously to Dhan, and returns the resulting status. The graph follows the handler’s actual calls and separates lookup, ledger, and broker execution. The token master is a hardcoded demonstration dataset in the sampled source; the README’s production options resolver is an external premium module, not included here.
Main entry points: app.py Webhook handler
Components 8
Webhook ingress
- Webhook handler
app.py
Token routing
- Token manager
app.py - NumPy token cache
app.py
Order execution
- SQLite trade ledger
app.py - Dhan order sender
app.py
Other components
- TradingView alerts
- Dhan API
- Webhook client
Connections 8
- TradingView alerts → Webhook handler: posts alert
README.md - Webhook handler → Token manager: resolves symbol
app.py - Token manager → NumPy token cache: looks up token
app.py - Webhook handler → SQLite trade ledger: records pending
app.py - Webhook handler → Dhan order sender: submits order
app.py - Dhan order sender → Dhan API: posts order
app.py - Webhook handler → SQLite trade ledger: updates status
app.py - Webhook handler → Webhook client: returns status
app.py