Skip to content

Average Directional Movement Index Rating

ADXR is the average of ADX, providing a smoother trend strength indicator.

Method

tm.ta.adxr(source_high, source_low, source_close, timeperiod)

Inputs

ParameterArgument typeDescriptionDefault Value
source_highpd.SeriesHigh prices series-
source_lowpd.SeriesLow prices series-
source_closepd.SeriesClose prices series-
timeperiodintNumber of periods for the indicator14

Outputs

OutputType
adxrnp.ndarray

Example usage

strategy.py
import tradomate as tm
@tm.strategy()
def my_strategy(config: tm.TradomateConfig, data: tm.TradomateData):
# Trying out Average Directional Movement Index Rating
adxr = tm.ta.adxr(data.high, data.low, data.close, timeperiod=14)
# Get the last value and print
last_value = adxr.iloc[-1]
tm.log(f"Last value of Average Directional Movement Index Rating is {last_value}")
# Plot the values of adxr
tm.plot(adxr, title="Average Directional Movement Index Rating", overlay=False)