This one can replace all my indecators. It shows support/resistance and divergence at same time.
study(title = "Least Squares Momentum", shorttitle="LSM", overlay=true) length = input(title="Length", type=integer, defval=14) source = close mid = linreg(source, length, 0) tail = linreg(source, length, length/2) head = linreg(source, length, -length/2) plot(head, color=#226622, title='head') plot(mid, color=#333333, title='mid') plot(tail, color=#881111, title='tail')