Back to Community
InvalidSidCount: 0019

The following line of code throws me an error saying : InvalidSidCount: 0019 Algorithm must reference 1-500 SIDs. Found 0

def initialize(context):  
    pass

def before_trading_start(context):  
    fundamental_df = get_fundamentals(  
        query(  
            # put your query in here by typing "fundamentals."  
            fundamentals.valuation_ratios.pe_ratio,  
            fundamentals.asset_classification.morningstar_sector_code  
        )  
        .filter(fundamentals.valuation.market_cap != None)  
        .filter(fundamentals.valuation.shares_outstanding != None)  
        .order_by(fundamentals.valuation.market_cap.desc())  
        .limit(100)  
    )  


def handle_data(context,data):  
    pass  
2 responses

Hi Yatharth,

Try adding
update_universe(fundamental_df) within the end of before_trading_start

Now I got it that there were no securities passed either or manually or by universe update/set , that's why I got the error.
Thanks