Hello,
So I worked off of the Iron Condor applied options strategy and followed it pretty closely, it builds, and has no issues until I begin to backtest, where it says the following:
During the algorithm initialization, the following exception has occurred: AttributeError : 'IronCondorAlgorithm' object has no attribute 'UniverseFunc'
at Initialize in main.py:line 22
AttributeError : 'IronCondorAlgorithm' object has no attribute 'UniverseFunc'
I would attach the strategy, but doesn't seem to be an option besides sharing with an individual, and my backtests don't run so I can't share those.
Here's line 22, with surrounding lines
equity = self.AddEquity("SPY", Resolution.Minute)
option = self.AddOption("SPY",Resolution.Minute)
self.symbol = option.Symbol
option.SetFilter(self.UniverseFunc) #THIS IS LINE 21, NO LINE 22 ##COMMENTED OUT
Here's the universe function:
I copied it directly from the Applied Options strategy because the one I wrote wasn't working,
def UniverseFunc(self, universe):
return universe.IncludeWeeklys().Strikes(-15, 15).Expiration(timedelta(0), timedelta(40))
Please advise,
Zach