Barrier Option Related Functions
About 3 min
Barrier Option Related Functions
Visit the Mathema Option Pricing System for foreign exchange options and structured product valuation!
Construction Functions
Excel: =McpVanillaBarriers(args1, args2, args3, args4, args5, fmt='VP')
Python: McpVanillaBarriers(*args)
- Function: Constructs a barrier option object.
- Parameters:
args1~args5 or *args
: Parameter groups:- First Parameter Set:
OptionType
: Option type (enumeration value, e.g.,Call
orPut
).BarrierType
: Barrier type (enumeration value, e.g.,UpAndOut
orDownAndIn
).ReferenceDate
: Trade date or valuation date.SpotPx
: Spot price.BuySell
: Buy/sell direction (enumeration value, e.g.,Buy
orSell
).ExpiryDate
: Expiry date.DeliveryDate
: Delivery Date.StrikePx
: Strike price.Barrier
: Barrier price.DomesticRate
: Interest rate for currency 2.ForeignRate
: Interest rate for currency 1.Volatility
: Volatility.FaceValue
: Notional amount (default is1
).Rebate
: Rebate value (default is0.0
).PricingMethod
: Pricing method (default isBLACKSCHOLES
).OptionExpiryNature
:Exercise type, default valueEUROPEAN
.RR25
:25RR market data.BF25
:25BF market data.DiscreteFactor
:Discrete Factor。DiscreteAdjusted
:Discrete Adjustment Value。Calendar
: Holiday calendar object.DayCounter
: Day count convention (default isAct365Fixed
).PremiumDate
: Premium payment date.
- First Parameter Set:
fmt
: Parameter format (default is'VP'
),Excel-specific parameters.
- Returns: Barrier option object.
Usage Functions
Excel: =McpPrice(Obj, isAmount)
Python: Price(*args)
- Function: Calculates the option premium.
- Parameters:
Obj
: Barrier option object.isAmount
: Whether to return the amount (default isTrue
, returns the premium in currency 2;False
returns the premium in currency 1).*args
:is a dictionary, does not require the Obj parameter, other parameters are the same as those in Excel.
- Returns: Option premium.
Excel: =McpDelta(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: Delta(isCCY2=False, isAmount=True, npricingMethod=1)
- Function: Calculates the Delta value of the option.
- Parameters:
obj
: Barrier option object.isCcy2
: Whether it is for currency 2 (True
for currency 2,False
otherwise).isAmount
: Whether to calculate the amount (default isTrue
).pricingMethod
: Pricing method (default is1
).isClosedFormMethod
: Whether to use the closed-form method for Greeks calculation (default isTrue
). IfTrue
, Greeks are calculated using the Black-Scholes model regardless of the selected pricing model; otherwise, the selected model is used.
- Returns: Delta.
Excel: =McpForwardDelta(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: ForwardDelta(isCCY2=False, isAmount=True, npricingMethod=1)
- Function: Calculates the Forward Delta value of the option.
- Parameters:
obj
: Barrier option object.isCcy2
: Whether it is for currency 2 (True
for currency 2,False
otherwise).isAmount
: Whether to calculate the amount (default isTrue
).pricingMethod
: Pricing method (default is1
).isClosedFormMethod
: Whether to use the closed-form method for Greeks calculation (default isTrue
).
- Returns: Forward Delta.
Excel: =McpVega(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: Vega(isCCY2=False, isAmount=True, npricingMethod=1)
- Function: Calculates the Vega value of the option.
- Parameters:
obj
: Barrier option object.isCcy2
: Whether it is for currency 2 (True
for currency 2,False
otherwise).isAmount
: Whether to calculate the amount (default isTrue
).pricingMethod
: Pricing method (default is1
).isClosedFormMethod
: Whether to use the closed-form method for Greeks calculation (default isTrue
).
- Returns: Vega.
Excel: =McpGamma(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: Gamma(self, isCCY2=False, isAmount=True, npricingMethod=1)
- Function: Calculates the Gamma value of the option.
- Parameters:
obj
: Barrier option object.isCcy2
: Whether it is for currency 2 (True
for currency 2,False
otherwise).isAmount
: Whether to calculate the amount (default isTrue
).pricingMethod
: Pricing method (default is1
).isClosedFormMethod
: Whether to use the closed-form method for Greeks calculation (default isTrue
).
- Returns: Gamma.
Excel: =McpTheta(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: Theta(isCCY2=False, isAmount=True, npricingMethod=1)
- Function: Calculates the Theta value of the option.
- Parameters:
obj
: Barrier option object.isCcy2
: Whether it is for currency 2 (True
for currency 2,False
otherwise).isAmount
: Whether to calculate the amount (default isTrue
).pricingMethod
: Pricing method (default is1
).isClosedFormMethod
: Whether to use the closed-form method for Greeks calculation (default isTrue
).
- Returns: Theta.
Excel: =McpVanna(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: Vanna(isCCY2=False, isAmount=True, npricingMethod=1)
- Function: Calculates the Vanna value of the option.
- Parameters:
obj
: Barrier option object.isCcy2
: Whether it is for currency 2 (True
for currency 2,False
otherwise).isAmount
: Whether to calculate the amount (default isTrue
).pricingMethod
: Pricing method (default is1
).isClosedFormMethod
: Whether to use the closed-form method for Greeks calculation (default isTrue
).
- Returns: Vanna.
Excel: =McpVolga(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: Volga(isCCY2=False, isAmount=True, npricingMethod=1)
- Function: Calculates the Volga value of the option.
- Parameters:
obj
: Barrier option object.isCcy2
: Whether it is for currency 2 (True
for currency 2,False
otherwise).isAmount
: Whether to calculate the amount (default isTrue
).pricingMethod
: Pricing method (default is1
).isClosedFormMethod
: Whether to use the closed-form method for Greeks calculation (default isTrue
).
- Returns: Volga.
Excel: =McpRho(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: Rho(isCCY2=False, isAmount=True, npricingMethod=1)
- Function: Calculates the Rho value of the option.
- Parameters:
obj
: Barrier option object.isCcy2
: Whether it is for currency 2 (True
for currency 2,False
otherwise).isAmount
: Whether to calculate the amount (default isTrue
).pricingMethod
: Pricing method (default is1
).isClosedFormMethod
: Whether to use the closed-form method for Greeks calculation (default isTrue
).
- Returns: Rho.