I'm trying to handle data at different resolutions (like 15 minutes, hourly, daily, and weekly) for the same stock. So, what I did was add minute resolution data for the stock and then consolidate it to get the resolution I want.

        self.symbol = self.AddEquity(
            "QQQ",
            Resolution.Minute,
            extendedMarketHours=True,
            dataNormalizationMode=DataNormalizationMode.Raw,
        ).Symbol
        
        # Custom Daily consolidator
        customDailyConsolidator = TradeBarConsolidator(self.CustomDaily)
        customDailyConsolidator.DataConsolidated += self.OnDailyData
        self.SubscriptionManager.AddConsolidator(self.symbol, customDailyConsolidator)

        self.Consolidate(self.symbol, Resolution.Hour, self.OnHourData)
        self.Consolidate(self.symbol, timedelta(minutes=15), self.OnFifteenMinuteData)

It's been smooth consolidating 15-minute and hourly data, but daily and weekly data are giving me a bit of trouble. For instance, daily bars' open and close are aligned with regular market hours, but consolidating extended market hour data results in daily bars with their open matching the pre-market open price. Although I successfully use a custom daily method to address this, defining a custom weekly method proves to be more difficult.

    def CustomDaily(self, dt):
        '''Custom Daily Func with regular market hours'''
        if dt.time() >= datetime.time(9, 30, 0):
            start = dt.replace(hour=9, minute=30, second=0, microsecond=0)
            end = dt.replace(hour=16, minute=0, second=0, microsecond=0)
        else:
            prior_day = dt - timedelta(days=1)
            start = prior_day.replace(hour=9, minute=30, second=0, microsecond=0)
            end = prior_day.replace(hour=15, minute=0, second=0, microsecond=0)
        return CalendarInfo(start, end-start)

I think the easiest way to get daily or weekly data is to read it from the database, just like minute data. However, I believe QuantConnect does not support that functionality. Any advice to define a custom weekly method, and consolidate minute data into correct weekly bars?

The weekly open, high, low, and close prices should encompass the period from the opening of the first trading day at 9:30 AM to the closing of the last trading day at 4:00 PM.

    def CustomWeekly(self, dt):
    	???