Back

Value of Greeks.Delta is always 0

Value of Greeks.Delta is always 0.

See my backtest. 

Update Backtest








0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Added     

self.SetWarmUp(timedelta(10)) 

and  

        if(self.IsWarmingUp):
            return

statements, still values of Greeeks.Delta is 0.

0


Hi Valery, before getting the greeks and volatility, you need to add the pricing model. 

from QuantConnect.Securities.Option import OptionPriceModels
def Initialize(self):
option = self.AddOption()
option.PriceModel = OptionPriceModels.CrankNicolsonFD()

Check this page for the available pricing models 

https://www.quantconnect.com/lean/docs#topic136.html

You can also check this sample algorithm

https://github.com/QuantConnect/Lean/blob/master/Algorithm.Python/BasicTemplateOptionsHistoryAlgorithm.py
3

I'm also having an issue with the greeks always being zero. I added the equity, added the options, added the pricing model and given 10 days of warmup. Still no greeks and I'm out of ideas.

Also, I don't understand why the greeks even need warmup. The greeks should not need historical data to calculate.

I've attached my backtest. At this point, it does not trade but it filters the options and gets the greeks.

Any help would be appreciated!

 

 

0


HI GregasMaximus,

There are no options in your chain because your expiration filter does not allow any contracts into the chain. The expiration filter is set to

.Expiration(timedelta(0), timedelta(0)))

instead set it to something like

.Expiration(timedelta(0), timedelta(30)))


You will also need to warm up your algorithm for longer period. Right now you are warming up for 10 minutes, instead let's warm up for 30 days because the default underlying volatility model requires 30 data points to be warmed up

self.SetWarmUp(30, Resolution.Daily)


Check out the options template algorithm on the Lean repository as an example.

Best
Rahul

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed