Math::Business::BlackScholesMerton::NonBinaries
use Math::Business::BlackScholesMerton::NonBinaries; # price of a Call spread option my $price_call_option = Math::Business::BlackScholesMerton::NonBinaries::vanilla_call( 1.35, # stock price 1.34, # barrier (7/365), # time 0.002, # payout currency interest rate (0.05 = 5%) 0.001, # quanto drift adjustment (0.05 = 5%) 0.11, # volatility (0.3 = 30%) );
Contains non-binary option pricing formula.
USAGE my $price = vanilla_call($S, $K, $t, $r_q, $mu, $sigma); DESCRIPTION Price of a Vanilla Call
USAGE my $price = vanilla_put($S, $K, $t, $r_q, $mu, sigma) DESCRIPTION Price a standard Vanilla Put
USAGE my $price = lbfloatcall($S, $K, $t, $r_q, $mu, $sigma, $S_max, $S_min) DESCRIPTION Price of a Lookback Float Call
USAGE my $price = lbfloatcall($S, $K, $t, $r_q, $mu, $sigma, $S_max, $S_min) DESCRIPTION Price of a Lookback Float Put
USAGE my $price = lbfixedcall($S, $K, $t, $r_q, $mu, $sigma, $S_max, $S_min) DESCRIPTION Price of a Lookback Fixed Call
USAGE my $price = lbfixedput($S, $K, $t, $r_q, $mu, $sigma, $S_max, $S_min) DESCRIPTION Price of a Lookback Fixed Put
USAGE my $price = lbhighlow($S, $K, $t, $r_q, $mu, $sigma, $S_max, $S_min) DESCRIPTION Price of a Lookback High Low
returns the d1 term common to many BlackScholesMerton formulae.
This is a common function use to calculate the lookbacks options price. See [5] for details.
Standard normal density function
USAGE my $price = callspread($S, $U, $D, $t, $r_q, $mu, $sigmaU, $sigmaD); DESCRIPTION Price of a CALL SPREAD
USAGE my $price = putspread($S, $U, $D, $t, $r_q, $mu, $sigmaU, $sigmaD); DESCRIPTION Price of a PUT SPREAD
A function implemented by Diethelm Wuertz.
Description of parameters:
$S - starting spot $H - barrier $X - exercise price $K - cash rebate
References: Haug, Chapter 2.10.1
$S - spot $H2 - high barrier $H1 - low barrier $K - payout strike $tiy - time in years $sigma - volatility $mu - mean $r - interest rate $type - 'c' for buy or 'p' for sell
Reference: https://core.ac.uk/download/pdf/19187200.pdf
To install Math::Business::BlackScholesMerton, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Business::BlackScholesMerton
CPAN shell
perl -MCPAN -e shell install Math::Business::BlackScholesMerton
For more information on module installation, please visit the detailed CPAN module installation guide.