It is very similar to the index principle of the 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
Buy when breaking above the blue line, and liquidate when breaking below the blue line