Python backtrader alternative data

class Addmoredata(PandasData):
 lines=('Year_Sum_Volume',)
 params = (('Year_Sum_Volume',7),)

class ReadingData(bt.Strategy):
  def log(self,txt,dt=None):
    dt = dt or self.datas[0].datetime.date(0)
    print('%s, %s' % (dt.isoformat(), txt))

  def next(self):
    self.log(f"SUM:{self.datas[0].Year_Sum_Volume[0]}")

cerebro = bt.Cerebro()
cerebro.addstrategy(Addmoredata)
df = yf.download('AAPL')
df.reset_index(inplace=True)
df['openinterest'] = 0 
df = df.assign(Year_Sum_Volume = df.groupby(df['Date'].dt.year) 
 ['Volume'].transform('mean'))
df.set_index('Date',inplace=True)

feed = Addmoredata(dataname=df)
cerebro.adddata(feed)
cerebro.run()

i want to add alternative data to backtrader , but an error pop up which is TypeError: PandasData.init() takes 1 positional argument but 2 were given.

The alternaitve data is Year_Sum_Volume

How can i fix it , Thank you for answering

🔴 No definitive solution yet