This script is written totally thanks to Alex Grover (tradingview.com/script/CDsPknAG-Quadratic-Regression/). Here it is implemented in conjunction with the seasonal forecast I showed in one of my previous posts. It takes the calculated QReg curve and extends its last section (Season) into the future (Forecasted periods).