OPEN-SOURCE SCRIPT
Cập nhật Session Intelligence Architecture [Microstructure]

SESSION INTELLIGENCE ARCHITECTURE [Microstructure]
An institutional-grade session & market-structure overlay for crypto.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WHAT IT DOES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Crypto trades 24/7, but it "breathes" in three waves — Asia, Europe and the US.
Each session has its own character. This indicator marks those sessions directly on
your chart and translates institutional metrics into clear, jargon-free signals.
It answers three questions at a glance:
• Who is in control right now — buyers or sellers?
• Is a move real, or just a liquidity trap?
• Which session is actually driving the market today?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ON-CHART VISUALS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Session Boxes — a live, growing rectangle clamped to each session's high & low
(yellow = Asia, blue = Europe, red = US). The active box border turns SOLID & thicker
when a strong, volume-backed move is underway, and DASHED when the market is quiet.
• Session VWAP — an anchored fair-value line per session that fades out after close.
• Open / Equilibrium Line — a dotted line at each session's opening price.
• Sweep & Breakout Markers — ✕ for liquidity sweeps (stop hunts), ▲/▼ triangles for
genuine structural breakouts of the Asia range.
• Focus Mode — gently dims the gaps between sessions so the active session pops.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE ENGINE (why it's different)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• ATR-NORMALIZED, not static %. A move is only flagged as a "Significant Expansion"
when |Close − Open| exceeds a multiple of the current ATR(14). This adapts to
volatility instead of using a fixed, one-size-fits-all percentage.
• SESSION-SPECIFIC RVOL. Each session's cumulative volume is compared against the
average of the last 10 SAME-type sessions (Asia vs Asia, US vs US). Above the
threshold = institutional drive; below = suspect.
• LIQUIDITY SWEEP vs. BREAKOUT. A wick beyond the Asia high/low that closes back
inside is tagged as a trap. A close outside with an expansion body (≥60% of range)
is tagged as a real breakout.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE DASHBOARD (bottom-center)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
One row per session, read left to right:
• SESSION — name + status (🟢 Active / ⚪ Inactive)
• MARKET STATE — plain language, color-coded:
🚀 Buyer Dominance (Strong) — expansion up + valid volume
🩸 Seller Dominance (Strong) — expansion down + valid volume
⚠️ Weak Trend (Trap) — expansion without volume (fake-move protection)
💤 Market Asleep / Accumulation — price still inside the ATR threshold
• PRICE & MOVE — session range + net % change
• RVOL — a 5-block progress bar (████░) with the raw ratio, e.g. (1.45x)
• ORDERFLOW — Bullish ▲ / Bearish ▼ based on price vs. session VWAP
Plus a merged bottom row: today's dominant session by combined volume & expansion.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ALERTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• "Breakout detected" — fires once per bar close (confirmed, no repaint).
• "Liquidity Sweep detected" — fires once per bar (sweeps often form intrabar).
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SETTINGS OVERVIEW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
① Sessions — timezone + the three session windows + historical lookback (days)
② Engine — ATR length & multiplier, RVOL lookback & threshold
③ Market Structure — breakout body ratio, toggle sweeps/breakouts
④ Visualization — colors, line widths, box fill color & saturation,
VWAP fade-out, Focus Mode + dim color, and on/off toggles for every element
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Best on intraday timeframes (5m–1h), where sessions are most meaningful. Watch the
dashboard for the current regime, use the Asia range + sweep/breakout markers for
structure, and the VWAP/orderflow bias to gauge who has the upper hand.
This script is an analysis tool, not financial advice. Always do your own research
and manage risk. Past behavior does not guarantee future results.
An institutional-grade session & market-structure overlay for crypto.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WHAT IT DOES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Crypto trades 24/7, but it "breathes" in three waves — Asia, Europe and the US.
Each session has its own character. This indicator marks those sessions directly on
your chart and translates institutional metrics into clear, jargon-free signals.
It answers three questions at a glance:
• Who is in control right now — buyers or sellers?
• Is a move real, or just a liquidity trap?
• Which session is actually driving the market today?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ON-CHART VISUALS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Session Boxes — a live, growing rectangle clamped to each session's high & low
(yellow = Asia, blue = Europe, red = US). The active box border turns SOLID & thicker
when a strong, volume-backed move is underway, and DASHED when the market is quiet.
• Session VWAP — an anchored fair-value line per session that fades out after close.
• Open / Equilibrium Line — a dotted line at each session's opening price.
• Sweep & Breakout Markers — ✕ for liquidity sweeps (stop hunts), ▲/▼ triangles for
genuine structural breakouts of the Asia range.
• Focus Mode — gently dims the gaps between sessions so the active session pops.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE ENGINE (why it's different)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• ATR-NORMALIZED, not static %. A move is only flagged as a "Significant Expansion"
when |Close − Open| exceeds a multiple of the current ATR(14). This adapts to
volatility instead of using a fixed, one-size-fits-all percentage.
• SESSION-SPECIFIC RVOL. Each session's cumulative volume is compared against the
average of the last 10 SAME-type sessions (Asia vs Asia, US vs US). Above the
threshold = institutional drive; below = suspect.
• LIQUIDITY SWEEP vs. BREAKOUT. A wick beyond the Asia high/low that closes back
inside is tagged as a trap. A close outside with an expansion body (≥60% of range)
is tagged as a real breakout.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE DASHBOARD (bottom-center)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
One row per session, read left to right:
• SESSION — name + status (🟢 Active / ⚪ Inactive)
• MARKET STATE — plain language, color-coded:
🚀 Buyer Dominance (Strong) — expansion up + valid volume
🩸 Seller Dominance (Strong) — expansion down + valid volume
⚠️ Weak Trend (Trap) — expansion without volume (fake-move protection)
💤 Market Asleep / Accumulation — price still inside the ATR threshold
• PRICE & MOVE — session range + net % change
• RVOL — a 5-block progress bar (████░) with the raw ratio, e.g. (1.45x)
• ORDERFLOW — Bullish ▲ / Bearish ▼ based on price vs. session VWAP
Plus a merged bottom row: today's dominant session by combined volume & expansion.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ALERTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• "Breakout detected" — fires once per bar close (confirmed, no repaint).
• "Liquidity Sweep detected" — fires once per bar (sweeps often form intrabar).
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SETTINGS OVERVIEW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
① Sessions — timezone + the three session windows + historical lookback (days)
② Engine — ATR length & multiplier, RVOL lookback & threshold
③ Market Structure — breakout body ratio, toggle sweeps/breakouts
④ Visualization — colors, line widths, box fill color & saturation,
VWAP fade-out, Focus Mode + dim color, and on/off toggles for every element
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Best on intraday timeframes (5m–1h), where sessions are most meaningful. Watch the
dashboard for the current regime, use the Asia range + sweep/breakout markers for
structure, and the VWAP/orderflow bias to gauge who has the upper hand.
This script is an analysis tool, not financial advice. Always do your own research
and manage risk. Past behavior does not guarantee future results.
Phát hành các Ghi chú
v1.1 — "Who's Trading Now?" Participant Intelligence____________________________________________________
• New bottom-right box estimating the dominant market participant — Institutional,
Smart Money, Retail or Market Maker — via a normalized volume × displacement model.
• Refined with Volume Delta one-sidedness, liquidity-sweep & delta-divergence
(absorption), VWAP-pinning and volatility compression, plus directionless chop.
• Headline verdict + confidence %, and a 4-row intensity breakdown (shares sum to 100%).
• New alert: "Dominant flow shifted" on participant change (bar close).
• Configurable rolling window, Volume-Delta lower timeframe (auto/manual), box
position and colors. Non-repainting, with graceful fallback when intrabar data
is unavailable. Honest, clearly-labelled estimate — no participant data is faked.
Phát hành các Ghi chú
v1.2 — "Spot vs Futures" Cross-Market Flow_______________________________________
• New bottom-left box reading REAL cross-market data: it pulls the matching spot AND
futures (perp) symbol via request.security and shows whether spot or futures buyers
are currently more aggressive.
• Signals: basis / premium (perp price vs spot price = leveraged buy demand), the
taker buy-delta differential (who is lifting which book harder), and volume share.
• Verdict — FUTURES-LED / SPOT-LED / BALANCED + dominant share %, with Spot/Futures
intensity bars, the live basis (premium/discount %) and the futures volume share.
• Symbols auto-derive from the chart (strip/append ".P") with manual override inputs
for other exchanges; configurable smoothing window, lower-TF and basis/delta weight.
• Robust by design: ignore_invalid_symbol means a wrong pair shows "n/a" instead of
erroring; graceful candle-sign fallback when intrabar data is unavailable. Non-repainting.
• New alert: "Spot/Futures flow" when the regime flips (bar close).
Phát hành các Ghi chú
More Style settingsPhát hành các Ghi chú
Designupdate Phát hành các Ghi chú
Added : Daily Open, Session Label.. Phát hành các Ghi chú
DesignupdatePhát hành các Ghi chú
Lables, Better UIMã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.