OPEN-SOURCE SCRIPT
Swing High-Low Line Connector

Swing High-Low Line Connector is a simple and intuitive tool that automatically detects swing highs and swing lows using fractal-style pivot logic and connects them with clean, continuous lines. This indicator helps traders visualize market structure, trend shifts, and swing-based support/resistance levels at a glance.
The script identifies each confirmed swing point based on a user-defined lookback window (left/right bars). When a new swing is confirmed, the indicator updates the previous leg or creates a new one, effectively drawing the classic “zigzag-style” connections used in discretionary trading and price-action analysis.
A dynamic tail extension is included to show the most recent swing extending toward the current price. By default, the tail follows a ZigZag-style logic—extending upward after a swing low and downward after a swing high—but users can also anchor it to Close, High, Low, or HL2.
Features
Use Cases
This indicator keeps the logic simple and visual—ideal for traders who prefer clean chart structure without unnecessary noise.
The script identifies each confirmed swing point based on a user-defined lookback window (left/right bars). When a new swing is confirmed, the indicator updates the previous leg or creates a new one, effectively drawing the classic “zigzag-style” connections used in discretionary trading and price-action analysis.
A dynamic tail extension is included to show the most recent swing extending toward the current price. By default, the tail follows a ZigZag-style logic—extending upward after a swing low and downward after a swing high—but users can also anchor it to Close, High, Low, or HL2.
Features
- Automatic detection of swing highs and swing lows
- Clean line connections between swings (similar to discretionary market-structure mapping)
- Proper consolidation handling: weaker highs/lows are ignored
- Optional ZigZag-style dynamic tail extension
- Fully customizable lookback window, line color, and line width
- Works on any market and timeframe
Use Cases
- Identifying market structure (HH, HL, LH, LL)
- Visualizing trend transitions
- Spotting breakout levels and swing-based support/resistance
- Aiding discretionary swing trading, trend following, or pattern recognition
This indicator keeps the logic simple and visual—ideal for traders who prefer clean chart structure without unnecessary noise.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.