இந்த Tool என்ன செய்கிறது?
TradeZen F&O Signal என்பது NIFTY Index Options-க்கான real-time AI signal dashboard. இது Angel One SmartAPI-ஐ பயன்படுத்தி live tick data-ஐ WebSocket வழியாக பெற்று, 6 technical factors-ஐ analysys செய்து BUY CALL, BUY PUT, அல்லது WAIT signal தருகிறது.
இந்த tool Option Buying strategy-க்காக வடிவமைக்கப்பட்டுள்ளது — அதாவது நீங்கள் Call அல்லது Put option வாங்கி, price move-இல் profit எடுக்கும் intraday directional trading. Option Selling strategy-க்கு (theta income, premium collection) இது பொருந்தாது.
இந்த signal educational மற்றும் research purpose-க்கு மட்டுமே. Real money trade செய்வதற்கு முன் உங்கள் own analysis செய்யவும். Market always unpredictable.
System Architecture
Mode 1 + Mode 3
Port 8000
Port 3000
Poll every 2s/5s
COMPONENT BREAKDOWN
| Component | File | Role |
|---|---|---|
| InstrumentMaster | data/instrument_master.py | Angel One-இல் இருந்து NIFTY option tokens download செய்து cache வைக்கும். ATM strike கண்டுபிடிக்கும். |
| WebSocketClient | data/websocket_client.py | SmartWebSocketV2 connection. NFO options → Mode 3 (full quote), NSE NIFTY spot → Mode 1 (LTP only). |
| MarketState | core/market_state.py | In-memory tick store. Token → {price, OI, volume, depth_buy_qty, depth_sell_qty}. |
| SignalEngine | core/signal_engine.py | 6 factor scoring + aggregation + hysteresis state machine. 1-second loop. |
| FastAPI main.py | main.py | /signal, /option-chain, /health, /debug endpoints expose engine output as JSON. |
| Node.js stockRoute | routes/stockRoute.js | Express proxy — browser-ல் CORS bypass. /api/ai-signal, /api/option-chain. |
| aiService.js | services/aiService.js | Python engine-ஐ axios மூலம் call செய்யும். Timeout handling. |
| fno_signal.html | public/fno_signal.html | Full dashboard UI. Poll: chain 5s, signal 2s. TradingView Lightweight Charts. |
Tick Data எங்கிருந்து வருகிறது?
Engine startup-ல் இரண்டு WebSocket subscriptions திறக்கப்படும்:
| Subscription | Mode | Exchange | Data |
|---|---|---|---|
| NFO Options | MODE 3 | NFO (exchangeType: 2) | LTP, OI, Volume, Top-5 Bid/Ask depth |
| NIFTY Spot | MODE 1 | NSE (exchangeType: 1) Token: 26000 | LTP only — used for spot trend score |
Mode 3 (Full Quote): LTP + OI + Volume + Top-5 Bid/Ask depth levels. Options-க்கு இது தேவை. Mode 1 (LTP Only): Price மட்டும். NIFTY spot-க்கு இது போதுமானது — bandwidth save செய்யும்.
Raw Tick Normalization
MarketState.update() Angel One tick format-ஐ normalize செய்கிறது:
# Angel One LTP = paise format (multiply 100)
ltp = tick["last_traded_price"] / 100
# Top-5 depth aggregation — spoof-resistant
depth_buy_qty = sum(lvl["quantity"] for lvl in tick["best_5_buy_data"])
depth_sell_qty = sum(lvl["quantity"] for lvl in tick["best_5_sell_data"])
# Delta tracking (tick-over-tick change)
price_change = ltp - prev_price
oi_change = oi - prev_oi
6 Signal Factors
ஒவ்வொரு tick-லும் 6 factors calculate செய்யப்படும். ஒவ்வொரு factor-உம் Bull, Bear, அல்லது Sideways score-ஐ contribute செய்யும்.
Formula:
chg = (OI[-1] - OI[0]) / (OI[0] + 1)BUILD: chg > 0.3% | UNWIND: chg < -0.3%
Formula:
mom = (EMA₅ - EMA₂₀) / EMA₂₀ × 100mom > 0.15% = UP | mom < -0.15% = DOWN
Formula:
spike = volume > mean + 1.5 × stdstd ≈ 0 ஆனால்:
volume > mean × 1.4
Formula:
ce_bull = ce_ratio ≥ pe_ratio × 1.3
Formula:
PCR = PE_OI / CE_OIBULL > 1.3 | BEAR < 0.7 | NEUTRAL otherwise
Formula:
diff = (EMA₅ - EMA₂₀) / EMA₂₀ × 100UP > 0.05% | DOWN < -0.05% | FLAT otherwise
Score எவ்வாறு Calculate ஆகிறது?
Signal Emission Rule
| Condition | Signal |
|---|---|
| max(bull, bear, side) < 45 | WAIT |
| bull > bear AND bull ≥ side AND bull ≥ 45 | BUY CALL |
| bear > bull AND bear ≥ side AND bear ≥ 45 | BUY PUT |
| side ≥ bull AND side ≥ bear AND side ≥ 45 | SIDEWAYS |
| bull == bear (tie) | WAIT — insufficient conviction |
Signal State Machine
Signal ஒரு simple on/off அல்ல — 3 layers of filtering செய்கிறது. இது rapid oscillation-ஐ தடுக்கிறது.
Layer 1 — Persistence Filter
ஒரு raw signal 2 consecutive ticks (≈ 2 seconds) confirm ஆனால் மட்டுமே emit செய்யும். Single-tick noise eliminate ஆகும்.
Layer 2 — Minimum Hold Lock (45 seconds)
Signal emit ஆனதும் 45 seconds lock. இந்த window-ல் எந்த exit-உம் இல்லை, எந்த flip-உம் இல்லை. BUY CALL → BUY PUT 2 seconds-ல் oscillate ஆவதை இது prevent செய்கிறது.
Market noise typically lasts <30s. Minimum hold 45s means the signal must have been truly wrong for a full minute before it can exit — filters day-trading noise without being so slow that it misses real reversals.
Layer 3 — Timed Exit (30 seconds)
45s lock expire ஆனதும் exit timer தொடங்கும். Score continuously <20 for 30 seconds → signal clear ஆகும். ஒரு tick recovery ஆனாலும் timer reset ஆகும்.
HOLD Badge என்பது என்ன?
| Badge Text | Meaning |
|---|---|
| LOCKED · 38s | Minimum hold period-ல் உள்ளது. Score எப்படி இருந்தாலும் signal மாறாது. |
| HOLD · exits in 22s | Score <20-ல் உள்ளது. 22 seconds more தொடர்ந்து low இருந்தால் signal clear ஆகும். |
| HOLDING | Score <45 ஆனால் >20. Hysteresis-ல் signal held. |
API Endpoints
| Endpoint | Port | Purpose | Poll Rate |
|---|---|---|---|
GET /api/ai-signal | 3000 | Latest signal + confidence + reason + factors + PCR + NIFTY LTP | 2s |
GET /api/option-chain | 3000 | Full ATM±5 strike chain — CE+PE price/OI/volume/depth per strike | 5s |
GET /api/health | 3000 | Engine status, tick count, last signal | On demand |
GET /api/debug | 3000 | Full last_signal including raw scores — for debugging | On demand |
GET /signal | 8000 | Direct Python engine signal (Node bypasses this) | — |
GET /option-chain | 8000 | Direct chain from Python engine | — |
SIGNAL RESPONSE STRUCTURE
{
"signal": "BUY CALL",
"confidence": 62,
"reason": "CE OI build (+2.4%) + CE ▲ EMA +0.65% | PCR 0.91 (BULL)",
"timestamp": 1745234567890,
"nifty_ltp": 24526.75,
"nifty_chg": 0.04,
"pcr": 0.912,
"diagnostic": {
"raw_signal": "BUY CALL",
"bull": 62, "bear": 15, "side": 10,
"held": false,
"in_min_hold": true,
"min_hold_remaining": 38,
"entry_needed": 45, "exit_at": 20
},
"factors": { /* oi_trend, price_trend, vol_spike, imbalance, pcr, spot_trend */ }
}
Toolbar
| Element | என்ன காட்டுகிறது | Source |
|---|---|---|
| NIFTY 50 ₹24,526.75 | Live NIFTY spot price. /api/ai-signal response-ல் nifty_ltp field. | MarketState token 26000 → /signal |
| +0.00% | Tick-over-tick change %. Intraday cumulative அல்ல. | price_change / prev_price × 100 |
| EXPIRY dropdown | Option chain-ல் கிடைக்கும் expiry dates. Nearest auto-select. | instrument_master.py |
| BOTH / CE / PE tabs | Chain view mode. CE mode = CE columns மட்டும் visible. | renderChain() viewMode |
| ● Live · 11:44:23 | Last successful chain fetch time. | fetchChain() success callback |
Option Chain Panel
Chain panel right sidebar-ல் உள்ளது. ATM ± 5 strikes = 11 rows. Strike 50-point intervals.
| Column | Side | என்ன காட்டுகிறது |
|---|---|---|
| OI (L) | CE | Open Interest in Lakhs. Bar width = relative OI. Highest OI strike = Max Pain zone. |
| OI CHG | CE | OI change from previous tick. Green = build, Red = unwind. |
| VOL | CE | Volume in thousands (K). Spike = unusual activity. |
| LTP | CE | Last Traded Price + tick-over-tick change. Green/Red color. |
| STRIKE | — | Strike price. ATM label = closest to current NIFTY spot. CE/PE buttons. |
| LTP | PE | Put option LTP + change. |
| VOL | PE | Put volume. |
| OI CHG | PE | Put OI change. |
| OI (L) | PE | Put OI. Bar width relative. Highest OI PE = strong support level. |
Strike row-ல் CE button அல்லது PE button press செய்தால் அந்த contract-இன் signal panel right-ல் திறக்கும். Signal engine ATM tokens-ஐ watch செய்கிறது — selected contract LTP chart-ல் track ஆகும்.
Signal Panel (Left/Center)
| Section | என்ன காட்டுகிறது |
|---|---|
| Contract Header | Selected symbol (NIFTY21APR2624400CE), expiry, strike, type, live LTP. |
| AI SIGNAL + Badge | Current signal. HOLD badge shows lock/exit countdown. |
| Confidence Ring | WAIT state: ring fill = score / entry_threshold (how close to firing). Active state: fill = confidence/100. |
| காரணம் | Human-readable reason. சிறு Tamil + English mix. OI/EMA/PCR highlights. |
| Price Chart | Selected contract LTP. Green=CE, Red=PE line. Signal markers (arrows/squares). |
| Signal Score Breakdown | BULL/BEAR/SIDE score bars. Entry (45) and Exit (20) thresholds. Hold note when hysteresis active. |
| WHY THIS SIGNAL? | Educational panel. ஒவ்வொரு factor-உம் fired ஆனால் Tamil explanation. |
| Mini Metrics | LTP, OI(L), Volume, Bid/Ask ratio — selected contract-க்கான live values. |
| Signal Factors | OI Trend, Volume Spike, Bid/Ask Pressure, PCR Bias — pill indicators. |
| PCR Gauge | PUT-CALL ratio bar. <0.7=Bearish, >1.3=Bullish. |
| Signal History | Transition-only log. BUY CALL → EXIT CALL → BUY PUT sequence. ALERTS toggle. |
Price Chart
TradingView Lightweight Charts v4.2. Data source: option chain poll (every 5s). Max 300 data points (~25 minutes).
| Marker | Shape | Color | Meaning |
|---|---|---|---|
| BUY CALL | Arrow Up ↑ | Green | Below bar — bullish entry signal. CE option வாங்கவும். |
| BUY PUT | Arrow Down ↓ | Red | Above bar — bearish entry signal. PE option வாங்கவும். |
| EXIT CALL | Square ■ | Amber | Above bar — CE position close செய்யவும். |
| EXIT PUT | Square ■ | Amber | Below bar — PE position close செய்யவும். |
Entry arrows opposite sides-ல் உள்ளன (BUY CALL below, BUY PUT above). EXIT squares entry-க்கு opposite side-ல். ஒரே நேரத்தில் EXIT + entry ஒரு strike-ல் இருந்தாலும் overlap ஆகாது.
Signal History & Alerts
Signal History transition-based — every 2s poll-ல் log add ஆவதில்லை. Signal state மாறும்போது மட்டுமே ஒரு row add ஆகும்.
| Row Type | Color | Trigger |
|---|---|---|
| BUY CALL / BUY PUT | Green / Red | WAIT → active signal transition |
| EXIT CALL / EXIT PUT | Amber | Auto-inserted when active signal exits (before new signal row) |
| WAIT | Muted | Active → WAIT transition |
| NEW badge | Teal flash | Latest entry — fades after 3 seconds |
Alert System
ALERTS button click செய்தால் இரண்டு things activate ஆகும்:
- Audio (Web Audio API): BUY CALL = ascending 3-tone (440→550→660Hz). BUY PUT = descending. EXIT = single neutral. Browser click-ல் AudioContext create ஆவதால் autoplay policy bypass ஆகும்.
- Browser Notification: Permission grant ஆனால் system notification. Chrome-ல் address bar-ல் permission icon check செய்யவும்.
Enable செய்தவுடன் test tone play ஆகும் — audio working என்பதை confirm செய்யும்.
தொடங்குவது எப்படி?
F&O Signal page திறந்தவுடன் நீங்கள் காண்பது என்ன என்று புரிந்துகொள்வோம்.
இந்த tool பயன்படுத்த Python AI Engine (port 8000) மற்றும் Node.js Server (port 3000) இரண்டும் running-ல் இருக்க வேண்டும். Market hours-ல் மட்டுமே live data கிடைக்கும் (9:15 AM – 3:30 PM IST).
Page Layout புரிந்துகொள்ளுங்கள்
Page இரண்டு பக்கமாக பிரிந்துள்ளது:
- இடது/மையம்: Signal Panel — AI signal, chart, score details
- வலது: Option Chain — 11 strikes-ன் live data
தொடக்கத்தில் Signal Panel "Contract தேர்வு செய்யவும்" என்று காட்டும். முதலில் Option Chain-ல் ஒரு contract தேர்வு செய்ய வேண்டும்.
Option Chain எப்படி படிப்பது?
Chain-ல் ATM label உள்ள row தேடுங்கள். Toolbar-ல் NIFTY LTP ₹24,526-ஆக இருந்தால், ATM strike 24500 அல்லது 24550 ஆக இருக்கும் (50-point rounds). இந்த strike-ல்தான் மிகவும் liquidity இருக்கும், bid-ask spread குறைவாக இருக்கும்.
CE side (இடது) மற்றும் PE side (வலது) OI bars compare செய்யுங்கள். CE OI அதிகமாக இருந்தால் = Resistance zone (call writers protecting that level). PE OI அதிகமாக இருந்தால் = Support zone (put writers defending).
Green OI CHG = OI increasing = Fresh buying/selling. Red OI CHG = OI decreasing = Positions unwinding. CE OI increasing + CE price rising = Genuine bullish buying (BUY CALL signal-க்கு support).
ATM strike row-ல் CE button press செய்தால் அந்த Call option select ஆகும். Signal panel திறக்கும். Bullish signal expect செய்தால் CE, Bearish signal expect செய்தால் PE select செய்யுங்கள்.
Signal எப்படி புரிந்துகொள்வது?
Green = BUY CALL (Bullish — price rise expect). Red = BUY PUT (Bearish — price fall expect). Muted = WAIT (எந்த position-உம் வேண்டாம்). Amber = EXIT (position close செய்யவும்).
Ring-ல் உள்ள number-ஐ பாருங்கள். WAIT state-ல் இது "SCORE" — entry threshold (45)-க்கு எவ்வளவு நெருங்கி இருக்கிறோம். Active signal-ல் இது "CONF%" — 45-100% range. 70%+ = strong signal. 45-55% = weak, caution தேவை.
LOCKED · 38s = Signal புதிதாக fire ஆனது, 38 seconds frozen. இந்த time-ல் scores oscillate ஆனாலும் signal மாறாது. HOLD · exits in 22s = Score drop ஆகிவிட்டது, 22 seconds low இருந்தால் signal clear ஆகும்.
Signal card-ல் "காரணம்" text signal ஏன் fire ஆனது என்று காட்டும். உதாரணம்: "CE OI build (+2.4%) + CE ▲ EMA +0.65% | PCR 0.836 (BEAR)" — இதன் பொருள்: CE OI அதிகரிக்கிறது, CE price EMA upward, ஆனால் PCR bearish. Mixed signal என்பதால் confidence குறைவாக இருக்கும்.
BULL, BEAR, SIDE மூன்று bars-உம் comparatively பாருங்கள். BULL >> BEAR = Strong bullish. BULL ≈ BEAR = Conflicted market, caution. Entry threshold line (45) -ஐ எந்த bar தாண்டுகிறது என்று பாருங்கள்.
Price Chart எப்படி படிப்பது?
CE contract select ஆனால் Green line, PE contract ஆனால் Red line. Y-axis = Option premium price (₹). X-axis = Time (IST, UTC format காட்டலாம்).
Green ↑ arrow (below bar) = BUY CALL signal fire ஆன நேரம். Red ↓ arrow (above bar) = BUY PUT signal. இந்த point-ல் option premium என்னவாக இருந்தது என்று price-ஐ பாருங்கள்.
Amber ■ square = EXIT signal. BUY CALL-க்கு exit = above bar square. BUY PUT-க்கு exit = below bar square. Entry arrow-இல் இருந்து exit square-வரை price எவ்வளவு move ஆனது என்று measure செய்யலாம் — signal quality judge ஆகும்.
Chart header-ல் "₹143.75 +2.06%" = தற்போதைய LTP மற்றும் contract select ஆன நேரத்திலிருந்து % change. இது P&L indicator அல்ல — premium change மட்டும்.
Step-by-Step Trading Workflow
இது signal மட்டுமே. Final decision உங்களுடையது. Stop loss always set செய்யுங்கள். Premium-இல் 30-40% loss ஆனால் exit கட்டாயம்.
முதல் 15 minutes (9:15–9:30) trade செய்ய வேண்டாம். Gap-up/gap-down settle ஆக நேரம் தேவை. Engine "Warming up" என்று காட்டும் — data collect ஆகும். NIFTY direction தெரிந்த பிறகே contract select செய்யுங்கள்.
Option chain-ல் ATM strike கண்டுபிடித்து CE அல்லது PE button press செய்யுங்கள். Signal panel activate ஆகும். WAIT state-ல் score 30-35+ ஆனால் signal வர நெருங்குகிறது என்பதன் அர்த்தம்.
Signal History panel-ல் ALERTS button click செய்யுங்கள். Test tone கேட்கிறீர்களா? கேட்டால் audio working. Browser notification permission allow செய்யுங்கள். இப்போது signal fire ஆனால் உடனே தெரியும்.
BUY CALL signal வந்தால்: Confidence 55%+ ஆக இருக்கட்டும். "LOCKED" badge தெரிந்தால் signal stable. அந்த moment-ல் ATM CE premium என்னவென்று பாருங்கள் — entry price note செய்யுங்கள். Your broker-ல் order place செய்யுங்கள்.
Signal "HOLDING" என்று காட்டும். Score bars பாருங்கள் — BULL bar high-ஆக இருக்க வேண்டும். Score 20 கீழே போய் "exits in Xs" காட்டினால் exit prepare செய்யுங்கள். Chart-ல் price direction பாருங்கள்.
EXIT CALL amber square chart-ல் தெரிந்தால் மற்றும் signal history-ல் EXIT row வந்தால் — உடனடியாக position close செய்யுங்கள். Exit alert tone வேறாக sound ஆகும் — neutral single beep.
3:15 PM-க்கு முன்பே எல்லா positions close செய்யுங்கள். Options expire ஆகாத நிலையில் overnight hold வேண்டாம் — theta decay overnight premium-ஐ eat செய்யும்.
இந்த தவறுகளை செய்யாதீர்கள்
Signal "WAIT" என்று காட்டும்போது trade enter ஆவது மிகவும் risky. Engine "unclear trend" என்று சொல்கிறது. Confidence ring 30-40%? — Signal வரும் வரை பொறுங்கள்.
Confidence 45-50%? — இது minimum threshold மட்டும். இந்த level-ல் maximum quantity trade செய்வது dangerous. 65%+ confidence-ல் normal quantity, 80%+ confidence-ல் full quantity என்று tiered approach follow செய்யுங்கள்.
"இன்னும் கொஞ்சம் profit ஆகும்" என்று EXIT signal வந்த பிறகும் hold செய்வது. EXIT ஆனால் engine "momentum gone" என்று சொல்கிறது. Greed-ஐ விடுங்கள்.
BUY CALL position-ல் இருக்கும்போது EXIT CALL வந்தால் உடனே close செய்யவும். "BUY PUT வரும் வரை பார்க்கலாம்" என்று CE hold செய்வது தவறு — time costing you premium.
Signal ATM contract-ஐ watch செய்கிறது. Deep OTM options (ATM-ல் இருந்து 3-4 strikes away) வாங்கினால் delta குறைவாக இருக்கும் — signal accurate ஆனாலும் profit குறைவாகவோ அல்லது loss ஆகவோ கூட வரலாம்.
ATM ± 1 strike மட்டும் trade செய்யுங்கள். Signal fire ஆனவுடனே enter செய்யுங்கள், delay வேண்டாம். Clear stop loss: premium 35% drop = exit regardless of signal. Daily maximum 3 trades என்று limit போட்டுக்கொள்ளுங்கள்.
முக்கிய வார்த்தைகள்
| Term | Tamil விளக்கம் |
|---|---|
| ATM (At The Money) | Spot price-க்கு மிக நெருக்கமான strike price. அதிக liquidity, tight spread. |
| OTM (Out of The Money) | CE: spot-ஐ விட அதிகமான strike. PE: spot-ஐ விட குறைந்த strike. Cheaper premium, low probability. |
| Open Interest (OI) | Outstanding open contracts count. OI increase = fresh positions. OI decrease = positions closing. |
| PCR (Put-Call Ratio) | PE OI ÷ CE OI. >1 = puts active = bearish sentiment dominant. <1 = calls active = bullish. |
| EMA (Exponential Moving Average) | Recent prices-க்கு அதிக weight கொடுக்கும் average. Fast EMA > Slow EMA = uptrend. |
| Volume Spike | Normal volume-ஐ விட suddenly அதிகரிக்கும் trading. Institutional interest indicate ஆகலாம். |
| Hysteresis | Signal-ஐ minor noise-ல் change ஆகாமல் தடுக்கும் mechanism. Entry threshold > Exit threshold. |
| Min Hold Lock | Signal fire ஆனதும் 45 seconds freeze. Oscillation prevent செய்யும். |
| Bid/Ask Imbalance | Buy orders >> Sell orders = buying pressure. Top-5 levels aggregate = spoof resistant. |
| Short Cover | OI falling + price rising = Shorts (option sellers) position close செய்கிறார்கள் = bullish. |
| WebSocket | Persistent two-way connection. HTTP-ஐ விட faster — every tick real-time push கிடைக்கும். |
| Theta Decay | Time value erosion. Options expire date நெருங்க நெருங்க premium கரைந்துவிடும். Option buyers-க்கு enemy. |
| Tick | Exchange-ல் இருந்து ஒவ்வொரு price update. Busy sessions-ல் second-க்கு பல ticks வரும். |
| Signal Engine | Live market data → factors → scores → signal என்ற calculation pipeline. |
| Confidence | Top scoring direction score (0-100). 45 = entry minimum. Higher = stronger conviction. |
| Fast API | Python web framework. Signal engine HTTP endpoints expose செய்கிறது. |
இந்த tool மற்றும் documentation educational purpose மட்டுமே. F&O trading extremely risky — investment போன amount முழுவதும் lose ஆகலாம். TradeZen எந்த financial loss-க்கும் responsible இல்லை.
SEBI registered advisor-ஐ consult செய்யுங்கள் real money deploy செய்வதற்கு முன். Algorithm signals past performance-ஐ பார்த்து future guarantee கொடுக்காது. Market conditions மாறும்போது signals incorrect ஆகலாம்.