Some interesting things about slope that I found out: It kind of looks like the histogram of or the lines depending on the length used for the slope. According to Tushar Chande, can be used as an alternative of finding trend direction, although it is hard to say what length to use for it, I haven't been able to figure out a good way to apply it yet. According to Bulkowski, of the can be used with certain chart patterns that he listed to increase their chance of success by taking trades where the line points towards, so if you use as a source on this indicator you can take trades in whatever said direction. Got any other ideas on how to use linear regression? Feel free to let me knows, would gladly appreciate it.
Re-ordered the color code
Tip: you can put in any source in and not just price. You can put in volume, RSI, or whatever indicator that is on display to find their slopes.
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 a publication is governed by House Rules. You can favorite it to use it on a chart.