OPEN-SOURCE SCRIPT
Linh Index Trend & Exhaustion Suite

Purpose: One overlay to judge trend, reversal risk, overextension, and volatility squeezes on indexes (built for VNINDEX/VN30, works on any symbol & timeframe).
What it shows
Trend state: Bull / Bear / Transition via 20/50/200 EMAs + slope check.
Overextension heatmap: Background paints when price is stretched vs the 20-EMA by ATR or % (you set the thresholds).
Squeeze detection:
Squeeze ON (yellow dot): Bollinger Bands (20,2) inside Keltner Channels (20,1.5).
Squeeze OFF + Release: White dot; script confirms direction only when close > BB upper (up) or close < BB lower (down).
52-week context: Distance to 52-week high/low (%).
Higher-TF alignment: Optional weekly trend reading shown on the label while you’re on the daily.
Anchored VWAP(s): Two optional AVWAPs from dates you choose (e.g., YTD open, last big gap/earnings).
Plots & labels
EMAs 20/50/200 (toggle on/off).
Optional BB & KC bands for diagnostics.
AVWAP #1 / #2 (optional).
Status label with: Trend, EMAs, Dist to 20-EMA (%, ATR), 52-week distances, HTF state.
Built-in alerts (set “Once per bar close”)
EMA10 ↔ EMA20 cross (early momentum shift)
EMA20 ↔ EMA50 cross (trend confirmation/negation)
Price ↔ EMA200 cross (long-term regime)
Squeeze Release UP / DOWN (BB breakout after squeeze)
Overextension Cool-off UP / DN (stretched vs 20-EMA + momentum rolling)
Near 52-week High (within your % threshold)
How to use (playbook)
Map regime: Prefer trades when Daily = Bull and HTF (Weekly) = Bull (shown on label).
Hunt expansion: Yellow → White dot and close beyond BB = fresh move.
Avoid chasing stretch: If background is painted (overextended vs 20-EMA), wait for a pullback or intraday base.
Locations matter: 52-week proximity + HTF Bull improves breakout quality.
Anchors: Add AVWAP from YTD open or last major gap to frame support/resistance.
Suggested settings
Overextension: ATR = 2.0, % = 4.0 to start; tune per index volatility.
Squeeze bands: BB(20,2) & KC(20,1.5) default are balanced; tighten KC (1.3) for more signals, widen (1.8) for fewer/higher quality.
Timeframes: Daily for signals, Weekly for bias. Optional 65-min for entries.
What it shows
Trend state: Bull / Bear / Transition via 20/50/200 EMAs + slope check.
Overextension heatmap: Background paints when price is stretched vs the 20-EMA by ATR or % (you set the thresholds).
Squeeze detection:
Squeeze ON (yellow dot): Bollinger Bands (20,2) inside Keltner Channels (20,1.5).
Squeeze OFF + Release: White dot; script confirms direction only when close > BB upper (up) or close < BB lower (down).
52-week context: Distance to 52-week high/low (%).
Higher-TF alignment: Optional weekly trend reading shown on the label while you’re on the daily.
Anchored VWAP(s): Two optional AVWAPs from dates you choose (e.g., YTD open, last big gap/earnings).
Plots & labels
EMAs 20/50/200 (toggle on/off).
Optional BB & KC bands for diagnostics.
AVWAP #1 / #2 (optional).
Status label with: Trend, EMAs, Dist to 20-EMA (%, ATR), 52-week distances, HTF state.
Built-in alerts (set “Once per bar close”)
EMA10 ↔ EMA20 cross (early momentum shift)
EMA20 ↔ EMA50 cross (trend confirmation/negation)
Price ↔ EMA200 cross (long-term regime)
Squeeze Release UP / DOWN (BB breakout after squeeze)
Overextension Cool-off UP / DN (stretched vs 20-EMA + momentum rolling)
Near 52-week High (within your % threshold)
How to use (playbook)
Map regime: Prefer trades when Daily = Bull and HTF (Weekly) = Bull (shown on label).
Hunt expansion: Yellow → White dot and close beyond BB = fresh move.
Avoid chasing stretch: If background is painted (overextended vs 20-EMA), wait for a pullback or intraday base.
Locations matter: 52-week proximity + HTF Bull improves breakout quality.
Anchors: Add AVWAP from YTD open or last major gap to frame support/resistance.
Suggested settings
Overextension: ATR = 2.0, % = 4.0 to start; tune per index volatility.
Squeeze bands: BB(20,2) & KC(20,1.5) default are balanced; tighten KC (1.3) for more signals, widen (1.8) for fewer/higher quality.
Timeframes: Daily for signals, Weekly for bias. Optional 65-min for entries.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。