Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Fix implementation of rolling_max #149

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions qtpylib/indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,9 @@ def rolling_min(series, window=14, min_periods=None):
def rolling_max(series, window=14, min_periods=None):
min_periods = window if min_periods is None else min_periods
try:
return series.rolling(window=window, min_periods=min_periods).min()
return series.rolling(window=window, min_periods=min_periods).max()
except Exception as e:
return pd.Series(series).rolling(window=window, min_periods=min_periods).min()
return pd.Series(series).rolling(window=window, min_periods=min_periods).max()


# ---------------------------------------------
Expand Down