OPEN-SOURCE SCRIPT
Mis à jour

Swing Highs and Lows Detector

11 240
🔍 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
Notes de version
Automatic fibonnaci levels added.
Notes de version
Calculation logic updated for consistency and more accuracy
Notes de version
Removed un-used input option
Notes de version
Inputs for alerts moved up in settings to make sure it is noticed by users.

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.