Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix download returns #303

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion quantstats/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ def gain_to_pain_ratio(returns, rf=0, resolution="D"):
return returns.sum() / downside


def cagr(returns, rf=0.0, compounded=True, periods=252):
def cagr(returns, rf=0.0, compounded=True, periods=365):
"""
Calculates the communicative annualized growth return
(CAGR%) of access returns
Expand Down
2 changes: 1 addition & 1 deletion quantstats/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def download_returns(ticker, period="max", proxy=None):
params["start"] = period[0]
else:
params["period"] = period
return _yf.download(**params)["Close"].pct_change()
return _yf.download(**params, progress=False, threads=False)["Close"].rename(ticker).pct_change()


def _prepare_benchmark(benchmark=None, period="max", rf=0.0, prepare_returns=True):
Expand Down
Loading