PROTECTED SOURCE SCRIPT
ที่อัปเดต: Peak ↔ Trough Leg & Cycle Counter

This indicator plots both leg counts and cycle counts between peaks and troughs, and includes a real-time counter showing the number of bars since the last swing (peak or trough).
=== Description ===
"Peak ↔ Trough Leg + Cycle + Real-Time Counter" is a swing-based timing tool designed for discretionary and systematic traders.
It detects local peaks and troughs based on user-defined swing length and visually tracks:
Labels are drawn at each swing point:
Each label contains:
Line 1 – Bars since last swing (Leg Count)
Line 2 – Bars since last same-type swing (Cycle Count)
A yellow label is shown on the most recent bar, counting live from the last swing.
=== Potential Uses ===
=== Description ===
"Peak ↔ Trough Leg + Cycle + Real-Time Counter" is a swing-based timing tool designed for discretionary and systematic traders.
It detects local peaks and troughs based on user-defined swing length and visually tracks:
- The number of bars between alternating peaks and troughs ("Leg Count")
- The number of bars between recurring same-type swings (Peak→Peak and Trough→Trough "Cycle Count")
- A real-time counter showing bars elapsed since the last confirmed swing (updated live on the most recent bar)
Labels are drawn at each swing point:
- Top arrows (teal) at local peaks
- Bottom arrows (green) at local troughs
Each label contains:
Line 1 – Bars since last swing (Leg Count)
Line 2 – Bars since last same-type swing (Cycle Count)
A yellow label is shown on the most recent bar, counting live from the last swing.
=== Potential Uses ===
- **Time-based entry filters**: Wait for X bars since last swing before entering a trade.
- **Cycle analysis**: Visually gauge market rhythm and mean-reversion timing.
- **Backtesting timing rules**: Use swing-to-swing durations to test ideas like "enter long only if X bars since peak".
- **Momentum/fade context**: Identify when a market is overextended in time vs. price.
- **Bar-count-based trailing stops**: Combine time since last swing with price stops for dynamic exits.
- **Training visual intuition**: Reinforce understanding of market structure through peak/trough rhythm.
เอกสารเผยแพร่
label disclaimerสคริปต์ที่ได้รับการป้องกัน
สคริปต์นี้ถูกเผยแพร่เป็นแบบ closed-source อย่างไรก็ตาม คุณสามารถใช้ได้อย่างอิสระและไม่มีข้อจำกัดใดๆ – เรียนรู้เพิ่มเติมได้ที่นี่
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน
สคริปต์ที่ได้รับการป้องกัน
สคริปต์นี้ถูกเผยแพร่เป็นแบบ closed-source อย่างไรก็ตาม คุณสามารถใช้ได้อย่างอิสระและไม่มีข้อจำกัดใดๆ – เรียนรู้เพิ่มเติมได้ที่นี่
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน