plus he had better to use OnTimer function instead of OnCalculate since there is no mere indicators. in this way you guarantee automatic updated of trend value if you change trend points. ALSO possible future problems like zero-divide in code has ...