Skip to content

Commit

Permalink
levels should be >0 and <100
Browse files Browse the repository at this point in the history
  • Loading branch information
fmilthaler committed Sep 26, 2023
1 parent e01f515 commit 370d0b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions finquant/momentum_indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def relative_strength_index(
# validating levels
if oversold >= overbought:
raise ValueError("oversold level should be < overbought level")
if oversold >= 100 or overbought >= 100:
raise ValueError("levels should be < 100")
if not (0 < oversold < 100) or not(0 < overbought < 100):
raise ValueError("levels should be > 0 and < 100")
# converting data to pd.DataFrame if it is a pd.Series (for subsequent function calls):
if isinstance(data, pd.Series):
data = data.to_frame()
Expand Down

0 comments on commit 370d0b2

Please sign in to comment.