naginterfaces.library.specfun.opt_​lookback_​fls_​greeks

naginterfaces.library.specfun.opt_lookback_fls_greeks(calput, sm, s, t, sigma, r, q)[source]

opt_lookback_fls_greeks computes the price of a floating-strike lookback option together with its sensitivities (Greeks).

For full information please refer to the NAG Library document for s30bb

https://www.nag.com/numeric/nl/nagdoc_28.5/flhtml/s/s30bbf.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.

smfloat, array-like, shape

must contain , the th minimum observed price of the underlying asset when , or , the maximum observed price when , for .

sfloat

, the price of the underlying asset.

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 minimum or maximum observed price or at expiry for and .

deltafloat, ndarray, shape

The leading part of the array contains the sensitivity, , of the option price to change in the price of the underlying asset.

gammafloat, ndarray, shape

The leading part of the array contains the sensitivity, , of to change in the price of the underlying asset.

vegafloat, ndarray, shape

, contains the first-order Greek measuring the sensitivity of the option price to change in the volatility of the underlying asset, i.e., , for and .

thetafloat, ndarray, shape

, contains the first-order Greek measuring the sensitivity of the option price to change in time, i.e., , for and , where .

rhofloat, ndarray, shape

, contains the first-order Greek measuring the sensitivity of the option price to change in the annual risk-free interest rate, i.e., , for and .

crhofloat, ndarray, shape

, contains the first-order Greek measuring the sensitivity of the option price to change in the annual cost of carry rate, i.e., , for and , where .

vannafloat, ndarray, shape

, contains the second-order Greek measuring the sensitivity of the first-order Greek to change in the volatility of the asset price, i.e., , for and .

charmfloat, ndarray, shape

, contains the second-order Greek measuring the sensitivity of the first-order Greek to change in the time, i.e., , for and .

speedfloat, ndarray, shape

, contains the third-order Greek measuring the sensitivity of the second-order Greek to change in the price of the underlying asset, i.e., , for and .

colourfloat, ndarray, shape

, contains the third-order Greek measuring the sensitivity of the second-order Greek to change in the time, i.e., , for and .

zommafloat, ndarray, shape

, contains the third-order Greek measuring the sensitivity of the second-order Greek to change in the volatility of the underlying asset, i.e., , for and .

vommafloat, ndarray, shape

, contains the second-order Greek measuring the sensitivity of the first-order Greek to change in the volatility of the underlying asset, i.e., , for and .

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry with a put option, .

Constraint: for put options, for all .

(errno )

On entry with a call option, .

Constraint: for call options, for all .

(errno )

On entry, .

Constraint: for all .

(errno )

On entry, .

Constraint: and .

(errno )

On entry, .

Constraint: for all .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: , where is the machine precision.

Notes

opt_lookback_fls_greeks computes the price of a floating-strike lookback call or put option, together with the Greeks or sensitivities, which are the partial derivatives of the option price with respect to certain of the other input parameters. A call option of this type confers the right to buy the underlying asset at the lowest price, , observed during the lifetime of the contract. A put option gives the holder the right to sell the underlying asset at the maximum price, , observed during the lifetime of the contract. Thus, at expiry, the payoff for a call option is , and for a put, .

For a given minimum value the price of a floating-strike lookback call with underlying asset price, , and time to expiry, , is

where . The volatility, , risk-free interest rate, , and annualised dividend yield, , are constants.

The corresponding put price is

In the above, denotes the cumulative Normal distribution function,

where denotes the standard Normal probability density function

and

where is taken to be the minimum price attained by the underlying asset, , for a call and the maximum price, , for a put.

The option price is computed for each minimum or maximum observed price in a set or , , and for each expiry time in a set , .

References

Goldman, B M, Sosin, H B and Gatto, M A, 1979, Path dependent options: buy at the low, sell at the high, Journal of Finance (34), 1111–1127