MCPcopy
hub / github.com/ranaroussi/quantstats / download_returns

Function download_returns

quantstats/utils.py:238–252  ·  view source on GitHub ↗
(ticker, period="max", proxy=None)

Source from the content-addressed store, hash-verified

236
237
238def download_returns(ticker, period="max", proxy=None):
239 params = {
240 "tickers": ticker,
241 "proxy": proxy,
242 "auto_adjust": True,
243 "multi_level_index": False,
244 "progress": False,
245 }
246 if isinstance(period, _pd.DatetimeIndex):
247 params["start"] = period[0]
248 else:
249 params["period"] = period
250 df = _yf.download(**params)["Close"].pct_change()
251 df = df.tz_localize(None)
252 return df
253
254
255def _prepare_benchmark(benchmark=None, period="max", rf=0.0, prepare_returns=True):

Callers 2

_prepare_benchmarkFunction · 0.85
make_indexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected