diff --git a/pandas_ta/momentum/stoch.py b/pandas_ta/momentum/stoch.py index e20f0c9..c20df25 100644 --- a/pandas_ta/momentum/stoch.py +++ b/pandas_ta/momentum/stoch.py @@ -52,7 +52,7 @@ def stoch(high, low, close, k=None, d=None, smooth_k=None, mamode=None, offset=N k = k if k and k > 0 else 14 d = d if d and d > 0 else 3 smooth_k = smooth_k if smooth_k and smooth_k > 0 else 3 - _length = max(k, d, smooth_k) + _length = k + d + smooth_k high = verify_series(high, _length) low = verify_series(low, _length) close = verify_series(close, _length) diff --git a/pandas_ta/momentum/stochrsi.py b/pandas_ta/momentum/stochrsi.py index c8d7b18..c5fe145 100644 --- a/pandas_ta/momentum/stochrsi.py +++ b/pandas_ta/momentum/stochrsi.py @@ -55,7 +55,7 @@ def stochrsi(close, length=None, rsi_length=None, k=None, d=None, mamode=None, o rsi_length = rsi_length if rsi_length and rsi_length > 0 else 14 k = k if k and k > 0 else 3 d = d if d and d > 0 else 3 - close = verify_series(close, max(length, rsi_length, k, d)) + close = verify_series(close, length + rsi_length + k + d) offset = get_offset(offset) mamode = mamode if isinstance(mamode, str) else "sma"