Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Feature Request: Lookup Of SID By Symbol

Hello Dan et al,

I would really like to see an option to lookup a SID using a symbol. This would be extremely useful for anyone importing a CSV of symbols using 'fetcher' which, as you know, I'm looking at.

It should be very easy to implement. If I import some symbols with 'fetcher' I can get a DataFrame like this:

1970-01-01 PRINT          qty sid  
dt  
2002-02-15 00:00:00+00:00 200 Security(3321 [GPS])  
2002-02-15 00:00:00+00:00 200 Security(25090 [HON])  
2002-02-15 00:00:00+00:00 200 LIZ  
2002-02-18 00:00:00+00:00 -100 Security(25090 [HON])  
2002-02-18 00:00:00+00:00 -100 LIZ  
2002-02-19 00:00:00+00:00 -100 Security(3321 [GPS])  
2002-02-19 00:00:00+00:00 -100 Security(25090 [HON])  
2002-02-19 00:00:00+00:00 -100 LIZ  
2002-02-20 00:00:00+00:00 200 Security(3321 [GPS])  
2002-02-20 00:00:00+00:00 200 LIZ  
2002-02-21 00:00:00+00:00 -200 Security(3321 [GPS])  
2002-02-21 00:00:00+00:00 -200 LIZ  
2002-02-15 PRINT Symbol not known: LIZ  

but there is no way to use the SIDs! Now if 'fetcher' had an additional option....

       fetch_csv('https://raw.github.com/pcawthron/StockData/master/berkshire_new_indexed.csv',  
               date_column  = 'date',  
               date_format  = '%m/%d/%Y',  
               pre_func     = show_data,  
               post_func    = show_data,  
               set_universe = True)  

P.

1 response

how about, print the stuff to a file, read in as a CSV, and zip everything into a dict?

is there a way to print to a file on the web-based backtester?

otherwise, you could manually do this on your own computer, and upload a CSV onto your github that contains [SID, symbol] for each line of the file