There seems to be a puzzling behaviour with "Theoretical Price" of option contracts computed via QuantLib. Including an example backtest.
First, let's start with
option.PriceModel = OptionPriceModels.BlackScholes();
IV results seem reasonable given that interest and yield are apparently both set to flat 1% in QC. Zero values are consistently returned for the TheoreticalPrice.
Now, compare to binomial tree pricing, such as:
option.PriceModel = OptionPriceModels.BinomialJoshi();
option.PriceModel = OptionPriceModels.BinomialJarrowRudd();
In these cases, TheoreticalPrice values are non-zero but very different from the mid-spread. Those unusual values are reproducible between backtests. Take this contract for example:
TimeAndContract,Right,Expiry,Strike,Bid,Ask,Last,TheoreticalPrice,OI,Underlying,IV,HV
(BS)
2017-08-14 16:00:00 SPY 190118P00245000,Put,1/18/2019 12:00:00 AM,245.00,16.270,16.760,16.500,0.000,0,246.520,0.0858,0.1604
(binomial)
2017-08-14 16:00:00 SPY 190118P00245000,Put,1/18/2019 12:00:00 AM,245.00,16.270,16.760,16.500,7.980,0,246.520,0.0858,0.1604
Specific questions:
- TheoreticalPrice in Black-Scholes case: Why all zeroes?
- TheoreticalPrice in binomial models: Do those values carry any meaning?
- Could interest rate and dividend yield be set by a user? E.g., force ConstantQLRiskFreeRateEstimator(0.03) in C# API?
- (Somewhat separate topic) Underlying volatility model (historical, for the spot price, as in this line , security.VolatilityModel): What is the default? Over what historical period? What happens if only a few days are given as a warm-up? Any intraday models here?
Jing Wu
Hi Pavel, these are the models all we have
here is the default estimators used by all models
private static IQLUnderlyingVolatilityEstimator _underlyingVolEstimator = new ConstantQLUnderlyingVolatilityEstimator();
private static IQLRiskFreeRateEstimator _riskFreeRateEstimator = new ConstantQLRiskFreeRateEstimator();
private static IQLDividendYieldEstimator _dividendYieldEstimator = new ConstantQLDividendYieldEstimator();
For the blacksholes model
https://github.com/QuantConnect/Lean/blob/21cd972e99f70f007ce689bdaeeafe3cb4ea9c77/Common/Securities/Option/OptionPriceModels.cs#L50To
In order to create a BlackScholes with different estimators, you can duplicate the function and use custom estimators. The default volatility model is the standard deviation of returns, the time period is 30 days.
Pavel Paramonov
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.
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!