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
评论列表
文章目录