This is a TradingView Pine Script indicator that performs a linear regression on historical price data to project potential future price levels. It's designed to help traders visualize long-term price trends and potential future price targets. Key Components:
User Inputs:
Historical Data Points (default 1000 bars) - The amount of historical data used to calculate the trend Years to Project (default 10 years) - How far into the future to project the price
Technical Implementation:
Uses linear regression (ta.linreg) to calculate the trend slope Converts years to trading days using 252 trading days per year Limits visible projection to 500 bars due to TradingView's drawing limitations Projects prices using the formula: current_price + (slope × number_of_bars)
Visual Elements:
Blue line showing actual historical prices Red projection line showing the expected price path Label showing the projected price at the visible end of the line Information table in the top-right corner showing:
Current price Final projected price after the full time period
Limitations:
Can only display projections up to 500 bars into the future (about 2 years) due to TradingView limitations The full projection value is still calculated and shown in the table Past performance doesn't guarantee future results - this is a mathematical projection based on historical trends
Usage: Traders can use this to:
Visualize potential long-term price trends Set long-term price targets Understand the historical trend's trajectory Compare current prices with projected future values