Back to Community
Importing personal data and selecting a list of stocks for the strategy from it

Hi everyone,

I am new to Quantopian, so would highly appreciate your help here. I've got a list of 438 stocks in a csv file, that I need to turn into a universe on quantopian. So my goal is to create a filter based on that list. I found the following code on the forum and it fits my goal pretty well.

from quantopian.pipeline.filters import  StaticAssets  
aapl_ibm = StaticAssets(symbols(['AAPL', 'IBM']))  

What I'm struggling with is I want to create a list variable with the list of stocks and input it in the functions above. So this is how I would do this normally in Python.

df = pd.read_csv('stocks.csv')  
filter_list = list(df['ticker'])  
universe_filter = StaticAssets(symbols(filter_list))  

Apparently, this approach does not work. Quantopian does not let me input and read a csv file. But how would I construct a list of 438 stocks? By hand? Any suggestions?

3 responses

You can upload csv files to Research --> Custom Datasets
It's a bit more complicated than at home, it must have certain criteria. Here it is in the docs.
Once you managed to upload it, you can import it in IDE or notebooks and use it like the other dataset (I think there are also posts in the forum about this topic)

Thanks for the information! Unfortunately, it does not satisfy my needs, since I've got annual data with no returns. So basically a list of tickers. I just somehow need to make Quantopian ingest this list to a filter and use that to get the universe that I need. So looks like it can't be done and I have to manually input all the tickers I need.

Yeah, it's probably the easiest way, I once did that on another platform. Just printed out the list, copied it and pasted it into their IDE as a list.