Skip to content

Instantly share code, notes, and snippets.

@neurojojo
Created February 16, 2022 18:42
Show Gist options
  • Save neurojojo/badfb3a77df0c56038a6252e03393410 to your computer and use it in GitHub Desktop.
Save neurojojo/badfb3a77df0c56038a6252e03393410 to your computer and use it in GitHub Desktop.
import pickle
stock_tseries_df = pd.DataFrame()
for x in ssr_database.iterrows():
try:
thisstock = yf.download( x[1].Ticker, start=x[1].Datetime.date(), end=x[1].NextDay.date(), interval = '30m' )
tmp = pd.DataFrame( [ x[1].Ticker, x[1].Datetime, x[1].NextDay, thisstock['Close'].values[0:13],thisstock['Close'].values[14:],thisstock['Volume'].values[0:13],thisstock['Volume'].values[14:]] ).transpose()
stock_tseries_df = pd.concat( [stock_tseries_df,tmp] )
with open("ssr_database_df.pickle","wb") as f:
pickle.dump(stock_tseries_df,f)
except:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment