Created
June 16, 2022 19:10
-
-
Save intrinio-gists/3e21c63e2f3e8873490a048ee452612d to your computer and use it in GitHub Desktop.
Constructs a DataFrame of Historic Prices Across Portfolio Holdings
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 _folio_historic_prices_dataset( | |
tickers, | |
start_date, | |
end_date, | |
): | |
historic_prices_dataset = pd.DataFrame() | |
for ticker in tickers: | |
historic_prices = _historic_prices( | |
ticker, | |
start_date, | |
end_date, | |
) | |
if historic_prices_dataset.empty: | |
historic_prices_dataset = historic_prices | |
else: | |
historic_prices_dataset = historic_prices_dataset.join( | |
historic_prices, | |
on=['date'] | |
) | |
return historic_prices_dataset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment