Skip to main content

atr

Average True Range.

Used to measure volatility, especially volatility caused by gaps or limit moves.

Example:​

from openbb import obb
stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp")
atr_data = obb.technical.atr(data=stock_data.results)

Parameters​

NameTypeDescriptionDefaultOptional
dataList[Data]List of data to apply the indicator to.NoneFalse
indexstrIndex column name, by default "date"dateTrue
lengthPositiveIntIt's period, by default 1414True
mamodeLiteral["rma", "ema", "sma", "wma"]Moving average mode, by default "rma"rmaTrue
driftNonNegativeIntThe difference period, by default 11True
offsetintHow many periods to offset the result, by default 00True

Returns​

List of data with the indicator applied.