Overall Statistics
# Period Volume (history sum)

STOCK = 'DIA'; PERIOD = 24;

class PeriodVolume(QCAlgorithm):
    
    def Initialize(self):
        self.SetStartDate(2021,6,1)
        self.SetEndDate(2021, 8, 24)  
        self.stock = self.AddEquity(STOCK, Resolution.Hour).Symbol

    def OnData(self, data):
        
        PeriodVolume = self.History(self.stock, PERIOD, Resolution.Hour).volume.sum()

        self.Plot("Indicator", "Period Volume", PeriodVolume)