Back

Implied Volatility on Options returns zero

I have cloned the OptionChainConsistencyRegressionAlgorithm and was trying to log IV on options data and i am getting zero.

public override void OnData(Slice slice)
        {
            if (!Portfolio.Invested)
            {
                OptionChain chain;
                if (slice.OptionChains.TryGetValue(OptionSymbol, out chain))
                {
                    // check if data is consistent
                    foreach (var o in chain)
                    {
                        Log(string.Format("chain:{0} Bid:{1} Ask:{2} IV:{3}", o.Symbol, o.BidPrice, o.AskPrice, o.ImpliedVolatility));
                        if (!Securities.ContainsKey(o.Symbol))
                        {
                            // inconsistency found: option chains contains contract information that is not available in securities manager and not available for trading
                            throw new Exception(string.Format("inconsistency found: option chains contains contract {0} that is not available in securities manager and not available for trading", o.Symbol.Value));
                        }
                    }

}

}

Update Backtest








Thanks @Venugopal! Options is in beta - please join the slack conversation here to hear about the updates: http://qnt.co/slack

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.



Thank you Jared.

0

In case anyone else is having this issue, you need to set a pricing model as in this algo:

 

https://github.com/QuantConnect/Lean/blob/master/Algorithm.CSharp/BasicTemplateOptionsHistoryAlgorithm.cs
0

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