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
Name | Ticker | Weight | |
---|---|---|---|
DIGITALOCEAN HOLDINGS INC | DOCN | 5.34 | |
NETFLIX INC | NFLX | 5.08 | |
PAYCOM SOFTWARE INC | PAYC | 4.94 | |
ZOOM VIDEO COMMUNICATIONS-A | ZM | 4.71 | |
DROPBOX INC-CLASS A | DBX | 4.7 | |
SALESFORCE INC | CRM | 4.63 | |
SPS COMMERCE INC | SPSC | 4.56 | |
FIVE9 INC | FIVN | 4.49 | |
SHOPIFY INC - CLASS A | SHOP | 4.28 |
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
Name | Ticker | Weight | |
---|---|---|---|
ZOOM VIDEO COMMUNICATIONS-A | ZM | 9.18 | |
TESLA INC | TSLA | 8.18 | |
ROKU INC | ROKU | 7.94 | |
CRISPR THERAPEUTICS AG | CRSP | 5.78 | |
EXACT SCIENCES CORP | EXAS | 5.1 | |
TELADOC HEALTH INC | TDOC | 5.06 | |
UIPATH INC - CLASS A | PATH | 4.75 | |
INTELLIA THERAPEUTICS INC | NTLA | 4.61 | |
BLOCK INC | SQ | 4.35 |
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
import requests | |
import empyrical | |
import pandas as pd | |
import warnings | |
from retrying import retry | |
from prettytable import PrettyTable | |
warnings.simplefilter(action='ignore', category=(FutureWarning, UserWarning)) | |
api_key = 'YOUR_INTRINIO_API_KEY_HERE' |
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
import requests | |
import empyrical | |
import pandas as pd | |
import warnings | |
from retrying import retry | |
from prettytable import PrettyTable | |
warnings.simplefilter(action='ignore', category=(FutureWarning, UserWarning)) | |
api_key = 'YOUR_INTRINIO_API_KEY_HERE' |
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_tearsheet( | |
start_date, | |
end_date, | |
ticker_weights_dataset, | |
): | |
tickers = list(ticker_weights_dataset.index) | |
folio_historic_prices_dataset = _folio_historic_prices_dataset( | |
tickers, | |
start_date, |
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 _daily_returns_dataset( | |
historic_prices, | |
): | |
daily_returns_dataset = historic_prices.pct_change() | |
daily_returns_dataset = daily_returns_dataset.fillna( | |
0, | |
inplace=False | |
) | |
return daily_returns_dataset |
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, |
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
@retry(stop_max_attempt_number=2, wait_random_min=1000, wait_random_max=2000) | |
def _historic_prices( | |
ticker, | |
start_date, | |
end_date, | |
): | |
historic_prices = None | |
response = requests.get(f'https://api-v2.intrinio.com/securities/{ticker}/prices', params={ | |
'page_size': 10000, |
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
import requests | |
import pandas as pd | |
api_key = "YOUR_INTRINIO_API_KEY_HERE" | |
def _etf_holdings_dataset(etf_ticker, allocation): | |
res = requests.get(f"https://api-v2.intrinio.com/etfs/{etf_ticker}/holdings?page_size=10000&api_key={api_key}") | |
etf_holdings_dataset = pd.DataFrame(res.json().get("holdings")) | |
etf_holdings_dataset["funds_allocation"] = etf_holdings_dataset["weighting"] * allocation |
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 _etf_diversity_dataset(etf_tickers_and_allocations): | |
ETFs = [] | |
for etf_ticker, allocation in etf_tickers_and_allocations.items(): | |
etf_holdings_dataset = _etf_holdings_dataset(etf_ticker, allocation) | |
ETFs.append(etf_holdings_dataset) | |
etf_diversity_dataset = pd.concat(ETFs).groupby(by=["ticker", "sedol"]).sum() | |
etf_diversity_dataset = etf_diversity_dataset.sort_values(by="funds_allocation", ascending=False) |
NewerOlder