Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Inconsistent SIDs between Quantopian and Zipline

Hi,

I've been writing some algorithms with Quantopian and Zipline in parallel, in order to to use the upsides of both of them.

However after some confusion I've realized that the two use different sets of SIDs.
Maybe I have understood the concept of and SID wrong, but specifically in the tutorial it even states "A security's SID never changes."

For example (I ran it on Zipline 1.0.2 - with the standard quantopian-quandl bundle from the 05.Feb.2017):

On Quantopian the following code:

print(sid(24))  
print(symbol('ACRX'))  

produces the following output:

1970-01-01 01:00  PRINT Equity(24 [AAPL])  
1970-01-01 01:00  PRINT Equity(40827 [ACRX])  

In zipline however the SIDs of those two stocks are different- generally I've observed no stocks have the same SIDs.

Input:

print(sid(24))  
print(symbol('AAPL'))  

Output:

Equity(24 [ACRX])  
Equity(2689 [AAPL])  

This goes against the "tip" of working with SIDs instead of Symbols - as the SIDs are not consistent across versions.
What causes this inconsistency?

2 responses

Jakob, welcome to Quantopian.

The short answer is that the tutorial's statement only applies to Quantopian itself, and does not apply to zipline because you are using different data sources.

On the Quantopian platform, we provide all of the data, fully integrated, for free. The Quantopian tutorial is about how to use the fully-integrated platform. On the platform it is true that a security's SID never changes.

On zipline, you provide your own data (presumably downloading it from Yahoo or something similar). When you provide the data you are providing your own security numbering system.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Hi Dan,

thanks for the answer - I was assuming something along these lines!