I have been trying to implement the Boot Camp for Liquid Universes and it keeps giving the same error for every security added:

Backtest Handled Error: ORCL R735QTJ8XC9X: The security does not have an accurate price as it has not yet received a bar of data. Before placing a trade (or using SetHoldings) warm up your algorithm with SetWarmup, or use slice.Contains(symbol) to confirm the Slice object has price before using the data. Data does not necessarily all arrive at the same time so your algorithm should confirm the data is ready before using it. In live trading this can mean you do not have an active subscription to the asset class you're trying to trade. If using custom data make sure you've set the 'Value' property.

 

I tried many solutions such as warming up the data, checking for price to be non-zero (makes no errors but no securities are traded either), getting last known prices using set_security_initializer and it is still not working. I need human help.

 


# region imports
from AlgorithmImports import *
# endregion
class LiquidUniverseSelection(QCAlgorithm):
    
    filtered_by_price = None
    
    def initialize(self):
        self.set_start_date(2019, 1, 11)  
        self.set_end_date(2019, 7, 1) 
        self.set_cash(100000)  
        self.add_universe(self.coarse_selection_filter)
        # Ignore this for now, we'll cover it in the next task.
        self.universe_settings.resolution = Resolution.DAILY 

        self.SetWarmup(timedelta(days=30))  # Warm up with 30 days of data

    def coarse_selection_filter(self, coarse):
        sorted_by_dollar_volume = sorted(coarse, key=lambda x: x.dollar_volume, reverse=True) 
        filtered_by_price = [x.symbol for x in sorted_by_dollar_volume if x.price > 10]
        return filtered_by_price[:8]
   
    def on_securities_changed(self, changes):
        self.changes = changes
        self.log(f"on_securities_changed({self.time}):: {changes}")
        
        #1. Liquidate removed securities
        for security in changes.removed_securities:
            if security.invested:
                self.liquidate(security.symbol)
        
        #2. We want 10% allocation in each security in our universe
        for security in self.changes.added_securities:
            self.set_holdings(security.symbol, 0.1)