I've had to skip this lesson and move on.  But, I don't like leaving things in the air.

I got this message:

SPY' wasn't found in the Slice object, likely because there was no-data at this moment in time and it wasn't possible to fillforward historical data. Please check the data exists before accessing it with data.ContainsKey("SPY")

  at on_data

    spy_price = data["SPY"].close

                ~~~~^^^^^^^

It doesn't seem to matter if I run the code I edited or the Solution code.  Both result the same.

At first I thought this might happen if the market wasn't open.  But today, now, it surely is open.  So that can't be it I guess.  

Any suggestions?  Here is the code:

# region imports
from AlgorithmImports import *
# endregion
class MomentumBasedTacticalAllocation(QCAlgorithm):

    def initialize(self):
        self.set_start_date(2007, 8, 1)  # Set Start Date
        self.set_end_date(2010, 8, 1)  # Set End Date
        
        #1. Subscribe to SPY -- S&P 500 Index ETF -- using daily resolution
        self.spy = self.add_equity("SPY", Resolution.DAILY)  
        
        #2. Subscribe to BND -- Vanguard Total Bond Market ETF -- using daily resolution
        self.bnd = self.add_equity("BND", Resolution.DAILY)
        
        #3. Set strategy cash to $3000
        self.set_cash(3000)
        
    def on_data(self, data):
        spy_price = data["SPY"].close
        bnd_price = data["BND"].close
        pass