By request of a user I just put this indicator which is a linear regression that work on same logic as super trend the control is by length (len) and the deviation there is alerts and signals try to find best settings according to your needs it can done in a different way as well this one seems to work nice on stocks