Hello, I am creating my first options trading algorithm and I need to use Greeks as a part of the selection. I have found on the forums that apparently you need the "CrankNicolsonFD" Pricing Model in order to use greeks. Here is the code in the Initialize Method:
option = self.AddOption("SPX", Resolution.Minute)
option.PriceModel = OptionPriceModels.CrankNicolsonFD()
option.SetFilter(-2, +2, TimeSpan.FromDays(30), TimeSpan.FromDays(60))
self.SetWarmUp(60, Resolution.Daily)
However when I backtest, I get an error that "OptionPriceModels" is not defined. This is strange because every options algo has this very line of code but I can't get it to work and there seem to be no other threads of people having the same problem.
So my question is how do I fix this? And also it would be helpful if I could get some confirmation that I indeed need this pricing model in order to use Greeks.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!