OPEN-SOURCE SCRIPT
已更新 IntraEdgeV2 for Nifty, Sensex, BankNifty, Options Trading

**IntraEdge Institutional Suite**
*NSE F&O Intraday Engine — Built for Nifty, BankNifty, FinNifty, MidCapNifty, Index Options, Stock Options, and NSE Equities*
IntraEdge is a comprehensive intraday decision support system built specifically for NSE F&O traders. It synthesises institutional order flow, opening range mechanics, sector breadth, volume profile, and macro context into a single indicator, automatically adapting its engine and visuals based on the instrument you load it on.
---
**AUTO-MODE DETECTION**
Switch charts and the indicator reconfigures itself. It reads the instrument type and ticker to automatically select the correct operating mode: Nifty Index / Futures, BankNifty, FinNifty, MidCapNifty, Index Options, Stocks, or Stock Options. Override manually if needed.
---
**TIMEFRAME ROUTING: 4-TIER ARCHITECTURE**
The indicator morphs based on timeframe. On 1m to 15m charts you get the full execution engine. On 30m to 1H you get the imbalance map and doji radar. On 2H to 4H you get gravity magnets. On Daily and above you get the macro matrix. Maths always runs globally; only the visuals change per tier.
---
**CORE EXECUTION ENGINE (Intraday 1m to 15m)**
**Opening Range (OR)**
Plots OR high and low from the 9:15 to 9:30 auction. Tracks first break direction, retest, trap, and quality score. The OR close RMI is latched at exactly the 9:30 bar for session-level conviction bias. OR boxes auto-hide on historical days.
**Confluence Zone: P1**
Scans 9 institutional levels at OR set time (VWAP, VAH/VAL, PDH/PDL, PrevVWAP, weekly bands, FVG, nPOC) and scores the proximity of OR high and low to each. Colocation tags (⚓) flag where OR levels stack with Value Area or PrevVWAP, the highest-probability institutional clusters.
**OR Level Scoring: P2**
Every confirmed touch of the OR high or low is scored across volume, body close, ATR relative size, VWAP position, and RMI momentum. Scores appear as labels on the chart. High-conviction touches (score 7 or above) trigger a dedicated alert.
**Activity Filter: P3**
Detects chop regimes using range compression, VWAP adherence, and volume conditions. When active, the tape locks to WAIT and an alert fires so you know to stop trading the current setup.
**Pre-OR Sweep: P5**
Detects PDH, PDL, or PrevVWAP sweeps in the 9:15 to 9:29 window before the OR sets. Biases the OR break direction against the swept level and displays the result in the HUD.
**Opening Candle Character: P6**
Classifies the first candle's body-to-range ratio and close position to identify institutional intent at the open.
---
**VWAP ENGINE**
Custom expanding-variance VWAP with +/-1 sigma and +/-2 sigma bands. Previous day VWAP computed from scratch and latched at session end. VWAP velocity and acceleration detection. Reclaim, reject, and retest signals with alert. VWAP zone classification displayed in HUD: Value Area / Trending / Exhausted.
**Session Volume Profile (SVP)**
Native integration via the SessionVolumeProfile library. Displays today's POC, VAH, and VAL in real time. Prior session POC (nPOC) used as a gravity magnet throughout the day. SVP warmup warning displayed on first session load.
---
**INSTITUTIONAL ORDER FLOW**
**Synthetic CVD (Cumulative Volume Delta)**
Reconstructs buyer vs seller pressure from candle structure without tick data. Divergence detection: price pivot high with CVD falling signals distribution (delta label above bar). Price pivot low with CVD rising signals accumulation (delta label below bar).
**RMI Oscillator**
14-period Relative Momentum Index, momentum length 3. Used internally across five systems: OR break score, gap trap override, tape confirmation, exhaustion colouring, and the divergence engine.
**RMI Regular Divergence**
Regular Bearish Divergence: price makes a higher high while RMI makes a lower high from an overbought zone. Distribution exhaustion signal, marked with a down arrow (▼D) above the bar.
Regular Bullish Divergence: price makes a lower low while RMI makes a higher low from an oversold zone. Accumulation exhaustion signal, marked with an up arrow (▲D) below the bar.
Fires on the confirmed bar where the RMI slope flips direction. Edge trigger only, no re-firing.
**SMT / RS-RW Divergence**
Structural divergence detection between Nifty and BankNifty across PDH, PDL, and VWAP levels. Includes magnitude Z-Score engine to grade divergence strength. Macro SMT (multi-day structural) tracked separately from intraday SMT. Correlation breakdown threshold configurable.
**Sequenced Trap: Fuel and Spark**
Detects the two-step institutional trap: sweep of a key level (Fuel) followed by a break failure (Spark). Requires both events within a configurable window to confirm. Separate alerts for trap detected and OR break trap.
---
**SECTOR BREADTH ENGINE: P10**
Monitors 10 NSE sector indices (Nifty Bank, IT, Auto, FMCG, Pharma, Metal, Energy, Realty, Infra, Media) against their individual VWAPs in real time. Breadth score, velocity state (Strong In / Neutral / Strong Out), and divergence from price displayed in the HUD Flow and Breadth rows. Three alerts: breadth divergence, velocity spike, HTF breadth confirmation.
**Basis / Carry Engine: P12**
Tracks Nifty futures basis (spot vs futures spread) as a proxy for institutional positioning bias. Carry direction and tight session flags displayed in the Breadth HUD row.
---
**EXPIRY STATE MACHINE: F4**
Four-phase expiry model: Normal, Pin Risk, Gamma, Final Hour. Automatically activates on expiry day (weekly or monthly, configurable). Displays expiry phase in the HUD header and fires transition alerts when the phase changes. Max-pain structural estimate alert when the level is established.
---
**LIQUIDITY ENGINE**
5-minute sweep detection on session high and low. 15-minute and 30-minute HTF sweep detection with separate pools for top and bottom sweeps. Higher Low and Lower High structure formation alerts. HTF sweep status displayed in HUD Tape row.
---
**FVG ENGINE: 1H Imbalance Map**
Detects Fair Value Gaps on the 1H timeframe and maps them as zones on lower timeframe charts. Active FVG direction (Bull / Bear / None) displayed in HUD Inst row. FVG proximity included in P1 confluence scoring.
**Doji Radar**
Advanced doji detection across configurable body/range thresholds. Active on hourly prep and execution tiers.
**M/W Pattern Detection (Double Top / Double Bottom)**
Two-bar swing structure engine tracking higher highs, higher lows, lower highs, lower lows. Double bottom (W) and double top (M) confirmations with labels and dedicated alerts. Recent M/W confirmation shown in HUD Tape row.
---
**MACRO CONTEXT**
**VIX Expected Move Bands**
Daily VIX ceiling and floor computed from India VIX. Weekly VIX bands for expiry boundary reference. ADR (Average Daily Range) used-percentage displayed in HUD and alerted at 90% exhaustion.
**Gap Classification**
Eight gap types: Gap-and-Go, Gap Fill, Flat Open, Gap Trap Bull/Bear, Gap Magnet, Gap Reversal. Gap strategy and percentage displayed in HUD Gap Strat row. Gap trap detection feeds directly into the tape exclusion rules.
**Daily EMA 21 and Weekly VWAP**
Macro bias reference. EMA 21 slope and position displayed in HUD macro context. Weekly VWAP displayed on applicable timeframes.
**Time-of-Day RVOL**
25-epoch intraday volume matrix using 5-bar windows across the session. Compares current bar volume to the historical average for that exact time of day. Anomaly detection with configurable threshold.
---
**HUD: 8-ROW CONSOLIDATED STATUS TABLE**
Live top-right table updating on every confirmed bar:
- **Gap Strat:** gap type, classification, gap percentage
- **Vol/ADR:** VIX regime, ADR used percentage
- **OR State:** break/retest/trap status, P1 confluence tags, colocation anchors
- **VWAP/Vol:** VWAP distance, zone classification, ToD RVOL
- **Inst/SMT:** SMT status, active FVG direction, RMI value with streak counter
- **Breadth:** sector breadth score, basis/carry, tight session flag
- **Flow:** breadth velocity, breadth divergence state
- **Tape/Align:** tape signal, exclusion reason, HTF breadth, recent M/W confirmation
On HTF charts (Daily and above), the HUD switches to a 6-row macro matrix showing macro bias, weekly VWAP, VIX range, ADR, 1H FVG, and nPOC. Auto-hides on Options and Stock charts to keep the chart clean.
---
**ALERTS: 23 CONDITIONS**
Trap Detected · OR Breakout · OR Retest · VWAP Interaction · Liquidity Sweep · Higher Low at Level · Lower High at Level · W-Pattern · M-Pattern · Breadth Divergence · Breadth Velocity Spike · OR Level High-Conviction Touch · Pre-OR Sweep · Activity Filter Activated · ADR Exhausted · VIX Band Touch · SMT / RS-RW Signal · Delta Divergence · Sequenced Trap · Expiry Phase Transition · Max-Pain Strike Set · RMI Regular Bear Divergence · RMI Regular Bull Divergence
All alerts are edge-triggered on confirmed bars. No intrabar spam.
---
**RECOMMENDED USAGE**
Best used on 3m or 5m charts for Nifty and BankNifty F&O intraday trading. Works on 1m for scalping and 15m for session-level context. Apply to the spot index (NIFTY, BANKNIFTY) or the front-month futures contract; auto-detection handles both. For options CE/PE premium charts, switch to a 1m or 3m options contract, and the engine decouples gap and VWAP calculations to the underlying automatically.
*Author: Murali Kumar ( x.com/Geekz) *
版本注释
fixed a few issues. 版本注释
1. Adaptive State Machine: Removed P3-gates and added 1-bar transition guards to ensure high-velocity breakouts and POC-retests are captured accurately without procedural suppression.2. Visual Optimization: Migrated 21 static levels to line objects (9-plot total) and resolved post-market box collapse, preserving yesterday's POC and today's developing VAH/VAL/POC visuals.
3. Volume Confluence: Refactored cluster logic to distinguish between standard 2-day POC alignments and 3-day multi-day nodes (Historical Scar Tissue) for surgical institutional mapping.
4. Intelligent HUD: Integrated automatic trap resets for multiple session alerts and added theta-skew awareness tags to flag premium-distorted volume nodes on option charts.
版本注释
Minor fixes & optimisations版本注释
Engine: Modularized OR break scoring and arrow label drawing into functions to reduce compilation loadFix: P3 chop filter now counts POC cross events (not sustained state) — prevents trend sessions from being misclassified as chop
Fix: Breakout score display capped at [5/5] — arrow labels no longer show impossible scores
Fix: last_bar_time comment corrected — Bar Replay limitation now documented in code
HUD: Score breakdown expanded from 5 to 7 dots — RSI penalty (⊗) and POC alignment (●/⊗/○) now visible in OR State row
Stability: "Main body too long" compilation limit addressed via function extraction
版本注释
Added toggles for P2 Confluence, Breakout Scores, and POC Retest labels—all now disabled by default for a cleaner chart.开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。