Hi,

I'm trying to get the Regression Channel for the past X set of bars, and extend it into the next set. See here for an example using the “Regression Trend” tool in TradingView. The dots on the red line indicate the source period, and the rest is the extension of those lines. 

l0mfHDG.png

 

Using the Regression Channel indicator I'm getting something that looks more like a Bollinger Band envelope. Am I using it correctly? 

Or any ideas on how to create the above Regression Trend? The extension should remain static (until next period is complete, and then a completely new one is created for the following period), and I don't need to see where it will be in advance, but I do need to know the position of the extension at the current bar. I'm using python and this might be beyond my ability to create from scratch. 

Thank you for any help!