robustfpm.finance.payoffs module

This submodule consists of different payoff functions for options.

robustfpm.finance.payoffs.putonmax(strike)

Payoff of Put On Max rainbow option generator

Parameters

strike (float) – Strike price

Returns

Payoff function of put on max option for a given strike

Return type

Callable

Notes

A put on max option gives holder the right to sell the maximum of the risky assets at the strike price at expiry. Its payoff function:

\[f(x_1, \dots, x_n) = \max(K - \max(x_1, \dots, x_n), 0),\]

where K is the strike price of an option

Examples

Get a payoff function of a put on max option on two actives with strike 10. Then, get its value for prices [5,7] and [9,11]

>>> a = putonmax(10)
>>> a([[5,7], [9,11]])
array([3., 0.])
robustfpm.finance.payoffs.callonmax(strike)

Payoff of Call On Max rainbow option generator

Parameters

strike (float) – Strike price

Returns

Payoff function of call on max option for a given strike

Return type

Callable

Notes

A call on max option gives holder the right to purchase the maximum of the risky assets at the strike price at expiry. Its payoff function:

\[f(x_1, \dots, x_n) = \max(\max(x_1, \dots, x_n) - K, 0),\]

where K is the strike price of an option

Examples

Get a payoff function of a call on max option on two actives with strike 10. Then, get its value for prices [5,7] and [9,11]

>>> a = callonmax(10)
>>> a([[5,7], [9,11]])
array([0, 1.])
robustfpm.finance.payoffs.put2call1(prices, *unused)

Payoff of Put 2 Call 1 rainbow option

Parameters

prices (array_like, size (n,) or (m,n)) – Asset prices

Returns

Payoff function of put 2 call 1 option for a given strike

Return type

Callable

Notes

A put 2 call 1 is an exchange option, giving the right to purchase first asset at the price of the second asset. Its payoff function:

\[f(x_1, x_2) = \max(x_1 - x_2, 0),\]

Examples

Get a payoff function of a put 2 call 1 option. Then, get its value for prices [7,5] and [5,7]

>>> a = put2call1
>>> a([[7,5], [5,7]])
array([2., 0.])