OPEN-SOURCE SCRIPT

Swing Highs and Lows Detector

5 221
🔍 Swing Highs and Lows Detector
The Swing Highs and Lows Detector is a powerful tool for traders looking to identify meaningful structural shifts in price action, based on swing point logic and internal trend shifts.

📈 What It Does
This indicator automatically identifies and labels:

HH (Higher High) – Price broke above the previous swing high

LH (Lower High) – Price failed to break the previous high, signaling potential weakness

LL (Lower Low) – Price broke below the previous swing low

HL (Higher Low) – Price maintained a higher support level, indicating strength

The script distinguishes between bullish and bearish internal shifts and tracks the highest/lowest points between those shifts to determine the swing structure.

⚙️ How It Works
You can choose between two shift detection modes:

"Open": Compares closing price to the first open of the opposite streak

"High/Low": Uses the high of bearish or low of bullish candles

Once a shift is confirmed, the indicator scans the bars between shifts to find the most significant swing high or low

When a valid swing is detected, it’s labeled directly on the chart with color-coded markers

🛎️ Built-in Alerts
Set alerts for:

Higher High

Lower High

Lower Low

Higher Low

These alerts help you catch key structural shifts in real time — great for breakout traders, structure-based analysts, and smart money concepts (SMC) strategies.

✅ How to Use
Confirm Trend Strength or Reversals – Use HH/HL to confirm an uptrend, LL/LH to confirm a downtrend

Combine with Liquidity Sweeps or Zones – Ideal for SMC or Wyckoff-style setups

Entry/Exit Triggers – Use swing breaks to time entries or exits near key structural points

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。