TRIX (Function)
The TRIX function calculates the percent rate-of-change of a triple exponentially smoothed moving average of the security's closing price.
Syntax
TRIX(Price, Length)
Returns (Double)
A numeric value containing TRIX for the current bar.
Parameters
Name |
Type |
Description |
Price |
Numeric |
Specifies which bar value (price, function, or formula) to use. |
Length |
Numeric |
Sets the number of bars to consider. |
Remarks
TRIX is a momentum indicator that displays the percent rate-of-change of a triple exponentially smoothed moving average of the security's closing price. The TRIX indicator oscillates around a zero line. Its triple exponential smoothing is designed to filter out noise.
Example
If you want to initiate a short position when TRIX crosses under zero you can write:
If TRIX(Close, 10) Crosses Under 0 Then
SellShort Next Bar at Market;