TRIX | R Documentation |
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 |
Price series that is coercible to xts or matrix. |
n |
Number of periods for moving average. |
nSig |
Number of periods for signal line moving average. |
maType |
Either:
|
percent |
logical; if |
... |
Other arguments to be passed to the |
The TRIX is calculated as follows:
3MA = MA
( MA
(
MA
(price
) ) )
trix = 100 * [ 3MA(t) / 3MA(t-1) - 1 ]
A object of the same class as price
or a vector (if
try.xts
fails) containing the TRIX values.
Buy/sell signals are generated when the TRIX crosses above/below zero. A nine-period EMA of the TRIX is used as a default signal line. Buy/sell signals are generated when the TRIX crosses above/below the signal line and is also above/below zero.
Joshua Ulrich
The following site(s) were used to code/document this
indicator:
https://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
https://school.stockcharts.com/doku.php?id=technical_indicators:trix
See EMA
, SMA
, etc. for moving average
options; and note Warning section.
data(ttrc)
trix <- TRIX(ttrc[,"Close"])
trix4 <- TRIX(ttrc[,"Close"],
maType=list(list(SMA), list(EMA, wilder=TRUE), list(SMA), list(DEMA)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.