I'm trying to enter a trade 2 minutes before market close. At this point, the currently working daily bar is almost complete and I want to add it to my entry logic. However, this is currently throwing an error:
 

from AlgorithmImports import *
from datetime import *
from math import *

class TestBreakout(QCAlgorithm) :
    def Initialize(self) :
        self._minutes_before_market_close = 2
        self.allocation = 1
        self._days_held = 0

        self.gld_daily = self.add_equity("GLD", Resolution.DAILY).symbol
        self.gld = self.add_equity("GLD", Resolution.MINUTE).symbol

        self.consolidator = TradeBarConsolidator(timedelta(1))
        self.subscription_manager.add_consolidator(self.gld, self.consolidator)

        # Schedule entry and exit 2 minutes before market close
        self.schedule.on(
            self.date_rules.every_day(),
            self.time_rules.before_market_close(self.gld, self._minutes_before_market_close),
            self.entry_exit
        )
    
    def entry_exit(self) :
        valid_entry = self.check_GLD_entry()
        if not self.portfolio[self.gld].invested and valid_entry :
            self.set_holdings(self.gld, self.allocation, False, "GLD_BO entry")
        
    def check_GLD_entry(self) :
        current_price = self.securities[self.gld].price
        gld_history = self.history(self.gld_daily, 3, Resolution.DAILY)
        
        todays_bar = self.consolidator.working_bar
        gld_history.add(todays_bar)

        if gld_history.empty :
            return False

        gld_highest_high = gld_history.iloc[:-1]["high"].max()
        if current_price <= gld_highest_high :
            return False
        
        return True
    
    def on_data(self, data: Slice) :
        pass