INNER CODE UNIT · Python
di_plus
aticio/legitindicators · legitindicators.py:255
di_plus = smoothed_directional_movement_plus[i] / smoothed_true_range[i] * 100
di_minus = smoothed_directional_movement_minus[i] / smoothed_true_range[i] * 100
dxi.append(abs(di_plus - di_minus) / (di_plus + di_minus) * 100)
szladxi.append(dxi[i] + (dxi[i] - dxi[i-round(lag)]))
ssf = super_smoother(szladxi, 10)
return ssf
def true_range(data):
"""True range
:param data: list of ohlc data [open, high, low, close]
:type data: list
:return: true range of given data
:rtype: list
"""