Hi there,

I am working on some custom moving average indicator and encountered an issue when setting up automatic warm-up. The script is saying that I am giving three arguments to the Update method, but I am only passing on two arguments, a date and a value. Please see below for the error description and the code:


During the algorithm initialization, the following exception has occurred: Update() takes 2 positional arguments but 3 were given
  at Initialize
    self.hyg_ief_ma.Update(hyg_ief_history.loc[self.hyg].index[i] in main.py: line 53
 Update() takes 2 positional arguments but 3 were given

 

# region imports
from AlgorithmImports import *
from collections import *
# endregion


class CustomSimpleMovingAverage(PythonIndicator):
    def __init__(self, name, period):
        self.Name = name
        self.WarmUpPeriod = period
        self.Time = datetime.min
        self.Value = 0
        self.queue = deque(maxlen=period)

    def Update(self, input: BaseData) -> bool:
        self.queue.appendleft(input.Value)
        count = len(self.queue)
        self.Time = input.Time
        self.Value = sum(self.queue) / count
        return count == self.queue.maxlen


class UglyFluorescentOrangeParrot(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2021, 8, 2)  # Set Start Date
        self.SetCash(100000)  # Set Strategy Cash
        self.ma_dict = {}
        self.ma_period = 100

        # Add sector ETFs
        self.sector_etfs = ['FDN','IBB','IEZ','IGV','IHE','IHF','IHI','ITA','ITB','IYJ','IYT','IYW','IYZ','KBE','KCE','KIE','PBJ','PBS','SMH','VNQ','XLB','XLP','XLU','XOP','XRT']
        for x in self.sector_etfs:
            self.AddEquity(x,Resolution.Daily)
            self.Securities[x].FeeModel = ConstantFeeModel(0)
        # Add asset class ETFs
        self.asset_etfs = ['IWM','EFA','EEM','DBC','GLD','VNQ','TLT','SHY']
        for x in self.asset_etfs:
            self.AddEquity(x,Resolution.Daily)
            self.Securities[x].FeeModel = ConstantFeeModel(0)
        # Initialize ratio moving average indicators
        self.spy_bnch_ma = CustomSimpleMovingAverage("SPY BNCH MA", 100)
        self.hyg_ief_ma = CustomSimpleMovingAverage("HYG IEF MA", 100)
        self.hyg = self.AddEquity('HYG',Resolution.Daily).Symbol
        self.ief = self.AddEquity('IEF',Resolution.Daily).Symbol
        hyg_ief_history = self.History([self.hyg, self.ief], 100, Resolution.Daily)
        for i in range(len(hyg_ief_history.loc[self.hyg])):

            self.Log(hyg_ief_history.loc[self.hyg].index[i])
            self.Log(hyg_ief_history.loc[self.hyg]['close'][i]/hyg_ief_history.loc[self.ief]['close'][i])

            self.hyg_ief_ma.Update(hyg_ief_history.loc[self.hyg].index[i], hyg_ief_history.loc[self.hyg]['close'][i]/hyg_ief_history.loc[self.ief]['close'][i])




    def OnData(self, data: Slice):