mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-04 14:47:49 +00:00
feat(Data): added new derived features + asset pairs for crypto tickers (#6)
This commit is contained in:
committed by
GitHub
parent
b0b0d5bbba
commit
3fec439c08
+10
-5
@@ -1,6 +1,7 @@
|
||||
#%%
|
||||
import pandas as pd
|
||||
from utils.get_prices import get_crypto_price_crypto_compare, get_stock_price_av
|
||||
from itertools import combinations
|
||||
|
||||
#%%
|
||||
crypto_tickers = ["BTC", "ETH", "BNB", "ADA", "SOL", "XRP", "DOT", "LTC", "UNI", "TRX", "FIL"]
|
||||
@@ -8,14 +9,18 @@ etf_tickers = ["GLD", "IEF", "TLT", "SPY", "QQQ"]
|
||||
tickers = crypto_tickers + etf_tickers
|
||||
|
||||
#%%
|
||||
for ticker in tickers:
|
||||
for ticker in etf_tickers:
|
||||
print("Fetching ", ticker)
|
||||
if ticker in crypto_tickers:
|
||||
df = get_crypto_price_crypto_compare(ticker, "USD", 1500)
|
||||
else:
|
||||
df = get_stock_price_av(ticker, "2017-11-10")
|
||||
df = get_stock_price_av(ticker, "2017-11-10")
|
||||
|
||||
df.to_csv(f"data/{ticker}.csv", index=True)
|
||||
|
||||
crypto_ticker_pairs = list(combinations(crypto_tickers, 2))
|
||||
for src_ticker, trg_ticker in crypto_ticker_pairs:
|
||||
print("Fetching ", src_ticker, trg_ticker)
|
||||
df = get_crypto_price_crypto_compare(src_ticker, trg_ticker, 1500)
|
||||
|
||||
df.to_csv(f"data/{src_ticker}_{trg_ticker}.csv", index=True)
|
||||
|
||||
|
||||
# %%
|
||||
|
||||
Reference in New Issue
Block a user