Professional Documents
Culture Documents
The Moving Trend
The Moving Trend
In Listing 1 given here, you will find the formula that replicates the display of
moving averages versus moving trends, as presented in Rafter's article.
LISTING 1*/
MovTrend20 = LinearReg( Close, 20 ); // calculate moving trend
// plot moving trend, moving average and price bars
Plot( MovTrend20, "MovTrend-20", colorRed, styleThick );
Plot( MA( Close, 20 ), "MA-20", colorBlue, styleThick );
Plot( Close, "Price", IIf(Close > Open, colorDarkGreen, colorDarkRed), styleBar) ;
//It is also very easy to produce the surrogate bar chart from moving trend values.
Appropriate code is included here in Listing 2.