13 - Chartink Architecture
Overview
Architecture Diagram
┌──────────────────────────────────────────────────────────────────────────────┐
│ Chartink Integration │
└──────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ Chartink Platform │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Scanner/Screener Alert │ │
│ │ │ │
│ │ When condition met → Trigger Webhook │ │
│ │ Example: Price > 20 DMA, Volume spike, RSI crossover │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
│
│ HTTP POST
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ OpenAlgo Chartink Webhook │
│ POST /chartink/webhook │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Rate Limit: WEBHOOK_RATE_LIMIT (100 per minute) │ │
│ │ │ │
│ │ Payload: │ │
│ │ { │ │
│ │ "webhook_id": "your_webhook_id", │ │
│ │ "stocks": "SBIN,RELIANCE,INFY" │ │
│ │ } │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ Chartink Processing │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ 1. Validate webhook_id against database │ │
│ │ 2. Get strategy configuration │ │
│ │ 3. Check time-based trading controls │ │
│ │ - Is current time within start_time and end_time? │ │
│ │ - Is strategy active? │ │
│ │ 4. Parse stock list │ │
│ │ 5. For each stock: │ │
│ │ - Lookup symbol mapping (chartink_symbol → exchange/qty/product)│ │
│ │ - Queue order for execution │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ Order Execution │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ REST API: /api/v1/placeorder or /api/v1/placesmartorder │ │
│ │ │ │
│ │ Order queued → Rate-limited execution → Broker API │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘Database Schema
Webhook Configuration
Chartink Setup
OpenAlgo Setup
Symbol Mapping
Chartink Symbol
Exchange
Product
Quantity
Processing Flow
API Endpoints
Endpoint
Method
Description
Database Functions
Webhook Payload Format
From Chartink
Processed Order
Configuration
Environment Variables
Strategy Settings
Setting
Description
Default
Symbol Mapping Settings
Setting
Description
Required
Use Cases
Momentum Scanner
Breakout Scanner
Exit Scanner
Key Files Reference
File
Purpose
Last updated