Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Faulty data for JCI daily returns?

I'm getting daily returns for top 500 US stocks for a period in 2016:

from quantopian.pipeline.filters import Q500US  
base_universe = Q500US()

def make_pipeline():  
    returns = Returns(window_length=2)  
    pricing = USEquityPricing.close.latest  
    return Pipeline(  
        columns={  
            'daily_returns': returns,  
            'daily_pricing': pricing  
        },  
        screen=base_universe  
    )

period_start = '2016-7-11'  
period_end = '2016-8-11'

# pipeline execution: get daily returns over selected period  
data_output = run_pipeline(  
    make_pipeline(),  
    start_date=period_start,  
    end_date=period_end  
)

There are 24 trading days in that period. However, when I iterate through the data, I see the JCI stock has 48 days in this period. The vast majority of stocks have 24 obviously, and a few have less (presumably due to being removed from the universe during the given period).

Is JCI's data faulty? Or am I missing something?

Thanks
Jovan

2 responses

Kinda an anomaly. You are really seeing data for Johnson Controls and Tyco. They merged on 9-6-2016. Before that they traded under separate symbols JCI and TYC. If you look at the SID rather than the stock symbol you will see separate securities (SIDs 4117, 7679).

Attached is a notebook that shows this.

I see. Thanks for the explanation. I'll keep that in mind then.