OPEN-SOURCE SCRIPT
LETHINH-Swing pa,smc

🟦 📌 Title (English)
Swing High / Swing Low – 3-Candle Fractal (5-Bar Pivot) | Auto Alerts
⸻
🟩 📌 Short Description
A clean and reliable swing high / swing low detector based on the classic 3-candle (5-bar) fractal pivot. Automatically marks SH/SL and triggers alerts when a swing is confirmed. No repainting after confirmation.
⸻
🟧 📌 Full Description (for TradingView Publishing)
🔶 Swing High / Swing Low – 3-Candle Fractal (5-Bar Pivot)
This indicator identifies Swing Highs (SH) and Swing Lows (SL) using the classic 3-candle fractal pattern, also known as the 5-bar pivot.
It marks swing points only after full confirmation, making it highly reliable and suitable for structure-based trading.
⸻
🔶 📍 How It Works
A swing is confirmed when the center candle is higher (or lower) than the two candles on each side:
Swing High (SH)
high[2] > high[3], high[1], high[0]
Swing Low (SL)
low[2] < low[3], low[1], low[0]
The confirmation occurs after 2 right candles close, so the indicator does not repaint once a swing is identified.
⸻
🔶 📍 Key Features
• Detects clean and accurate swings
• Uses pure price action — no indicators, no lag
• Marks swing high (SH) and swing low (SL) directly on the chart
• Non-repainting after confirmation
• Works on all timeframes and all markets
• Extremely lightweight and fast
• Includes alert conditions for both SH and SL
Perfect for traders using:
• Market Structure (BOS / CHoCH)
• Order Blocks (OB)
• Smart Money Concepts (SMC)
• Liquidity hunts
• Wyckoff
• Support/Resistance
• Price Action entries
⸻
🔶 📍 Why This Indicator Is Useful
Swing points are the foundation of market structure.
Accurately detecting them helps traders:
• Identify trend shifts
• Spot BOS / CHoCH correctly
• Find key zones (OB, liquidity levels, supply/demand)
• Time entries more precisely
• Avoid fake structure breaks
This indicator ensures swings are plotted only when fully confirmed, reducing noise and confusion.
⸻
🔶 📍 Alerts
You can create alerts for both conditions:
• Swing High Confirmed
• Swing Low Confirmed
Recommended settings:
• Once per bar close
• Open-ended alert
With alerts enabled, TradingView will automatically notify you every time a new swing forms.
⸻
🔶 📍 No Repainting
Once a swing is confirmed and plotted, it will not change or disappear.
This makes the indicator reliable for real-time alerts and backtesting.
⸻
🔶 📍 Pine Script (v5)
Paste your indicator code here if you want it visible.
Or leave the code hidden if you are publishing as protected.
⸻
🔶 📍 Final Notes
• This indicator focuses on confirmation, not prediction
• It is designed for clean structure reading
• All markets supported: Forex, Crypto, Stocks, Indexes, Commodities
• Suitable for scalping, intraday, swing, and even higher-timeframe trading
If you find this tool helpful, feel free to give it a like and add it to your favorites ❤️
Your support helps me share more tools with the community!
Swing High / Swing Low – 3-Candle Fractal (5-Bar Pivot) | Auto Alerts
⸻
🟩 📌 Short Description
A clean and reliable swing high / swing low detector based on the classic 3-candle (5-bar) fractal pivot. Automatically marks SH/SL and triggers alerts when a swing is confirmed. No repainting after confirmation.
⸻
🟧 📌 Full Description (for TradingView Publishing)
🔶 Swing High / Swing Low – 3-Candle Fractal (5-Bar Pivot)
This indicator identifies Swing Highs (SH) and Swing Lows (SL) using the classic 3-candle fractal pattern, also known as the 5-bar pivot.
It marks swing points only after full confirmation, making it highly reliable and suitable for structure-based trading.
⸻
🔶 📍 How It Works
A swing is confirmed when the center candle is higher (or lower) than the two candles on each side:
Swing High (SH)
high[2] > high[3], high[1], high[0]
Swing Low (SL)
low[2] < low[3], low[1], low[0]
The confirmation occurs after 2 right candles close, so the indicator does not repaint once a swing is identified.
⸻
🔶 📍 Key Features
• Detects clean and accurate swings
• Uses pure price action — no indicators, no lag
• Marks swing high (SH) and swing low (SL) directly on the chart
• Non-repainting after confirmation
• Works on all timeframes and all markets
• Extremely lightweight and fast
• Includes alert conditions for both SH and SL
Perfect for traders using:
• Market Structure (BOS / CHoCH)
• Order Blocks (OB)
• Smart Money Concepts (SMC)
• Liquidity hunts
• Wyckoff
• Support/Resistance
• Price Action entries
⸻
🔶 📍 Why This Indicator Is Useful
Swing points are the foundation of market structure.
Accurately detecting them helps traders:
• Identify trend shifts
• Spot BOS / CHoCH correctly
• Find key zones (OB, liquidity levels, supply/demand)
• Time entries more precisely
• Avoid fake structure breaks
This indicator ensures swings are plotted only when fully confirmed, reducing noise and confusion.
⸻
🔶 📍 Alerts
You can create alerts for both conditions:
• Swing High Confirmed
• Swing Low Confirmed
Recommended settings:
• Once per bar close
• Open-ended alert
With alerts enabled, TradingView will automatically notify you every time a new swing forms.
⸻
🔶 📍 No Repainting
Once a swing is confirmed and plotted, it will not change or disappear.
This makes the indicator reliable for real-time alerts and backtesting.
⸻
🔶 📍 Pine Script (v5)
Paste your indicator code here if you want it visible.
Or leave the code hidden if you are publishing as protected.
⸻
🔶 📍 Final Notes
• This indicator focuses on confirmation, not prediction
• It is designed for clean structure reading
• All markets supported: Forex, Crypto, Stocks, Indexes, Commodities
• Suitable for scalping, intraday, swing, and even higher-timeframe trading
If you find this tool helpful, feel free to give it a like and add it to your favorites ❤️
Your support helps me share more tools with the community!
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน