Skip to content

Instantly share code, notes, and snippets.

@timothycarambat
Created May 25, 2018 19:55
Show Gist options
  • Save timothycarambat/354864063b72ab5e408d8ed833f9d5d3 to your computer and use it in GitHub Desktop.
Save timothycarambat/354864063b72ab5e408d8ed833f9d5d3 to your computer and use it in GitHub Desktop.
Ticker script for u/aventador
import pandas as pd
import pandas_datareader.data as web
from pandas_datareader.nasdaq_trader import get_nasdaq_symbols
from datetime import datetime
symbols = get_nasdaq_symbols()
start = datetime(2018, 5, 1)
tickers = ['GM','F','IBM','IMMVD','WRX','GOOGL']
for ticker in tickers:
try: # this will check if ticker exists in NYSE list and if it does - gets its morningstar values
symbols.ix[ticker]
df = web.DataReader(ticker, "morningstar", start)
print df.head()
except KeyError:
print " %s is on PINX or not a valid Symbol and not available for reading" % ticker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment