+1 888 340 6572 GET STARTED

T3Average

Article/Author: Origin: Gary Fritz`s site. Originally provided by Bob Fulks, 12/14/1997

Download: t3.ela

File Includes:
Function - T3Average
Function - T3Average.series
Function - T3Average.simple
Function - XAverage.V
Indicator - T3
Indicator - T3Average
Indicator - T3.Demo

Category: Function > T3Average

Description:

This function is an EasyLanguage version of the moving average described in the January, 1998 issue of S&C magazine, p.57, "Smoothing Techniques for More Accurate Signals", by Tim Tillson. It is translated from the MetaStock code presented in the article. The function uses a version of the XAverage, written by me, which allows variables as inputs.

The variable, "Hot", is a damping coefficient which is set to the suggested default value of 0.7. The variable "b" is substituted for the variable, "a" used in the article since "a" is a reserved word. The resulting indicator plotting this function appears to duplicate the results shown in Figure 4 of the article.

Inputs:

Price
Periods

EasyLanguage Code:
INPUTS: 		PRICE(NUMERICSERIES), PERIODS(NUMERICSIMPLE);

VARIABLES: B(0), E1(0), E2(0), E3(0), E4(0), E5(0), E6(0), C1(0),
C2(0), C3(0), C4(0), HOT(0.7);

B = HOT;
E1 = XAVERAGE.V(PRICE, PERIODS);
E2 = XAVERAGE.V(E1, PERIODS);
E3 = XAVERAGE.V(E2, PERIODS);
E4 = XAVERAGE.V(E3, PERIODS);
E5 = XAVERAGE.V(E4, PERIODS);
E6 = XAVERAGE.V(E5, PERIODS);
C1 = -B*B*B;
C2 = 3*B*B+3*B*B*B;
C3 = -6*B*B-3*B-3*B*B*B;
C4 = 1+3*B+B*B*B+3*B*B;
T3AVERAGE = C1*E6+C2*E5+C3*E4+C4*E3;