Skip to content

Commit

Permalink
Merge pull request #224 from rmfish/main
Browse files Browse the repository at this point in the history
Support request proxy with yfinance
  • Loading branch information
ranaroussi authored Jun 22, 2023
2 parents 3141e5c + 546100d commit a66a22e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions quantstats/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,11 @@ def _prepare_returns(data, rf=0., nperiods=None):
return data


def download_returns(ticker, period="max"):
def download_returns(ticker, period="max",proxy=None):
if isinstance(period, _pd.DatetimeIndex):
p = {"start": period[0]}
p = {"start": period[0], "proxy": proxy}
else:
p = {"period": period}
p = {"period": period, "proxy": proxy}
return _yf.Ticker(ticker).history(**p)['Close'].pct_change()


Expand Down

0 comments on commit a66a22e

Please sign in to comment.