Stocks & Commodities V. 24:11 (36-44): Constructing an active proper trendling using two points as milestones by Giorgos E. Siligardos, Ph.D.
The Pascal-like pseudolanguage here consists of two parts and gives the basic steps for constructing an active proper trendline using two points as milestones. We consider the closing price of a trading vehicle as an array of N values: CLOSE, CLOSE, ……CLOSE[N]. The first milestone is CLOSE[x1] and the second milestone is CLOSE[x2]. The result of the code is an array: AutoTL[k], AutoTL[k+1], …. AutoTL[N], which contains the values of the trendline.
The first part of the code constructs an upward trendline and the second part of the code constructs a downward trendline. Expressions in bold italic in the code refer to obvious procedures.