Created
June 11, 2021 15:10
-
-
Save HumanRupert/94ec7dafae8d43f09b5c7ff21856bd82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_benchmark_returns() -> pd.Series: | |
bench = yf.Ticker(BENCHMARK) | |
bench_hist = bench_hist.history(start=START, end=END, auto_adjust=True).tz_localize("UTC") | |
returns = pd.Series(bench_hist["Close"].pct_change().values, index=bench_hist.index).dropna() | |
returns.index.names = ["date"] | |
return returns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment