Free version
(See also Ultimate Version)
Statistical projection tool based on Robust Weighted Least Squares (WLS). Visualizes trend direction and volatility bounds using Standard Error of the Forecast
Description
UFF is a statistical tool designed to project market trends using Robust Weighted Least Squares (WLS) regression. It estimates the theoretical price trajectory and constructs prediction intervals based on the Standard Error of the Forecast.
This is a free, open-source indicator. The primary goal of this release is to gather technical feedback, stress-test the algorithm across different assets, and invite critique from the quantitative trading community.
Methodology
The indicator operates on three core principles:
- Robust WLS Regression: Uses soft winsorization to dampen outliers in the input data, reducing the impact of non-structural volatility (noise) on the trend line.
- Standard Error Funnel: The prediction interval is calculated using the standard error formula for linear regression forecasts. The interval widens as the forecast horizon increases, reflecting the statistical uncertainty of future values.
- Adaptive Tuning: Smoothing parameters and sensitivity coefficients are automatically adjusted based on the volatility characteristics of the selected Asset Class.
Label Legend (Data Panel)
The forecast label provides real-time metrics for the current regression model:
- Target: The projected price value at the end of the forecast horizon.
- UP / DOWN: The sign of the regression slope.
- Conf (Confidence): The coefficient of determination ($R^2$) as a percentage. Indicates the goodness of fit for the regression model.
- Strength: Qualitative classification of the trend based on $R^2$ thresholds.
- MAE (Mean Absolute Error): The average absolute deviation of price from the regression line, expressed as a percentage.
Default Configuration
- Default Asset Class: Stocks
- Default Style: Moderate
Settings Overview
- Style: Adjusts the width multiplier for the prediction interval (Conservative / Moderate / Aggressive).
- Asset Class: Selects the internal tuning logic (Stocks / Crypto / Forex).
- Forecast: The number of bars to project forward.
- Projection Type:
- -- Linear: Standard linear extrapolation.
- -- Parabolic: Adds a curvature factor based on slope momentum (experimental).
- -- Flat: Horizontal projection of the current regression value.
Usage Notes
This tool visualizes the statistical expectancy of price action based on historical regression data. It does not generate trade signals. The central line represents the mean expectancy, while the funnel edges represent statistical boundaries.
Disclaimer: This script is for educational and analytical purposes. It relies on historical data regression and does not guarantee future performance.
Comments