Tillson T3 Moving Average for Thinkorswim

netarchitech

netarchitech

Well-known member


Code:
# filename: _Tillson_T3_Moving_Average_
# source: https://futures.io/thinkorswim/34287-tilson-t3-moving-average.html#post460861
# created by: rmejia
# last update: 12/17/2014

#hint:<b>T3 Adaptive Smoothing Indicator</b>\nThis study was adopted from the Technical Analysis of Stocks and Commodities article "Smoothing Techniques for More Accurate Signals" by Tim Tillson, Jan 1998 (V16:1 pp33-37)
#hint: indicator: Defines the level of filtering to occur, default is 3
#hint: volumeFactor: Adjusts the amplitude of the feedback added back into the base filter

declare upper;

input indicator    = { T1, T2, default T3, T4, T5, T6 };
input price        = close;
input period       = 15;
input volumeFactor = 0.70;
input displace = 0;
input sign         = { default plus, minus };
input Label        = No;
input paintbars    = No;


script _gd {
  input _price  = close;
  input _period = 10;
  input _v      = 0.70;
  input _sign   = { default plus, minus };
  def _ema      = ExpAverage( _price, _period );
  plot _gd      = ( _ema * ( 1 + _v ) ) - ( ExpAverage( _ema, _period ) * _v );
}

def _t1 = _gd( price[-displace], period, volumeFactor, sign );
def _t2 = _gd( _t1,   period, volumeFactor, sign );
def _t3 = _gd( _t2,   period, volumeFactor, sign );
def _t4 = _gd( _t3,   period, volumeFactor, sign );
def _t5 = _gd( _t4,   period, volumeFactor, sign );
def _t6 = _gd( _t5,   period, volumeFactor, sign );

plot T3;
switch( indicator ) {
  case T1:
    T3 = _t1;
  case T2:
    T3 = _t2;
  case T3:
    T3 = _t3;
  case T4:
    T3 = _t4;
  case T5:
    T3 = _t5;
  case T6:
    T3 = _t6;
}

T3.AssignValueColor(if T3 > T3[1] then Color.GREEN else Color.RED);
T3.HideBubble();

AddLabel(Label, if T3 > T3[1] then "  A  " else "  A  ", if T3 > T3[1] then Color.GREEN else Color.RED);

assignPriceColor(if paintbars and T3 < T3[1] then color.DARK_RED else if paintbars and T3 > T3[1] then color.DARK_GREEN else color.CURRENT);
More info: https://technicalindicators.net/indicators-technical-analysis/150-t3-moving-average
 
Last edited:
netarchitech

netarchitech

Well-known member


Comparing 8 period EMA (Green/Red) with 8 period Tillson T3 MA with T1 setting (Magenta/Yellow)...
 
Last edited:
netarchitech

netarchitech

Well-known member


Comparing 8 period Hull MA (Green/Red) with 8 period Tillson T3 MA with T1 setting (Magenta/Yellow)...
 
markos

markos

Well-known member
VIP
Actually, I think the Hull is faster. :cool: Hull's turn is taken at polarity change, even if it "overshoots". Take a look at the bottom of that chart.
One day, I'll have to look for the monster comparo of ma's. Most are in the eye of the beholder. (y)
 
netarchitech

netarchitech

Well-known member
Actually, I think the Hull is faster.
@markos You are correct, sir ;) I did the comparison to see which MA would keep you in a trend the longest. I guess I felt the Tillson T3 provided a little buffer between it and price. The Hull seems to plot directly on a sizable number of candles as it draws, which isn't helpful, IMO...

Most are in the eye of the beholder.
Very true...

As for the monster comparo, that would be interesting indeed :)
 

Top