OPEN-SOURCE SCRIPT
Trend Duration Forecast [ChartPrime]

⯁ OVERVIEW
The Trend Duration Forecast [ChartPrime] indicator is designed to estimate the probable lifespan of a bullish or bearish trend. Using a Hull Moving Average (HMA) to detect directional shifts, it tracks the duration of each historical trend and calculates an average to forecast how long the current trend is statistically likely to continue. This allows traders to visualize both real-time trend strength and potential exhaustion zones with exceptional clarity.
⯁ KEY FEATURES
⯁ USAGE
⯁ CONCLUSION
The Trend Duration Forecast [ChartPrime] gives traders a quantitative edge by combining real-time trend tracking with statistical forecasting. It helps identify not only when a new trend begins, but also how long it’s likely to persist based on past market behavior. This indicator enhances timing precision for both entries and exits, supporting smarter trend-following decisions with clear, data-driven insights.
The Trend Duration Forecast [ChartPrime] indicator is designed to estimate the probable lifespan of a bullish or bearish trend. Using a Hull Moving Average (HMA) to detect directional shifts, it tracks the duration of each historical trend and calculates an average to forecast how long the current trend is statistically likely to continue. This allows traders to visualize both real-time trend strength and potential exhaustion zones with exceptional clarity.
⯁ KEY FEATURES
- Dynamic Trend Detection: Utilizes the Hull Moving Average to identify when price transitions into a new uptrend or downtrend.
- Trend Duration Counting: Measures the number of bars in each completed bullish and bearish phase to understand trend persistence.
- Forecast Projection: Automatically projects an estimated trend continuation line based on the average length of recent trends.
- Real-Time Updates: Continuously updates the “Real Length” label as the trend develops.
- Historical Data Table: Displays previous trend durations for both bullish and bearish cycles, along with their averages.
- Adaptive Sampling: Uses a customizable sample size to smooth out volatility in the forecast and provide statistically meaningful projections.
- Color-Based Clarity: Highlights uptrends in green and downtrends in orange for instant visual interpretation.
⯁ USAGE
- Use the Trend Detection Sensitivity setting to control how fast or slow the indicator reacts to trend changes — lower values increase responsiveness, while higher values smooth out noise.
- Compare the Real Length of the ongoing trend with the Probable Length forecast to estimate whether the move is nearing exhaustion.
- Observe the historical duration table to understand the average lifespan of trends in the current market structure.
- Use the color-coded HMA line and projection arrows to identify when momentum strength is fading and prepare for possible reversals.
- Ideal for swing or trend-following strategies where trend longevity is crucial to managing entries and exits effectively.
⯁ CONCLUSION
The Trend Duration Forecast [ChartPrime] gives traders a quantitative edge by combining real-time trend tracking with statistical forecasting. It helps identify not only when a new trend begins, but also how long it’s likely to persist based on past market behavior. This indicator enhances timing precision for both entries and exits, supporting smarter trend-following decisions with clear, data-driven insights.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน