INNER CODE UNIT · Python
smoothed_atrlimit
aticio/legitindicators · legitindicators.py:124
def smoothed_atrlimit(data, length, limit, coef):
"""Smoothed Average True Range implementation with a limit for using as a volatility indicator
:param data: list of ohlc data [open, high, low, close]
:type data: list
:param length: lookback period for atr indicator
:type length: int
:param limit: average limit number to be used as threashold
:type limit: int
:param coef: threshold coefficient
:type coef: float
:return: list of ones and zeros to be used as volatility indicator
:rtype: float
"""
atrl = []
th = []
avgtr = smoothed_atr(data, length)