INNER CODE UNIT · Python

atr

aticio/legitindicators · legitindicators.py:49

def atr(data, length):
    """Average True Range indicator

    :param data: list of ohlc data [open, high, low, close]
    :type data: list
    :param length: lookback period for atr indicator
    :type length: int
    :return: ATR of given ohlc data
    :rtype: list
    """
    trng = true_range(data)
    res = rma(trng, length)
    return res


def smoothed_atr(data, length):
    """Average True Range indicator smoothed with super smoother

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…