Data Universes, Ticker Lists, and Pandas – what’s standard?

So since the folks in this community have been generally very cool and helpful (of course, more people in the markets is always better, but I do appreciate the help) but I have more of an existential which is a better setup question.

I have a python procedure which pulls my historical prices like so:

def daily_prices(Ticker,interval,start_date,stop_date): df=API call (Ticker,interval,start_date,stop_date) return(df) historical_price_security=df 

So, this is working and now I want to expand it to multiple securities, iterating over a ticker list, eg multiple tickers like (GS,IBM,AAPL, …). The quick and easy way to do would just to put these all in a list [GS,IBM,AAPL,…] and just iterate over it. But I could see value to putting them in a dictionary format where I use the ticker as the Key, and ultimately have multiple fields. Right now, I don't have a need for that but I see using things as a dictionary as future proofing.

Anyone with experience in doing this a few times have an opinion of whether this is the 'smart' way to do things or is there a better way to do it?

Submitted September 29, 2020 at 10:31AM by drsxr

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s