fixed lint errors
This commit is contained in:
@@ -74,8 +74,8 @@ def compute_adx(
|
||||
plus_dm: list[float] = []
|
||||
minus_dm: list[float] = []
|
||||
for i in range(1, n):
|
||||
h, l, pc = highs[i], lows[i], closes[i - 1]
|
||||
tr_list.append(max(h - l, abs(h - pc), abs(l - pc)))
|
||||
h, low_val, pc = highs[i], lows[i], closes[i - 1]
|
||||
tr_list.append(max(h - low_val, abs(h - pc), abs(low_val - pc)))
|
||||
up = highs[i] - highs[i - 1]
|
||||
down = lows[i - 1] - lows[i]
|
||||
plus_dm.append(up if up > down and up > 0 else 0.0)
|
||||
@@ -208,8 +208,8 @@ def compute_atr(
|
||||
|
||||
tr_list: list[float] = []
|
||||
for i in range(1, n):
|
||||
h, l, pc = highs[i], lows[i], closes[i - 1]
|
||||
tr_list.append(max(h - l, abs(h - pc), abs(l - pc)))
|
||||
h, low_val, pc = highs[i], lows[i], closes[i - 1]
|
||||
tr_list.append(max(h - low_val, abs(h - pc), abs(low_val - pc)))
|
||||
|
||||
# Wilder smoothing
|
||||
atr = sum(tr_list[:period]) / period
|
||||
|
||||
Reference in New Issue
Block a user