OPEN-SOURCE SCRIPT

Function - Forecast Linear

Updated
Function to calculate a forecast using a linear regression approach, this is the same function used on excel and other data sheet programs.

reference:
- support.microsoft.com/en-us/office/forecast-and-forecast-linear-functions-50ca49c9-7b40-4892-94e4-7ad38bbeda99?ui=en-us&rs=en-us&ad=us
- stackoverflow.com/questions/39373328/forecast-formula-from-excel-in-javascript
Release Notes
updated description and added extra example
forecastfunctionOscillatorsTrend Analysisutility

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer