naginterfaces.library.specfun.opt_binary_con_price¶
- naginterfaces.library.specfun.opt_binary_con_price(calput, x, s, k, t, sigma, r, q)[source]¶
opt_binary_con_price
computes the price of a binary or digital cash-or-nothing option.For full information please refer to the NAG Library document for s30ca
https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/s/s30caf.html
- Parameters
- calputstr, length 1
Determines whether the option is a call or a put.
A call; the holder has a right to buy.
A put; the holder has a right to sell.
- xfloat, array-like, shape
must contain , the th strike price, for .
- sfloat
, the price of the underlying asset.
- kfloat
The amount, , to be paid at expiration if the option is in-the-money, i.e., if when , or if when , for .
- tfloat, array-like, shape
must contain , the th time, in years, to expiry, for .
- sigmafloat
, the volatility of the underlying asset. Note that a rate of 15% should be entered as .
- rfloat
, the annual risk-free interest rate, continuously compounded. Note that a rate of 5% should be entered as .
- qfloat
, the annual continuous yield rate. Note that a rate of 8% should be entered as .
- Returns
- pfloat, ndarray, shape
contains , the option price evaluated for the strike price at expiry for and .
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: and .
- (errno )
On entry, .
Constraint: and .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- Notes
opt_binary_con_price
computes the price of a binary or digital cash-or-nothing option which pays a fixed amount, , at expiration if the option is in-the-money (see the S Introduction). For a strike price, , underlying asset price, , and time to expiry, , the payoff is, therefore, , if for a call or for a put. Nothing is paid out when this condition is not met.The price of a call with volatility, , risk-free interest rate, , and annualised dividend yield, , is
and for a put,
where is the cumulative Normal distribution function,
and
The option price is computed for each strike price in a set , , and for each expiry time in a set , .
- References
Reiner, E and Rubinstein, M, 1991, Unscrambling the binary code, Risk (4)