Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
im facing ValueError: Can't specialize Fundamentals to new domain EquityCalendarDomain('IN', 'XBOM').

def make_pipeline():
base_universe = Q1500US()

daily_rtn = DailyReturns(window_length=30, mask=base_universe)  
high_daily_rtn = daily_rtn.percentile_between(80,100)  
top_20_base_industrial = base_universe & high_daily_rtn  

mean_10 = SimpleMovingAverage(inputs=[EquityPricing.close], window_length=10, mask=top_20_base_industrial)  
mean_30 = SimpleMovingAverage(inputs=[EquityPricing.close], window_length=30, mask=top_20_base_industrial)  
perc_diff = (mean_10-mean_30)/mean_30  

shorts = perc_diff < 0.5  
long = perc_diff > 0.5  
securities_to_trade = shorts | long  

return Pipeline(columns={  
    'Shorting':shorts,  
    'Percentage Difference':perc_diff,  
    'Long On Stocks':long  
}, screen=securities_to_trade, domain=IN_EQUITIES)

result = run_pipeline(make_pipeline(), '2015-01-03', '2015-01-03')
result

1 response

The issue is the built-in filter Q1500US, which includes the 1500 largest US stocks, cannot be used in a pipeline with a domain other than US_EQUITIES. The Q1500US filter only includes US stocks. There is not a similar built-in filters for other markets. One would need to build a filter from the market cap and metadata fields of security_type and is_primary to do something similar for the IN_EQUITIES domain.

Hope that helps.

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.