Future Trend Indicator (FTI) The Future Trend Indicator (FTI) is a versatile and innovative tool designed to analyze market trends, smooth out noise, and provide a forward-looking forecast of potential price movements. Built with advanced features such as polynomial regression, EMA smoothing, confidence bands, and cross-validation metrics, this indicator offers a comprehensive approach for traders to gain insights into future price trends while maintaining realistic error margins.
Key Features: Exponential Moving Average (EMA) Integration The FTI incorporates a user-configurable EMA to smooth out short-term price fluctuations and highlight the overall market trend. This provides a stable and reliable reference for assessing price action.
Noise Reduction via Median Filter To improve signal clarity, the source data is processed using a Median Filter, effectively reducing the impact of outliers and market noise. This ensures that the forecast focuses on meaningful price movements.
Polynomial Regression Forecast A polynomial regression model is used to project future price movements based on historical data. This advanced statistical approach models potential non-linear trends, offering a sophisticated and adaptive forecast for the next specified period.
Confidence Bands for Forecast Accuracy Upper and lower confidence bands are calculated using standard deviation, visually representing the potential error margin around the forecast. This feature provides traders with an understanding of the forecast's reliability and the expected price range.
Dynamic Visualization The indicator uses visually appealing and intuitive plotting techniques:
A forecast line dynamically shifts based on polynomial regression and historical data. Confidence bands are displayed with semi-transparent green (upper) and red (lower) shading for quick visual interpretation.
The EMA is displayed as a blue line for smooth trend observation.
Cross-Validation with RMSE (Root Mean Square Error) The indicator includes an error metric to measure the accuracy of its forecast against actual future price movements. The RMSE is displayed as a yellow label on the chart, helping traders evaluate the forecast's historical precision.
Flexible Data Source By default, the FTI uses hlc3 (the average of high, low, and close prices) as its source, providing a balanced view of market activity. Traders can easily customize this input to suit their preferences.
Forecast Customization Users can configure the length of the forecast, moving average, and EMA to tailor the indicator to different trading styles and timeframes.
EMA Length Purpose: Smoothens the price action to identify the primary trend.
Recommendation:
Short-term traders (scalping/day trading): Use a shorter EMA length (e.g., 10 or 20) to make the indicator more responsive to recent price movements.
Medium-term traders (swing trading): Use a moderate EMA length (e.g., 50) to capture broader trends while avoiding short-term noise.
Long-term traders (position trading): Use a longer EMA length (e.g., 100 or 200) to focus on the dominant trend over a longer period.
Default Value: 20
Moving Average Length
Purpose: Used in trend calculations to smooth out data further.
Recommendation:
Similar to the EMA, shorter lengths provide faster signals but are more sensitive to noise, while longer lengths offer smoother signals but may lag.
For crypto or forex (volatile markets): Start with 10 to 20.
For stocks or indices (less volatile): Use 20 to 50 for more stable trends.
Default Value: 10
Forecast Length Purpose: Determines how many bars into the future the indicator projects.
Recommendation:
Short-term trading: Use a smaller forecast length (e.g., 50) to project near-term price movements.
Medium- to long-term trading: Use a higher value (e.g., 100 to 200) to focus on longer-term forecasts.
Keep in mind that longer forecasts tend to have greater uncertainty. Confidence bands (enabled in this script) will widen as the forecast length increases, reflecting higher error potential.