Back

How to get the delta from OptionHolding object

Hi,

I want to get my delta exposure for every option in my portfolio, this is what I do:

( I want to add up all the deltas to get total delta )
def getDelta(  ):
        for inst in self.Portfolio:
            if inst.Value.Invested: 
                #here I try to get the delta but "inst" is OptionHolding object and not option

 

 

thanks

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.


Hi Gil,

We provide Greeks for option contracts. You could use self.Portfolio[symbol].Value.Greeks to assess the Greeks provided by us. Thank you!

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.


Hi,
this:
self.Portfolio[symbol] 
does not return option contract, it returns optionHolding.

if you try what you suggested it will say "OptionHolding has no attribute Value"
and if you try:

self.Portfolio[symbol].Greeks

it will say "OptionHolding has no attribute Greeks"

this is the attrubutes option Holding has:
https://www.quantconnect.com/lean/documentation/topic27676.html

so than again, I can't see the greeks of my holdings

thanks

0

Hi Gil,

Please provide the full algorithm so that we can better help you solve the problem. Thanks!

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