OPEN-SOURCE SCRIPT
SHK All-In-One | 3MA - VWAP - Liq - SMC - Marco - ZZ

╔══════════════════════════════════════════════════════════════════╗
║ SHK All-In-One [3MA · VWAP · Liq · SMC · Marco · ZZ] ║
║ by SHK · Pine Script v6 ║
╚══════════════════════════════════════════════════════════════════╝
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🏅 CREDITS & ORIGINAL AUTHORS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This script is a combined, extended and restructured version of
several outstanding open-source indicators. Full credit belongs
to the original authors listed below. I have only merged,
organised and added connecting logic.
① Smart Money Concepts (SMC)
→ Original: LuxAlgo — "SMC Lite" (open-source, TradingView)
→ Includes: BOS, CHoCH, Order Blocks, FVG, EQH/EQL,
MTF Levels, Premium/Discount Zones, STH/STL
② Liquidity Swings (BSL / SSL)
→ Original: LuxAlgo — "Liquidity Levels" (open-source)
→ Includes: Buy-Side & Sell-Side Liquidity zones,
sweep detection, volume/count filtering
③ Marco Polo Top Detective
→ Original: Marco Polo — community TradingView adaptation
→ Includes: Custom pivot top/bottom detection,
BBands 3-bar reversal confirmation
④ ZigZag Engine (Swing + Internal)
→ Original: Classic TradingView community ZigZag
(multiple open-source contributors)
→ Includes: Swing ZigZag with HH/HL/LH/LL labels,
Internal ZigZag with separate settings
⑤ UT Bot Filter (inside Signal MA)
→ Original: QuantNomad — "UT Bot Alert" (open-source)
→ Used as one of three Signal MA colour filters
⑥ Supertrend Filter (inside Signal MA)
→ Built-in ta.supertrend() — Pine Script standard library
→ Used as one of three Signal MA colour filters
⑦ 3 MA + Signal MA System + VWAP
→ Original work by SHK
→ Includes: 3 independent MAs, a colour-coded Signal MA
combining HA + Supertrend + UT Bot filters,
and an anchored VWAP
Combined, unified and extended by SHK.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 WHAT IS THIS INDICATOR?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SHK All-In-One brings together five of the most powerful
open-source market analysis tools into a single, clean,
modular indicator. Instead of adding 5 separate scripts to
your chart and dealing with clutter and conflicts, everything
lives in one place.
Each of the five modules can be INDEPENDENTLY TURNED ON OR OFF
using the Master Toggles at the top of the settings. Use only
what you need — run all five at once or pick just one.
Designed primarily for Indian markets (Nifty, BankNifty,
Sensex, MCX commodities) but works on any symbol and timeframe.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
① 3 MA + VWAP MODULE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Three fully independent Moving Averages, each with its own
type, length and colour setting.
SUPPORTED MA TYPES:
• EMA — Exponential Moving Average
• SMA — Simple Moving Average
• WMA — Weighted Moving Average
• HMA — Hull Moving Average (smooth, low lag)
• TEMA — Triple EMA (very low lag)
• DEMA — Double EMA (reduced lag)
• ZLEMA — Zero-Lag EMA (lag corrected using looback)
All three MAs default to EMA 9 / 21 / 50 — the classic
short, medium and long-term trend framework.
SIGNAL MA:
A fourth moving average acts as a dynamic trend signal line.
It changes colour based on THREE combined market filters:
Filter 1 — Heiken Ashi:
Reads the Heiken Ashi close vs open to determine if price
action is in a bullish or bearish HA candle. Smooths out
noise from regular candles.
Filter 2 — Supertrend:
Uses ta.supertrend() with configurable ATR length and
factor. Adds a trend-following layer to the signal.
Filter 3 — UT Bot:
QuantNomad's UT Bot trailing stop logic using ATR.
Identifies momentum direction based on a key value
multiplier and ATR period.
Scoring system:
Each filter votes +1 (bullish) or -1 (bearish).
Total score > 0 → Signal MA turns GREEN (bullish)
Total score < 0 → Signal MA turns RED (bearish)
Total score = 0 → Signal MA turns GREY (neutral)
You can enable or disable any of the three filters
individually. Running all three gives the most robust signal.
MA CROSSOVER LABELS:
Whenever MA1 crosses MA2, or MA2 crosses MA3, a small
triangle label appears on the chart automatically.
Upward triangle = bullish cross (below bar)
Downward triangle = bearish cross (above bar)
The label shows the two MA lengths that crossed.
VWAP (Volume Weighted Average Price):
A fully anchored VWAP is included with anchor options:
Session / Week / Month / Quarter / Year
VWAP is calculated from scratch using cumulative
TPV (typical price × volume) for accuracy.
Displayed as a bold coloured line (default yellow).
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
② LIQUIDITY SWINGS MODULE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Identifies areas where resting liquidity (stop losses and
pending orders) is likely clustered above swing highs and
below swing lows. Based on LuxAlgo's Liquidity Levels logic.
HOW IT WORKS:
Uses ta.pivothigh() and ta.pivotlow() with a configurable
lookback length to detect swing pivot points.
For each detected swing high → marks a BSL zone
(Buy-Side Liquidity — stop losses of shorts clustered above)
For each detected swing low → marks a SSL zone
(Sell-Side Liquidity — stop losses of longs clustered below)
A horizontal line is drawn at the pivot level and extends
to the right until price sweeps through it.
When price closes beyond the level:
• Line turns DASHED
• Label updates to "✓ BSL Swept" or "✓ SSL Swept"
• Zone box fades
SWING AREA MODES:
Wick Extremity — Zone top/bottom uses the wick extreme
vs the candle body edge (tighter zone)
Full Range — Zone spans full candle high to low
FILTERING:
Filter by Count — minimum number of bars that touched
the zone (liquidity density)
Filter by Volume — minimum cumulative volume inside
the zone (institutional interest)
LABELS:
Each level shows "▲ Buy Side Liquidity" or
"▼ Sell Side Liquidity" with the cumulative volume.
Label size and BSL/SSL label size are configurable.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
③ SMART MONEY CONCEPTS (SMC) MODULE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The most comprehensive module. Based on LuxAlgo's SMC Lite
open-source indicator, adapted and integrated for this script.
─── STRUCTURE ───────────────────────────────────────────────
SWING STRUCTURE:
Identifies the major market structure by tracking swing
highs and swing lows over a configurable lookback length.
BOS (Break of Structure):
Price closes beyond the last swing high/low in the
SAME direction as the current trend. Confirms trend
continuation.
CHoCH (Change of Character):
Price closes beyond the last swing high/low in the
OPPOSITE direction of the current trend. First signal
of a potential trend reversal.
A line is drawn from the broken level to the current bar,
labelled BOS or CHoCH. Bullish = green, Bearish = red.
INTERNAL STRUCTURE:
Same BOS/CHoCH logic applied to a shorter lookback (5 bars)
to catch intrabar / internal structure shifts.
Internal structure lines are dashed to distinguish from
swing structure.
Confluence Filter option: when enabled, only shows
internal structure that aligns with candle body direction
(filters out weak signals).
SWING POINTS:
Optional labels showing HH (Higher High), HL (Higher Low),
LH (Lower High), LL (Lower Low) at each pivot.
STRONG / WEAK HIGH-LOW LABELS:
STH (Short-Term High) and STL (Short-Term Low) mark the
most recent swing extreme. When both occur at the same
bar, shows a combined STH/STL label.
─── ORDER BLOCKS ────────────────────────────────────────────
Order Blocks are the last up/down candle before a BOS or
CHoCH. They represent areas where institutional orders
were placed and price is likely to react on a return visit.
INTERNAL ORDER BLOCKS:
Derived from internal structure BOS/CHoCH events.
Show the 5 most recent (configurable up to 20).
SWING ORDER BLOCKS:
Derived from swing structure BOS/CHoCH events.
Disabled by default (toggle on if needed).
OB FILTER:
ATR Filter — removes OBs from high-volatility candles
(candle range ≥ 2× ATR is excluded as noise)
Cumulative Mean Range Filter — uses average range
instead of ATR as the volatility measure
OB MITIGATION:
Close — OB is mitigated when price CLOSES inside it
High/Low — OB is mitigated when price WICKS into it
Each OB is drawn as a coloured box that extends to the
right until price mitigates it.
─── FAIR VALUE GAPS (FVG) ───────────────────────────────────
A Fair Value Gap is a 3-candle imbalance where:
Bullish FVG: candle 3 low > candle 1 high (gap up)
Bearish FVG: candle 3 high < candle 1 low (gap down)
FVGs are drawn as semi-transparent boxes.
Auto Threshold option filters out micro-gaps below
0.5× ATR (reduces noise).
Optional multi-timeframe FVG via timeframe input —
you can display FVGs from a higher timeframe on your
current chart.
─── EQUAL HIGHS / EQUAL LOWS (EQH/EQL) ─────────────────────
Detects when two consecutive swing highs or lows are within
a configurable ATR threshold of each other, indicating
clustered liquidity at that level.
Drawn as a dotted line between the two equal levels,
labelled EQH or EQL.
─── MULTI-TIMEFRAME HIGHS & LOWS ────────────────────────────
Draws the previous period's High and Low for:
• Daily (previous day high/low)
• Weekly (previous week high/low)
• Monthly (previous month high/low)
Each level has its own style (solid/dashed/dotted) and
colour. Useful as key support/resistance reference levels.
─── PREMIUM / DISCOUNT / EQUILIBRIUM ZONES ──────────────────
Based on the current swing high and swing low (trailing
extremes), the visible range is divided into three zones:
Premium Zone (top 5%):
Price is trading at a premium. Bearish bias —
institutions tend to SELL in premium.
Equilibrium Zone (middle 5% around 50%):
Price is at fair value. Neutral zone.
Discount Zone (bottom 5%):
Price is at a discount. Bullish bias —
institutions tend to BUY in discount.
Display modes:
Historical — draws ALL historical structure and OBs
Present — draws only the MOST RECENT instance
(cleaner chart for live trading)
Style modes:
Colored — standard green/red/blue colours
Monochrome — single grey tone (for minimal charts)
─── SMC ALERTS ──────────────────────────────────────────────
Full alert conditions available for:
Internal Bullish / Bearish BOS
Internal Bullish / Bearish CHoCH
Swing Bullish / Bearish BOS
Swing Bullish / Bearish CHoCH
Equal Highs / Equal Lows
Bullish / Bearish Fair Value Gap
Internal Bullish / Bearish Order Block (mitigated)
Swing Bullish / Bearish Order Block (mitigated)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
④ MARCO POLO TOP DETECTIVE MODULE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
A pivot detection tool that identifies significant swing
tops and bottoms using a custom algorithm — different from
the standard ta.pivothigh() approach.
PIVOT DETECTION:
Uses a rolling highest/lowest scan over a configurable
Depth. A pivot is confirmed only when the price found
deviates from the previous pivot by more than a threshold:
Threshold = ATR(10) / close × 100 × Deviation input
This prevents trivial micro-swings from being plotted and
focuses only on significant structural pivots.
Labels appear DEPTH bars back (offset) so they appear
at the actual pivot bar, not the confirmation bar.
→ "Top Pivot" label (red, above bar)
→ "Bot Pivot" label (blue, below bar)
BOLLINGER BANDS REVERSAL CONFIRMATION:
A second layer — the 3-bar BBands pattern — identifies
short-term exhaustion reversals:
Bear Reversal (bearish):
• 2 bars ago: close > BBands upper AND green candle
• 1 bar ago: close > BBands upper AND red candle
• Current bar: close < 1-bar-ago high
→ "Bear Rev" label (orange, above bar)
Bull Reversal (bullish):
• 2 bars ago: close < BBands lower AND red candle
• 1 bar ago: close < BBands lower AND green candle
• Current bar: close > 1-bar-ago low
→ "Bull Rev" label (lime green, below bar)
This pattern catches short-term mean-reversion setups
at Bollinger Band extremes with candle confirmation.
ALERTS:
Marco Top Detected — pivot top or bear reversal found
Marco Bottom Detected — pivot bottom or bull reversal
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⑤ ZIGZAG MODULE (SWING + INTERNAL)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
A dual ZigZag engine with a main Swing ZigZag and a
faster Internal ZigZag — each fully independent.
SWING ZIGZAG:
Depth — minimum bars before a pivot is confirmed
Deviation — minimum % price move required for a new leg
Backstep — minimum bars between two pivots
Each ZigZag leg is drawn as a line connecting consecutive
swing highs and lows. Bull legs (rising) and Bear legs
(falling) use separate configurable colours.
HH / HL / LH / LL LABELS:
Each pivot is automatically classified and labelled:
• HH — Higher High (bullish trend continuation)
• HL — Higher Low (bullish trend continuation)
• LH — Lower High (bearish trend continuation)
• LL — Lower Low (bearish trend continuation)
Label size is configurable (Tiny / Small / Normal).
INTERNAL ZIGZAG:
A faster ZigZag with smaller depth and deviation to
capture internal market structure swings within the
main ZigZag legs. Displayed with a different colour
and style (default dashed) to separate it visually
from the main swing ZigZag.
The internal ZigZag is disabled by default. Turn it on
in the Internal ZigZag settings group.
LINE STYLES (both ZigZags):
⎯⎯⎯ Solid
---- Dashed
···· Dotted
Line width: 1–4
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ SETTINGS OVERVIEW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
◆ Master Toggles
Enable / Disable each of the 5 modules independently.
① MA 1 / MA 2 / MA 3 — Type, Length, Colour
① Signal MA — Type, Length, Width, Bull/Bear/Neutral colours
① Signal MA Filters — HA toggle, Supertrend toggle, UT Bot toggle
① Supertrend — ATR Length, Factor
① UT Bot — Key Value, ATR Period
① VWAP — Show toggle, Anchor, Colour
② Liquidity Swings — Pivot Lookback, Swing Area mode
② Filter — Count or Volume, threshold value
② Style — Swing High colour, Swing Low colour,
area colours, label sizes, BSL/SSL labels
③ Smart Money Concepts — Mode (Historical/Present),
Style (Colored/Monochrome)
③ Internal Structure — Show toggle, Bull/Bear filter, label size,
Confluence Filter
③ Swing Structure — Show toggle, Bull/Bear filter, label size,
Swing Points toggle + length,
Strong/Weak High/Low toggle
③ Order Blocks — Internal OB toggle + size,
Swing OB toggle + size,
OB Filter type, OB Mitigation type,
4 individual OB colours
③ EQH/EQL — Show toggle, Bars Confirmation,
Threshold (ATR multiplier), Label size
③ Fair Value Gaps — Show toggle, Auto Threshold,
Timeframe, Bull/Bear colours, Extend
③ Highs & Lows MTF — Daily / Weekly / Monthly toggles,
style and colour for each
③ Premium & Discount — Show toggle, Premium / Equilibrium /
Discount zone colours
④ Marco Polo — Deviation, Depth, Text colour,
BBands Length, BBands Multiplier
⑤ Main ZigZag — Depth, Deviation, Backstep,
Bull/Bear colours, Width, Style,
HH/HL labels toggle + size
⑤ Internal ZigZag — Same settings as main ZigZag,
independently configured
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 ALERTS SUMMARY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SMC Alerts:
✦ Internal Bullish BOS ✦ Internal Bearish BOS
✦ Internal Bullish CHoCH ✦ Internal Bearish CHoCH
✦ Swing Bullish BOS ✦ Swing Bearish BOS
✦ Swing Bullish CHoCH ✦ Swing Bearish CHoCH
✦ Equal Highs ✦ Equal Lows
✦ Bullish Fair Value Gap ✦ Bearish Fair Value Gap
Marco Polo Alerts:
✦ Marco Top Detected (pivot top or bear reversal)
✦ Marco Bottom Detected (pivot bottom or bull reversal)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📝 USAGE TIPS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• On lower timeframes (1m–5m), disable Fair Value Gaps
and Swing Order Blocks to reduce visual clutter.
• For Nifty/BankNifty intraday, recommended setup:
Signal MA (EMA 20) with all 3 filters ON +
Liquidity Swings + Internal SMC structure only.
• For positional/swing trading, enable the full SMC
module with Historical mode to see all past structure.
• Use Master Toggles to turn off modules you don't need —
this significantly improves chart performance.
• ZigZag and SMC Swing Structure complement each other:
ZigZag shows the visual wave, SMC labels the reason
(BOS/CHoCH) at each pivot.
• Marco Polo works best on 15m and above for pivot
detection. On 1m it may generate excessive signals.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📜 LICENSE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CC BY-NC-SA 4.0 — Attribution-NonCommercial-ShareAlike 4.0
creativecommons.org/licenses/by-nc-sa/4.0/
✅ Free to use for personal and educational purposes
✅ Free to share with proper credit to SHK and original authors
✅ Free to adapt and modify with credit and same license
❌ Commercial use is NOT permitted
❌ Cannot be republished as invite-only or paid script
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ DISCLAIMER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator is published for EDUCATIONAL and INFORMATIONAL
purposes only. It is NOT financial advice, investment advice,
or a recommendation to buy or sell any financial instrument.
Trading and investing in financial markets — including stocks,
indices, commodities, currencies and derivatives — involves
substantial risk of loss. Past performance of any indicator,
strategy or signal does NOT guarantee future results.
The signals, labels, zones and levels produced by this script
are based purely on mathematical calculations applied to
historical price and volume data. They do not predict the
future with certainty. No indicator can.
YOU are solely responsible for your own trading decisions.
Always do your own research and analysis before entering any
trade. Always use proper risk management — including stop
losses and position sizing — on every trade.
The author (SHK) and the original authors of all combined
modules (LuxAlgo, QuantNomad, Marco Polo, ZigZag community)
accept NO liability for any financial losses incurred from
the use of this script, directly or indirectly.
This script is provided "AS IS" without warranty of any kind,
express or implied. The author makes no guarantee that the
script will function correctly on all symbols, timeframes,
brokers or data feeds.
By using this script, you acknowledge and accept that:
• All trading decisions are made entirely at your own risk
• No profit is guaranteed by using this indicator
• The author bears zero responsibility for your P&L
If you are unsure about any trade, consult a registered
financial advisor before taking action.
Trade safe. Manage your risk. Protect your capital. 🙏
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
║ SHK All-In-One [3MA · VWAP · Liq · SMC · Marco · ZZ] ║
║ by SHK · Pine Script v6 ║
╚══════════════════════════════════════════════════════════════════╝
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🏅 CREDITS & ORIGINAL AUTHORS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This script is a combined, extended and restructured version of
several outstanding open-source indicators. Full credit belongs
to the original authors listed below. I have only merged,
organised and added connecting logic.
① Smart Money Concepts (SMC)
→ Original: LuxAlgo — "SMC Lite" (open-source, TradingView)
→ Includes: BOS, CHoCH, Order Blocks, FVG, EQH/EQL,
MTF Levels, Premium/Discount Zones, STH/STL
② Liquidity Swings (BSL / SSL)
→ Original: LuxAlgo — "Liquidity Levels" (open-source)
→ Includes: Buy-Side & Sell-Side Liquidity zones,
sweep detection, volume/count filtering
③ Marco Polo Top Detective
→ Original: Marco Polo — community TradingView adaptation
→ Includes: Custom pivot top/bottom detection,
BBands 3-bar reversal confirmation
④ ZigZag Engine (Swing + Internal)
→ Original: Classic TradingView community ZigZag
(multiple open-source contributors)
→ Includes: Swing ZigZag with HH/HL/LH/LL labels,
Internal ZigZag with separate settings
⑤ UT Bot Filter (inside Signal MA)
→ Original: QuantNomad — "UT Bot Alert" (open-source)
→ Used as one of three Signal MA colour filters
⑥ Supertrend Filter (inside Signal MA)
→ Built-in ta.supertrend() — Pine Script standard library
→ Used as one of three Signal MA colour filters
⑦ 3 MA + Signal MA System + VWAP
→ Original work by SHK
→ Includes: 3 independent MAs, a colour-coded Signal MA
combining HA + Supertrend + UT Bot filters,
and an anchored VWAP
Combined, unified and extended by SHK.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 WHAT IS THIS INDICATOR?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SHK All-In-One brings together five of the most powerful
open-source market analysis tools into a single, clean,
modular indicator. Instead of adding 5 separate scripts to
your chart and dealing with clutter and conflicts, everything
lives in one place.
Each of the five modules can be INDEPENDENTLY TURNED ON OR OFF
using the Master Toggles at the top of the settings. Use only
what you need — run all five at once or pick just one.
Designed primarily for Indian markets (Nifty, BankNifty,
Sensex, MCX commodities) but works on any symbol and timeframe.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
① 3 MA + VWAP MODULE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Three fully independent Moving Averages, each with its own
type, length and colour setting.
SUPPORTED MA TYPES:
• EMA — Exponential Moving Average
• SMA — Simple Moving Average
• WMA — Weighted Moving Average
• HMA — Hull Moving Average (smooth, low lag)
• TEMA — Triple EMA (very low lag)
• DEMA — Double EMA (reduced lag)
• ZLEMA — Zero-Lag EMA (lag corrected using looback)
All three MAs default to EMA 9 / 21 / 50 — the classic
short, medium and long-term trend framework.
SIGNAL MA:
A fourth moving average acts as a dynamic trend signal line.
It changes colour based on THREE combined market filters:
Filter 1 — Heiken Ashi:
Reads the Heiken Ashi close vs open to determine if price
action is in a bullish or bearish HA candle. Smooths out
noise from regular candles.
Filter 2 — Supertrend:
Uses ta.supertrend() with configurable ATR length and
factor. Adds a trend-following layer to the signal.
Filter 3 — UT Bot:
QuantNomad's UT Bot trailing stop logic using ATR.
Identifies momentum direction based on a key value
multiplier and ATR period.
Scoring system:
Each filter votes +1 (bullish) or -1 (bearish).
Total score > 0 → Signal MA turns GREEN (bullish)
Total score < 0 → Signal MA turns RED (bearish)
Total score = 0 → Signal MA turns GREY (neutral)
You can enable or disable any of the three filters
individually. Running all three gives the most robust signal.
MA CROSSOVER LABELS:
Whenever MA1 crosses MA2, or MA2 crosses MA3, a small
triangle label appears on the chart automatically.
Upward triangle = bullish cross (below bar)
Downward triangle = bearish cross (above bar)
The label shows the two MA lengths that crossed.
VWAP (Volume Weighted Average Price):
A fully anchored VWAP is included with anchor options:
Session / Week / Month / Quarter / Year
VWAP is calculated from scratch using cumulative
TPV (typical price × volume) for accuracy.
Displayed as a bold coloured line (default yellow).
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
② LIQUIDITY SWINGS MODULE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Identifies areas where resting liquidity (stop losses and
pending orders) is likely clustered above swing highs and
below swing lows. Based on LuxAlgo's Liquidity Levels logic.
HOW IT WORKS:
Uses ta.pivothigh() and ta.pivotlow() with a configurable
lookback length to detect swing pivot points.
For each detected swing high → marks a BSL zone
(Buy-Side Liquidity — stop losses of shorts clustered above)
For each detected swing low → marks a SSL zone
(Sell-Side Liquidity — stop losses of longs clustered below)
A horizontal line is drawn at the pivot level and extends
to the right until price sweeps through it.
When price closes beyond the level:
• Line turns DASHED
• Label updates to "✓ BSL Swept" or "✓ SSL Swept"
• Zone box fades
SWING AREA MODES:
Wick Extremity — Zone top/bottom uses the wick extreme
vs the candle body edge (tighter zone)
Full Range — Zone spans full candle high to low
FILTERING:
Filter by Count — minimum number of bars that touched
the zone (liquidity density)
Filter by Volume — minimum cumulative volume inside
the zone (institutional interest)
LABELS:
Each level shows "▲ Buy Side Liquidity" or
"▼ Sell Side Liquidity" with the cumulative volume.
Label size and BSL/SSL label size are configurable.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
③ SMART MONEY CONCEPTS (SMC) MODULE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The most comprehensive module. Based on LuxAlgo's SMC Lite
open-source indicator, adapted and integrated for this script.
─── STRUCTURE ───────────────────────────────────────────────
SWING STRUCTURE:
Identifies the major market structure by tracking swing
highs and swing lows over a configurable lookback length.
BOS (Break of Structure):
Price closes beyond the last swing high/low in the
SAME direction as the current trend. Confirms trend
continuation.
CHoCH (Change of Character):
Price closes beyond the last swing high/low in the
OPPOSITE direction of the current trend. First signal
of a potential trend reversal.
A line is drawn from the broken level to the current bar,
labelled BOS or CHoCH. Bullish = green, Bearish = red.
INTERNAL STRUCTURE:
Same BOS/CHoCH logic applied to a shorter lookback (5 bars)
to catch intrabar / internal structure shifts.
Internal structure lines are dashed to distinguish from
swing structure.
Confluence Filter option: when enabled, only shows
internal structure that aligns with candle body direction
(filters out weak signals).
SWING POINTS:
Optional labels showing HH (Higher High), HL (Higher Low),
LH (Lower High), LL (Lower Low) at each pivot.
STRONG / WEAK HIGH-LOW LABELS:
STH (Short-Term High) and STL (Short-Term Low) mark the
most recent swing extreme. When both occur at the same
bar, shows a combined STH/STL label.
─── ORDER BLOCKS ────────────────────────────────────────────
Order Blocks are the last up/down candle before a BOS or
CHoCH. They represent areas where institutional orders
were placed and price is likely to react on a return visit.
INTERNAL ORDER BLOCKS:
Derived from internal structure BOS/CHoCH events.
Show the 5 most recent (configurable up to 20).
SWING ORDER BLOCKS:
Derived from swing structure BOS/CHoCH events.
Disabled by default (toggle on if needed).
OB FILTER:
ATR Filter — removes OBs from high-volatility candles
(candle range ≥ 2× ATR is excluded as noise)
Cumulative Mean Range Filter — uses average range
instead of ATR as the volatility measure
OB MITIGATION:
Close — OB is mitigated when price CLOSES inside it
High/Low — OB is mitigated when price WICKS into it
Each OB is drawn as a coloured box that extends to the
right until price mitigates it.
─── FAIR VALUE GAPS (FVG) ───────────────────────────────────
A Fair Value Gap is a 3-candle imbalance where:
Bullish FVG: candle 3 low > candle 1 high (gap up)
Bearish FVG: candle 3 high < candle 1 low (gap down)
FVGs are drawn as semi-transparent boxes.
Auto Threshold option filters out micro-gaps below
0.5× ATR (reduces noise).
Optional multi-timeframe FVG via timeframe input —
you can display FVGs from a higher timeframe on your
current chart.
─── EQUAL HIGHS / EQUAL LOWS (EQH/EQL) ─────────────────────
Detects when two consecutive swing highs or lows are within
a configurable ATR threshold of each other, indicating
clustered liquidity at that level.
Drawn as a dotted line between the two equal levels,
labelled EQH or EQL.
─── MULTI-TIMEFRAME HIGHS & LOWS ────────────────────────────
Draws the previous period's High and Low for:
• Daily (previous day high/low)
• Weekly (previous week high/low)
• Monthly (previous month high/low)
Each level has its own style (solid/dashed/dotted) and
colour. Useful as key support/resistance reference levels.
─── PREMIUM / DISCOUNT / EQUILIBRIUM ZONES ──────────────────
Based on the current swing high and swing low (trailing
extremes), the visible range is divided into three zones:
Premium Zone (top 5%):
Price is trading at a premium. Bearish bias —
institutions tend to SELL in premium.
Equilibrium Zone (middle 5% around 50%):
Price is at fair value. Neutral zone.
Discount Zone (bottom 5%):
Price is at a discount. Bullish bias —
institutions tend to BUY in discount.
Display modes:
Historical — draws ALL historical structure and OBs
Present — draws only the MOST RECENT instance
(cleaner chart for live trading)
Style modes:
Colored — standard green/red/blue colours
Monochrome — single grey tone (for minimal charts)
─── SMC ALERTS ──────────────────────────────────────────────
Full alert conditions available for:
Internal Bullish / Bearish BOS
Internal Bullish / Bearish CHoCH
Swing Bullish / Bearish BOS
Swing Bullish / Bearish CHoCH
Equal Highs / Equal Lows
Bullish / Bearish Fair Value Gap
Internal Bullish / Bearish Order Block (mitigated)
Swing Bullish / Bearish Order Block (mitigated)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
④ MARCO POLO TOP DETECTIVE MODULE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
A pivot detection tool that identifies significant swing
tops and bottoms using a custom algorithm — different from
the standard ta.pivothigh() approach.
PIVOT DETECTION:
Uses a rolling highest/lowest scan over a configurable
Depth. A pivot is confirmed only when the price found
deviates from the previous pivot by more than a threshold:
Threshold = ATR(10) / close × 100 × Deviation input
This prevents trivial micro-swings from being plotted and
focuses only on significant structural pivots.
Labels appear DEPTH bars back (offset) so they appear
at the actual pivot bar, not the confirmation bar.
→ "Top Pivot" label (red, above bar)
→ "Bot Pivot" label (blue, below bar)
BOLLINGER BANDS REVERSAL CONFIRMATION:
A second layer — the 3-bar BBands pattern — identifies
short-term exhaustion reversals:
Bear Reversal (bearish):
• 2 bars ago: close > BBands upper AND green candle
• 1 bar ago: close > BBands upper AND red candle
• Current bar: close < 1-bar-ago high
→ "Bear Rev" label (orange, above bar)
Bull Reversal (bullish):
• 2 bars ago: close < BBands lower AND red candle
• 1 bar ago: close < BBands lower AND green candle
• Current bar: close > 1-bar-ago low
→ "Bull Rev" label (lime green, below bar)
This pattern catches short-term mean-reversion setups
at Bollinger Band extremes with candle confirmation.
ALERTS:
Marco Top Detected — pivot top or bear reversal found
Marco Bottom Detected — pivot bottom or bull reversal
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⑤ ZIGZAG MODULE (SWING + INTERNAL)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
A dual ZigZag engine with a main Swing ZigZag and a
faster Internal ZigZag — each fully independent.
SWING ZIGZAG:
Depth — minimum bars before a pivot is confirmed
Deviation — minimum % price move required for a new leg
Backstep — minimum bars between two pivots
Each ZigZag leg is drawn as a line connecting consecutive
swing highs and lows. Bull legs (rising) and Bear legs
(falling) use separate configurable colours.
HH / HL / LH / LL LABELS:
Each pivot is automatically classified and labelled:
• HH — Higher High (bullish trend continuation)
• HL — Higher Low (bullish trend continuation)
• LH — Lower High (bearish trend continuation)
• LL — Lower Low (bearish trend continuation)
Label size is configurable (Tiny / Small / Normal).
INTERNAL ZIGZAG:
A faster ZigZag with smaller depth and deviation to
capture internal market structure swings within the
main ZigZag legs. Displayed with a different colour
and style (default dashed) to separate it visually
from the main swing ZigZag.
The internal ZigZag is disabled by default. Turn it on
in the Internal ZigZag settings group.
LINE STYLES (both ZigZags):
⎯⎯⎯ Solid
---- Dashed
···· Dotted
Line width: 1–4
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ SETTINGS OVERVIEW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
◆ Master Toggles
Enable / Disable each of the 5 modules independently.
① MA 1 / MA 2 / MA 3 — Type, Length, Colour
① Signal MA — Type, Length, Width, Bull/Bear/Neutral colours
① Signal MA Filters — HA toggle, Supertrend toggle, UT Bot toggle
① Supertrend — ATR Length, Factor
① UT Bot — Key Value, ATR Period
① VWAP — Show toggle, Anchor, Colour
② Liquidity Swings — Pivot Lookback, Swing Area mode
② Filter — Count or Volume, threshold value
② Style — Swing High colour, Swing Low colour,
area colours, label sizes, BSL/SSL labels
③ Smart Money Concepts — Mode (Historical/Present),
Style (Colored/Monochrome)
③ Internal Structure — Show toggle, Bull/Bear filter, label size,
Confluence Filter
③ Swing Structure — Show toggle, Bull/Bear filter, label size,
Swing Points toggle + length,
Strong/Weak High/Low toggle
③ Order Blocks — Internal OB toggle + size,
Swing OB toggle + size,
OB Filter type, OB Mitigation type,
4 individual OB colours
③ EQH/EQL — Show toggle, Bars Confirmation,
Threshold (ATR multiplier), Label size
③ Fair Value Gaps — Show toggle, Auto Threshold,
Timeframe, Bull/Bear colours, Extend
③ Highs & Lows MTF — Daily / Weekly / Monthly toggles,
style and colour for each
③ Premium & Discount — Show toggle, Premium / Equilibrium /
Discount zone colours
④ Marco Polo — Deviation, Depth, Text colour,
BBands Length, BBands Multiplier
⑤ Main ZigZag — Depth, Deviation, Backstep,
Bull/Bear colours, Width, Style,
HH/HL labels toggle + size
⑤ Internal ZigZag — Same settings as main ZigZag,
independently configured
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 ALERTS SUMMARY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SMC Alerts:
✦ Internal Bullish BOS ✦ Internal Bearish BOS
✦ Internal Bullish CHoCH ✦ Internal Bearish CHoCH
✦ Swing Bullish BOS ✦ Swing Bearish BOS
✦ Swing Bullish CHoCH ✦ Swing Bearish CHoCH
✦ Equal Highs ✦ Equal Lows
✦ Bullish Fair Value Gap ✦ Bearish Fair Value Gap
Marco Polo Alerts:
✦ Marco Top Detected (pivot top or bear reversal)
✦ Marco Bottom Detected (pivot bottom or bull reversal)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📝 USAGE TIPS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• On lower timeframes (1m–5m), disable Fair Value Gaps
and Swing Order Blocks to reduce visual clutter.
• For Nifty/BankNifty intraday, recommended setup:
Signal MA (EMA 20) with all 3 filters ON +
Liquidity Swings + Internal SMC structure only.
• For positional/swing trading, enable the full SMC
module with Historical mode to see all past structure.
• Use Master Toggles to turn off modules you don't need —
this significantly improves chart performance.
• ZigZag and SMC Swing Structure complement each other:
ZigZag shows the visual wave, SMC labels the reason
(BOS/CHoCH) at each pivot.
• Marco Polo works best on 15m and above for pivot
detection. On 1m it may generate excessive signals.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📜 LICENSE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CC BY-NC-SA 4.0 — Attribution-NonCommercial-ShareAlike 4.0
creativecommons.org/licenses/by-nc-sa/4.0/
✅ Free to use for personal and educational purposes
✅ Free to share with proper credit to SHK and original authors
✅ Free to adapt and modify with credit and same license
❌ Commercial use is NOT permitted
❌ Cannot be republished as invite-only or paid script
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ DISCLAIMER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator is published for EDUCATIONAL and INFORMATIONAL
purposes only. It is NOT financial advice, investment advice,
or a recommendation to buy or sell any financial instrument.
Trading and investing in financial markets — including stocks,
indices, commodities, currencies and derivatives — involves
substantial risk of loss. Past performance of any indicator,
strategy or signal does NOT guarantee future results.
The signals, labels, zones and levels produced by this script
are based purely on mathematical calculations applied to
historical price and volume data. They do not predict the
future with certainty. No indicator can.
YOU are solely responsible for your own trading decisions.
Always do your own research and analysis before entering any
trade. Always use proper risk management — including stop
losses and position sizing — on every trade.
The author (SHK) and the original authors of all combined
modules (LuxAlgo, QuantNomad, Marco Polo, ZigZag community)
accept NO liability for any financial losses incurred from
the use of this script, directly or indirectly.
This script is provided "AS IS" without warranty of any kind,
express or implied. The author makes no guarantee that the
script will function correctly on all symbols, timeframes,
brokers or data feeds.
By using this script, you acknowledge and accept that:
• All trading decisions are made entirely at your own risk
• No profit is guaranteed by using this indicator
• The author bears zero responsibility for your P&L
If you are unsure about any trade, consult a registered
financial advisor before taking action.
Trade safe. Manage your risk. Protect your capital. 🙏
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。