OPEN-SOURCE SCRIPT
Nexus Structure Detector [JOAT]

Nexus Structure Detector [JOAT]
Introduction
The Nexus Structure Detector is an advanced open-source Smart Money Concepts (SMC) indicator that identifies institutional order flow through Order Blocks, Fair Value Gaps, Liquidity Levels, and Market Structure analysis. This indicator combines multiple SMC methodologies into a unified system that reveals where institutions are positioning their orders and how they manipulate price to fill those orders.
Unlike basic support/resistance indicators, the Nexus Structure Detector provides institutional-grade structure analysis through order block detection, FVG identification, liquidity sweep tracking, and premium/discount zone mapping. The indicator is designed for traders who understand that institutions move markets through systematic order placement and liquidity manipulation.

Why This Indicator Exists
This indicator addresses the need for systematic SMC analysis on TradingView. By combining order blocks, fair value gaps, liquidity levels, and market structure into one tool, it reveals:
Core Components Explained
1. Order Block Detection
Order blocks are identified by finding the candle with the most extreme price before a strong directional move. The indicator uses pivot detection to identify swing points, then traces back to find the order block candle:
Order blocks are drawn as boxes extending into the future. When price returns to an order block, institutions are likely to defend that zone. Mitigation occurs when price closes through the order block (wick or close mitigation options available).
2. Fair Value Gap (FVG) Detection
FVGs are three-candle patterns where there's a gap between candle 1's high/low and candle 3's low/high:
FVGs represent imbalances where price moved too quickly, leaving unfilled orders. Institutions often return to these zones to fill orders. The indicator tracks FVG mitigation using touch, wick, close, or average methods.
3. Liquidity Level Tracking
Liquidity levels are identified at pivot highs (Buy Side Liquidity - BSL) and pivot lows (Sell Side Liquidity - SSL). These represent areas where retail traders place stop losses:
Institutions often push price through these levels to trigger stops and fill their orders. The indicator tracks when liquidity is swept (price moves through the level) and displays swept levels with dotted lines.
4. Market Structure Analysis
The indicator tracks market structure by monitoring higher highs/lows and lower highs/lows:
Market structure helps identify the current trend and potential reversal points. The indicator combines structure with order blocks and liquidity to identify high-probability setups.
5. Premium/Discount Zones
The indicator calculates the range between the highest high and lowest low over a lookback period (default 50 bars), then divides it into zones:
Institutions typically buy in discount zones and sell in premium zones. The indicator displays these zones with dotted lines and tracks current price position.
Visual Elements

How to Use This Indicator
Step 1: Identify Market Structure
Check the dashboard for current market structure (Bullish/Bearish/Neutral). Trade in the direction of structure for highest probability.
Step 2: Locate Order Blocks
Look for unmitigated order blocks in the direction of structure. Bullish OBs in discount zones and bearish OBs in premium zones offer best setups.
Step 3: Monitor Fair Value Gaps
FVGs often get filled before price continues. Use FVGs as entry zones when they align with order blocks and structure.
Step 4: Watch for Liquidity Sweeps
When price sweeps liquidity (BSL or SSL), it often reverses. Look for liquidity sweeps near order blocks for high-probability reversals.
Step 5: Check Price Position
Use premium/discount zones to determine if price is at an extreme. Buy in discount, sell in premium, avoid equilibrium.
Step 6: Combine Elements for Confluence
Best setups occur when multiple elements align: structure + order block + FVG + liquidity sweep + premium/discount zone.
Best Practices
Input Parameters
Structure Detection:
Mitigation Rules:
Premium/Discount Zones:
Visual Configuration:
Originality Statement
This indicator is original in its comprehensive SMC integration. While individual concepts (order blocks, FVGs, liquidity) are established SMC principles, this indicator is justified because:
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Smart Money Concepts are analytical tools, not guarantees of future price movement. Order blocks, FVGs, and liquidity levels do not guarantee profitable trades. Always use proper risk management and never risk more than you can afford to lose.
-Made with passion by officialjackofalltrades
Introduction
The Nexus Structure Detector is an advanced open-source Smart Money Concepts (SMC) indicator that identifies institutional order flow through Order Blocks, Fair Value Gaps, Liquidity Levels, and Market Structure analysis. This indicator combines multiple SMC methodologies into a unified system that reveals where institutions are positioning their orders and how they manipulate price to fill those orders.
Unlike basic support/resistance indicators, the Nexus Structure Detector provides institutional-grade structure analysis through order block detection, FVG identification, liquidity sweep tracking, and premium/discount zone mapping. The indicator is designed for traders who understand that institutions move markets through systematic order placement and liquidity manipulation.
Why This Indicator Exists
This indicator addresses the need for systematic SMC analysis on TradingView. By combining order blocks, fair value gaps, liquidity levels, and market structure into one tool, it reveals:
- Order Blocks: The last candle before a strong move where institutions placed orders
- Fair Value Gaps: Imbalances in price where institutions will likely return to fill orders
- Liquidity Levels: Pivot highs/lows where retail stops cluster and institutions hunt liquidity
- Market Structure: Break of Structure (BOS) and Change of Character (CHOCH) detection
- Premium/Discount Zones: Price positioning relative to range equilibrium
- Mitigation Tracking: Monitors when order blocks and FVGs are filled
Core Components Explained
1. Order Block Detection
Order blocks are identified by finding the candle with the most extreme price before a strong directional move. The indicator uses pivot detection to identify swing points, then traces back to find the order block candle:
- Bullish Order Block: Forms when price breaks above a pivot low - the candle with the lowest low before the breakout becomes the bullish OB
- Bearish Order Block: Forms when price breaks below a pivot high - the candle with the highest high before the breakdown becomes the bearish OB
Order blocks are drawn as boxes extending into the future. When price returns to an order block, institutions are likely to defend that zone. Mitigation occurs when price closes through the order block (wick or close mitigation options available).
2. Fair Value Gap (FVG) Detection
FVGs are three-candle patterns where there's a gap between candle 1's high/low and candle 3's low/high:
- Bullish FVG: Current low > high from 2 bars ago (gap up)
- Bearish FVG: Current high < low from 2 bars ago (gap down)
FVGs represent imbalances where price moved too quickly, leaving unfilled orders. Institutions often return to these zones to fill orders. The indicator tracks FVG mitigation using touch, wick, close, or average methods.
3. Liquidity Level Tracking
Liquidity levels are identified at pivot highs (Buy Side Liquidity - BSL) and pivot lows (Sell Side Liquidity - SSL). These represent areas where retail traders place stop losses:
- Buy Side Liquidity (BSL): Above pivot highs where long stop losses cluster
- Sell Side Liquidity (SSL): Below pivot lows where short stop losses cluster
Institutions often push price through these levels to trigger stops and fill their orders. The indicator tracks when liquidity is swept (price moves through the level) and displays swept levels with dotted lines.
4. Market Structure Analysis
The indicator tracks market structure by monitoring higher highs/lows and lower highs/lows:
- Bullish Structure: Price making higher highs and higher lows
- Bearish Structure: Price making lower highs and lower lows
- Break of Structure (BOS): When structure continues in the same direction
- Change of Character (CHOCH): When structure shifts direction
Market structure helps identify the current trend and potential reversal points. The indicator combines structure with order blocks and liquidity to identify high-probability setups.
5. Premium/Discount Zones
The indicator calculates the range between the highest high and lowest low over a lookback period (default 50 bars), then divides it into zones:
- Premium Zone: Above 50% of the range (75-100%) - ideal for shorts
- Equilibrium: At 50% of the range - neutral zone
- Discount Zone: Below 50% of the range (0-25%) - ideal for longs
Institutions typically buy in discount zones and sell in premium zones. The indicator displays these zones with dotted lines and tracks current price position.
Visual Elements
- Order Block Boxes: Solid boxes showing bullish (green) and bearish (red) order blocks with volume labels
- Fair Value Gap Boxes: Dashed boxes showing bullish (cyan) and bearish (orange) FVGs
- Liquidity Lines: Horizontal lines at pivot highs (BSL - green) and pivot lows (SSL - red)
- Premium/Discount Lines: Dotted lines showing range extremes, 75%, equilibrium, and 25% levels
- Mitigation Indicators: Faded boxes and dotted lines show mitigated zones
- Information Dashboard: Displays market structure, active OBs/FVGs, liquidity levels, price position, and trading bias
How to Use This Indicator
Step 1: Identify Market Structure
Check the dashboard for current market structure (Bullish/Bearish/Neutral). Trade in the direction of structure for highest probability.
Step 2: Locate Order Blocks
Look for unmitigated order blocks in the direction of structure. Bullish OBs in discount zones and bearish OBs in premium zones offer best setups.
Step 3: Monitor Fair Value Gaps
FVGs often get filled before price continues. Use FVGs as entry zones when they align with order blocks and structure.
Step 4: Watch for Liquidity Sweeps
When price sweeps liquidity (BSL or SSL), it often reverses. Look for liquidity sweeps near order blocks for high-probability reversals.
Step 5: Check Price Position
Use premium/discount zones to determine if price is at an extreme. Buy in discount, sell in premium, avoid equilibrium.
Step 6: Combine Elements for Confluence
Best setups occur when multiple elements align: structure + order block + FVG + liquidity sweep + premium/discount zone.
Best Practices
- Trade with market structure, not against it
- Wait for price to return to order blocks before entering
- Use liquidity sweeps as confirmation, not standalone signals
- Combine order blocks with FVGs for highest probability entries
- Avoid trading in equilibrium zones - wait for premium or discount
- Monitor mitigation - once an OB or FVG is mitigated, it's no longer valid
- Use higher timeframe structure to confirm lower timeframe setups
- Be patient - wait for all elements to align before entering
Input Parameters
Structure Detection:
- Swing Length: Pivot detection period (default: 10)
- Max Order Blocks: Maximum OBs to display (default: 3)
- Max Fair Value Gaps: Maximum FVGs to display (default: 3)
- Max Liquidity Levels: Maximum liquidity lines (default: 3)
Mitigation Rules:
- OB Mitigation: Wick or Close (default: Close)
- FVG Mitigation: Touch, Wick, Close, or Average (default: Close)
- Show Mitigated Zones: Toggle mitigated zone display (default: disabled)
Premium/Discount Zones:
- Show PD Zones: Toggle zone display (default: enabled)
- Lookback Period: Range calculation period (default: 50)
Visual Configuration:
- Bullish/Bearish OB Colors: Customizable order block colors
- Bullish/Bearish FVG Colors: Customizable FVG colors
- Buy/Sell Liquidity Colors: Customizable liquidity line colors
- Show Labels: Toggle zone labels (default: enabled)
- Show Volume: Toggle volume display on OBs (default: enabled)
- Show Dashboard: Toggle information table (default: enabled)
Originality Statement
This indicator is original in its comprehensive SMC integration. While individual concepts (order blocks, FVGs, liquidity) are established SMC principles, this indicator is justified because:
- It combines four distinct SMC methodologies into a unified detection system
- The automatic order block detection uses swing analysis to identify the exact candle
- FVG tracking with multiple mitigation methods provides flexibility
- Liquidity sweep detection with volume confirmation adds institutional context
- Premium/discount zone integration provides price positioning context
- Market structure tracking with BOS/CHOCH detection guides directional bias
- The comprehensive dashboard presents all SMC elements simultaneously
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Smart Money Concepts are analytical tools, not guarantees of future price movement. Order blocks, FVGs, and liquidity levels do not guarantee profitable trades. Always use proper risk management and never risk more than you can afford to lose.
-Made with passion by officialjackofalltrades
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.