powered by
The TRIX indicator calculates the rate of change of a triple exponential moving average. Developed by Jack K. Hutson.
TRIX(price, n = 20, nSig = 9, maType, percent = TRUE, ...)
Price series that is coercible to xts or matrix.
Number of periods for moving average.
Number of periods for signal line moving average.
Either:
A function or a string naming the function to be called.
A list with the first component like (1) above, and additional parameters specified as named components. See Examples.
logical; if TRUE, the rate of change is calculated using the ROC function, otherwise the momentum function is used.
TRUE
ROC
momentum
Other arguments to be passed to the maType function in case (1) above.
maType
A object of the same class as price or a vector (if try.xts fails) containing the TRIX values.
price
try.xts
The TRIX is calculated as follows: 3MA = MA( MA( MA(price) ) ) trix = 100 * [ 3MA(t) / 3MA(t-1) - 1 ]
MA
The following site(s) were used to code/document this indicator: http://www.fmlabs.com/reference/default.htm?url=TRIX.htm https://www.metastock.com/Customer/Resources/TAAZ/?p=114 https://www.linnsoft.com/techind/trix-triple-smoothed-exponential-oscillator http://www.stockcharts.com/school/doku.php?id=chart_school:technical_indicators:trix
See EMA, SMA, etc. for moving average options; and note Warning section.
EMA
SMA
# NOT RUN { data(ttrc) trix <- TRIX(ttrc[,"Close"]) trix4 <- TRIX(ttrc[,"Close"], maType=list(list(SMA), list(EMA, wilder=TRUE), list(SMA), list(DEMA))) # }
Run the code above in your browser using DataLab