简体   繁体   English

在期权计算中正确指定无风险利率

[英]Correctly specifying the Risk free rate in option calculation

As per my understand a typical option contract is priced using QuantLib as below -据我了解,典型的期权合约使用QuantLib定价如下 -

    import QuantLib as ql
    today = ql.Date(7, ql.March, 2014)
    ql.Settings.instance().evaluationDate = today
    u = ql.SimpleQuote(100.0)
    r = ql.SimpleQuote(0.01)
    sigma = ql.SimpleQuote(0.20)
    riskFreeCurve = ql.FlatForward(
                                    0, 
                                    ql.TARGET(), 
                                    ql.QuoteHandle(r), 
                                    ql.Actual360()
                                )
    volatility = ql.BlackConstantVol(
                                        0, 
                                        ql.TARGET(), 
                                        ql.QuoteHandle(sigma), 
                                        ql.Actual360()
                                    )
    process = ql.BlackScholesProcess(ql.QuoteHandle(u), ql.YieldTermStructureHandle(riskFreeCurve), ql.BlackVolTermStructureHandle(volatility))
    engine = ql.AnalyticEuropeanEngine(process)
    
    option = ql.EuropeanOption(ql.PlainVanillaPayoff(ql.Option.Call, 100.0), ql.EuropeanExercise(ql.Date(7, ql.June, 2014)))
    option.setPricingEngine(engine)

This is good.这很好。 However when I defined the risk-free rate, I did not explicitly define the compounding frequency.然而,当我定义无风险利率时,我并没有明确定义复利频率。 In typical BS formula, the risk-free rate, dividend etc. are defined as Continuously compounding rate.在典型的 BS 公式中,无风险利率、股息等被定义为连续复利。 So my questions are所以我的问题是

  1. Is above calculation correct since I did not explicitly define the compounding frequency?由于我没有明确定义复利频率,因此上述计算是否正确?
  2. If not, then how can I convert above risk free rate to Continuously compounding rate?如果不是,那么我如何将上述无风险利率转换为连续复利?

The FlatForward class you used (as most classes in QuantLib) by default interprets the passed rates as continuously compounded, so your code is already doing what you mean.默认情况下,您使用的FlatForward class(与 QuantLib 中的大多数类一样)将通过的利率解释为连续复合,因此您的代码已经在执行您的意思。

If you want to specify a different compounding convention or if you want to be explicit, the constructor can take additional parameters.如果你想指定不同的复合约定或者如果你想明确,构造函数可以采用额外的参数。 For instance, you can write例如,你可以写

ql.FlatForward(
    0,
    ql.TARGET(),
    ql.QuoteHandle(r),
    ql.Actual360(),
    ql.Continuous,
)

or或者

ql.FlatForward(
    0,
    ql.TARGET(),
    ql.QuoteHandle(r),
    ql.Actual360(),
    ql.Compounded,
    ql.Quarterly,
)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM