When creating a Beta indicator and passing Symbol objects for cash indices VIX and SPX, I get the following error:

Stack Trace

Please register to receive data for symbol 'NONE 0' using the AddSecurity() function. in Indicators.cs:line 2211 Please register to receive data for symbol 'NONE 0' using the AddSecurity() function.

 

The only explanation I can think of is due to these symbol objects being cash indices, and not tradable securities like equities, ETFs, etc. Can self.B() be used on cash indices? If so, what am I doing wrong?

 

Code below:


# region imports

from AlgorithmImports import *

# endregion


 

class HyperActiveGreenGoat(QCAlgorithm):


 

def Initialize(self):

self.SetStartDate(2021, 12, 11) # Set Start Date

self.SetEndDate(2022, 12, 11)

self.SetCash(100000) # Set Strategy Cash

self.VIX = self.AddIndex("VIX", Resolution.Hour).Symbol

self.SPX = self.AddIndex("SPX", Resolution.Hour).Symbol


 

self.VIX_SPX_beta = self.B(self.VIX, self.SPX, 63)


 

def OnData(self, data: Slice):