bsopt.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:pyktrader2 作者: harveywwu 项目源码 文件源码
def StrikeFromDelta( IsCall, Spot, Vol, Texp, Rd, Rf, Delta ):
    '''Calculates the strike of a European vanilla option gives its Black-Scholes Delta.
    It assumes the Delta is an over-ccy spot Delta.'''

    def ArgFunc( Strike ):
        DeltaCalc = BSDelta( IsCall, Spot, Strike, Vol, Texp, Rd, Rf )
        return DeltaCalc - Delta

    LoStrike = Spot * exp( ( Rd - Rf ) * Texp - 4 * Vol * sqrt( Texp ) )
    HiStrike = Spot * exp( ( Rd - Rf ) * Texp + 4 * Vol * sqrt( Texp ) )

    Strike = brenth( ArgFunc, LoStrike, HiStrike )
    return Strike
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号