Hey, I want to create a new class called Pairs().

In need this class to keep track of the historical data for my specific pair. That's why I tried to create a rolling window inside this new class which I wanted to update. Unfortunately I don't have access to indicators or any other functionality like self.History in this new class. I tried to inherit QCAlgorithm but it gives me back an error. How can I use these provided indicators in my new class?

Error Message:

Runtime Error: Trying to dynamically access a method that does not exist throws a TypeError exception. To prevent the exception, ensure each parameter type matches those required by the 'float'>) method. Please checkout the API documentation.
  at __init__
    self.s1_closeWindow.Add(close_s1)
  File "main.py" in main.py: line 233

I only could find one thread releated to this the topic, but I still couldn't figure it out.

from sklearn.linear_model import LinearRegression
from statsmodels.tsa.stattools import coint, adfuller
import statsmodels.api as sm
import pandas as pd
import numpy as np
from AlgorithmImports import *

above: all my libraries I've imported

below: the class I tried to create, but I don't have access to the Window.Add() method

class Pair():
#holds the symbols of the 2 two chosen stocks
#calculates the spread (w/o given alpha/beta) for a time period
#calculates the spread (w/ given alpha/beta) for a time period
#holds a rolling window of the price history to update in the OnData method

    def __init__(self, s1, s2, lookback, history_s1, history_s2):
        self.pair_symbols = (s1,s2)
        self.s1_closeWindow = RollingWindow[TradeBar](lookback)
        self.s2_closeWindow = RollingWindow[TradeBar](lookback)
        
        
        df_s1 = np.log(history_s1.loc[s1]['close'])
        df_s2 = np.log(history_s2.loc[s2]['close'])
        
        for close_s1 in df_s1[:]:
            self.s1_closeWindow.Add(close_s1) 
        for close_s2 in df_s2[:]:
            self.s2_closeWindow.Add(close_s2)
            
        self.lenght_s1 = len(self.self.s1_closeWindow)
        self.lenght_s2 = len(self.self.s2_closeWindow)