I am wanting to use the linreg function to return the vale of a specific bar within a linreg series based on a specific lookback, starting on a previous bar.
Looking at the linreg function it looks like I could simple call the linreg function with a source of something like Typical[7], which means pass the series to calculate the linreg function from starting 7 bars ago and then the series would be from bar 7 back to the length of the lookback.
Then what is returned from the linreg function would be the linreg value at the bar 7 bars ago, based on the series that started 7 bars ago, not on the most recent bar created.
You can easily visualize this by taking a linreg drawing tool and drawing between several historical bars a linreg line. I just want to be able to get those values.
The problem is I can't think of how to do this easily.
Could someone suggest an easily solution?
Comment