Thank You Luisd,
The Algo is not built to forecast the behavior of the TS but to block bad trading systems.
In the article linked in the first post, value below 0.0 were used for testing purposes. Why are you saying that the formula will work only for th >0. I Would appreciate if you articulate your statement a little more.

Thank you in advance