Digital Option Related Functions
About 4 min
Digital Option Related Functions
Visit the Mathema Option Pricing System for foreign exchange options and structured product valuation!
Constructor Functions
Excel: =McpEuropeanDigital(args1, args2, args3, args4, args5, fmt='VP')
Python: McpEuropeanDigital(*args)
- Function: Constructs a digital option object.
- Parameters:
args1~args5 or *args
: Parameter groups:- First Parameter Passing Method:
ReferenceDate
: Trading or valuation date.DigitalType
: Digital type (enumeration value, such asCashOrNothing
orAssetOrNothing
).BuySell
: Buy or sell direction (enumeration value, such asBuy
orSell
).SpotPx
: Spot price.StrikePx
: Strike price.Volatility
: Volatility.ExpiryDate
: Expiry date.DeliveryDate
: Delivery Date.DomesticRate
: Interest rate for currency 2.ForeignRate
: Interest rate for currency 1.PremiumDate
: Option premium payment date.FaceValue
: Principal, default value1
.Payoff
: Payoff.Calendar
: Holiday calendar object.DayCounter
: Day count convention, default valueAct365Fixed
.PricingMethod
: Pricing method, default valueBLACKSCHOLES
.ReplicateDelta
:The interpolation between the strike prices of the two European options constructed in the replication-based pricing of digital options.RR25
:25RR market data.BF25
:25BF market data.
- First Parameter Passing Method:
fmt
: Parameter format, default value'VP'
,Excel-specific parameters.
- Returns: Digital option object.
Utility Functions
Excel: =McpPrice(Obj, isAmount)
Python: Price(*args)
- Function: Calculates the option premium.
- Parameters:
Obj
: Digital option object.isAmount
: Whether to return the amount (defaultTrue
, 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 of the option.
- Parameters:
obj
: Digital option object,Python API does not require this parameter.isCcy2
: Whether it is currency 2.True
indicates currency 2,False
indicates otherwise.isAmount
: Whether to calculate the amount, default valueTrue
.pricingMethod
: Pricing method, default value1
.isClosedFormMethod
: Whether to use the closed-form method to calculate Greeks, default valueTrue
. IfTrue
, the Greeks are calculated using the Black-Scholes model regardless of the model used for premium calculation; otherwise, the selected model is used for Greeks calculation.
- 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 of the option.
- Parameters:
obj
: Digital option object,Python API does not require this parameter.isCcy2
: Whether it is currency 2.True
indicates currency 2,False
indicates otherwise.isAmount
: Whether to calculate the amount, default valueTrue
.pricingMethod
: Pricing method, default value1
.isClosedFormMethod
: Whether to use the closed-form method to calculate Greeks, default valueTrue
. IfTrue
, the Greeks are calculated using the Black-Scholes model regardless of the model used for premium calculation; otherwise, the selected model is used for Greeks calculation.
- 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 of the option.
- Parameters:
obj
: Digital option object,Python API does not require this parameter.isCcy2
: Whether it is currency 2.True
indicates currency 2,False
indicates otherwise.isAmount
: Whether to calculate the amount, default valueTrue
.pricingMethod
: Pricing method, default value1
.isClosedFormMethod
: Whether to use the closed-form method to calculate Greeks, default valueTrue
. IfTrue
, the Greeks are calculated using the Black-Scholes model regardless of the model used for premium calculation; otherwise, the selected model is used for Greeks calculation.
- Returns: Vega.
Excel: =McpGamma(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: Gamma(isCCY2=False, isAmount=True, npricingMethod=1)
- Function: Calculates the Gamma of the option.
- Parameters:
obj
: Digital option object,Python API does not require this parameter.isCcy2
: Whether it is currency 2.True
indicates currency 2,False
indicates otherwise.isAmount
: Whether to calculate the amount, default valueTrue
.pricingMethod
: Pricing method, default value1
.isClosedFormMethod
: Whether to use the closed-form method to calculate Greeks, default valueTrue
. IfTrue
, the Greeks are calculated using the Black-Scholes model regardless of the model used for premium calculation; otherwise, the selected model is used for Greeks calculation.
- Returns: Gamma.
Excel: =McpTheta(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: Theta(self, isCCY2=False, isAmount=True, npricingMethod=1)
- Function: Calculates the Theta of the option.
- Parameters:
obj
: Digital option object,Python API does not require this parameter.isCcy2
: Whether it is currency 2.True
indicates currency 2,False
indicates otherwise.isAmount
: Whether to calculate the amount, default valueTrue
.pricingMethod
: Pricing method, default value1
.isClosedFormMethod
: Whether to use the closed-form method to calculate Greeks, default valueTrue
. IfTrue
, the Greeks are calculated using the Black-Scholes model regardless of the model used for premium calculation; otherwise, the selected model is used for Greeks calculation.
- Returns: Theta.
Excel: =McpVanna(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: Vanna(self, isCCY2=False, isAmount=True, npricingMethod=1)
- Function: Calculates the Vanna of the option.
- Parameters:
obj
: Digital option object,Python API does not require this parameter.isCcy2
: Whether it is currency 2.True
indicates currency 2,False
indicates otherwise.isAmount
: Whether to calculate the amount, default valueTrue
.pricingMethod
: Pricing method, default value1
.isClosedFormMethod
: Whether to use the closed-form method to calculate Greeks, default valueTrue
. IfTrue
, the Greeks are calculated using the Black-Scholes model regardless of the model used for premium calculation; otherwise, the selected model is used for Greeks calculation.
- 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 of the option.
- Parameters:
obj
: Digital option object,Python API does not require this parameter.isCcy2
: Whether it is currency 2.True
indicates currency 2,False
indicates otherwise.isAmount
: Whether to calculate the amount, default valueTrue
.pricingMethod
: Pricing method, default value1
.isClosedFormMethod
: Whether to use the closed-form method to calculate Greeks, default valueTrue
. IfTrue
, the Greeks are calculated using the Black-Scholes model regardless of the model used for premium calculation; otherwise, the selected model is used for Greeks calculation.
- 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 of the option.
- Parameters:
obj
: Digital option object,Python API does not require this parameter.isCcy2
: Whether it is currency 2.True
indicates currency 2,False
indicates otherwise.isAmount
: Whether to calculate the amount, default valueTrue
.pricingMethod
: Pricing method, default value1
.isClosedFormMethod
: Whether to use the closed-form method to calculate Greeks, default valueTrue
. IfTrue
, the Greeks are calculated using the Black-Scholes model regardless of the model used for premium calculation; otherwise, the selected model is used for Greeks calculation.
- Returns: Rho.