Skip to content

Commit

Permalink
fixed issue ranaroussi#7 where daily return >= 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
ranaroussi committed Oct 3, 2019
1 parent 7bd93a2 commit da0524c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion quantstats/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ def _prepare_prices(data, base=1.):
if data[col].dropna().min() <= 0 or data[col].dropna().max() < 1:
data[col] = to_prices(data[col], base)

elif data.min() <= 0 and data.max() < 1:
# is it returns?
# elif data.min() < 0 and data.max() < 1:
elif data.min() < 0 or data.max() < 1:
data = to_prices(data, base)

if isinstance(data, (_pd.DataFrame, _pd.Series)):
Expand Down

0 comments on commit da0524c

Please sign in to comment.