Skip to content

1-day Rate-Of-Change (ROC) of a Triple Smooth EMA

TRIX is a momentum oscillator that identifies trends and reversals.

Method

tm.ta.trix(source, timeperiod)

Inputs

ParameterArgument typeDescriptionDefault Value
sourcepd.SeriesInput data series-
timeperiodintNumber of periods for the indicator30

Outputs

OutputType
trixnp.ndarray

Example usage

strategy.py
import tradomate as tm
@tm.strategy()
def my_strategy(config: tm.TradomateConfig, data: tm.TradomateData):
# Trying out 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA
trix = tm.ta.trix(data.close, timeperiod=30)
# Get the last value and print
last_value = trix.iloc[-1]
tm.log(f"Last value of 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA is {last_value}")
# Plot the values of trix
tm.plot(trix, title="1-day Rate-Of-Change (ROC) of a Triple Smooth EMA", overlay=False)