OPEN-SOURCE SCRIPT
Cập nhật Simple Auto Swing Lines

# Simple Auto Swing Lines
## What It Does
This indicator automatically draws horizontal support and resistance lines based on swing highs and lows with line management and touch-based alerts.
## How It Works
**Swing Detection:**
- Uses pivot point analysis to identify significant highs and lows
- Configurable pivot strength determines sensitivity (higher = more significant swings)
- Draws horizontal lines from these swing points extending to current price
**Line Management:**
- Proximity Filter: Removes lines that are too close together to prevent clutter
- Auto-Hide Feature: Lines disappear after price closes beyond them for a set number of candles
- Permanent Clipping: Once a line is crossed for the threshold period, it stays hidden
- Dynamic Updates: Only shows the most relevant recent swing levels
**Touch-Based Alert System:**
- "Swing High touched" - Alerts when price touches resistance lines from any direction
- "Swing Low touched" - Alerts when price touches support lines from any direction
- "Any Swing Level touched" - Combined alert for any swing line interaction
## Key Settings
**Pivot Detection:**
- Pivot Strength (50): Higher values = fewer, more significant swing lines
- Max Lookback Bars (1000): How far back to look for swing points
**Line Appearance:**
- Max Lines (5): Maximum number of swing lines per side (total lines = 2x this number)
- Line Thickness (1-5): Customize line width
- Resistance/Support Colors: Red for highs, green for lows
- Show Labels: Optional swing high/low labels (default: off)
**Display Controls:**
- Proximity Filter (2000 ticks): Minimum distance between lines to prevent clutter
- Candles Before Hide (7): How many consecutive closes beyond a line before permanent removal
## What It Does
This indicator automatically draws horizontal support and resistance lines based on swing highs and lows with line management and touch-based alerts.
## How It Works
**Swing Detection:**
- Uses pivot point analysis to identify significant highs and lows
- Configurable pivot strength determines sensitivity (higher = more significant swings)
- Draws horizontal lines from these swing points extending to current price
**Line Management:**
- Proximity Filter: Removes lines that are too close together to prevent clutter
- Auto-Hide Feature: Lines disappear after price closes beyond them for a set number of candles
- Permanent Clipping: Once a line is crossed for the threshold period, it stays hidden
- Dynamic Updates: Only shows the most relevant recent swing levels
**Touch-Based Alert System:**
- "Swing High touched" - Alerts when price touches resistance lines from any direction
- "Swing Low touched" - Alerts when price touches support lines from any direction
- "Any Swing Level touched" - Combined alert for any swing line interaction
## Key Settings
**Pivot Detection:**
- Pivot Strength (50): Higher values = fewer, more significant swing lines
- Max Lookback Bars (1000): How far back to look for swing points
**Line Appearance:**
- Max Lines (5): Maximum number of swing lines per side (total lines = 2x this number)
- Line Thickness (1-5): Customize line width
- Resistance/Support Colors: Red for highs, green for lows
- Show Labels: Optional swing high/low labels (default: off)
**Display Controls:**
- Proximity Filter (2000 ticks): Minimum distance between lines to prevent clutter
- Candles Before Hide (7): How many consecutive closes beyond a line before permanent removal
Phát hành các Ghi chú
Updated chart example to include both support and resistance lines. Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.