Class BlackScholesEuropeanOptionsFunctions
Set of static functions for Black-Scholes model calculations for european-style options.
Inheritance
Namespace: QuantSharp
Assembly: QuantSharp.dll
Syntax
public static class BlackScholesEuropeanOptionsFunctions : Object
Methods
CallDelta(Double, Double, Double, Double, Double)
Delta of an european-style CALL option, i.e. the derivative of the option's price with respect to price of the underlying instrument.
Declaration
public static double CallDelta(double S, double K, double T, double sigma, double r)
Parameters
Type | Name | Description |
---|---|---|
System.Double | S | Price of the underlying instrument |
System.Double | K | Strike price of the option |
System.Double | T | Time to expiration (in years) |
System.Double | sigma | Annual volatility of the underlying instrument (as fraction, e.g. 20% is 0.2) |
System.Double | r | Risk-free interest rate (as fraction, e.g. 5% is 0.05) |
Returns
Type | Description |
---|---|
System.Double | The option's delta |
CallImpliedVolatility(Double, Double, Double, Double, Double)
Calculate the annual implied volatility of an european CALL option given its price. (Value is returned as fraction, e.g. 0.2 is 20% volatility.)
Declaration
public static double CallImpliedVolatility(double S, double K, double T, double r, double C)
Parameters
Type | Name | Description |
---|---|---|
System.Double | S | Price of the underlying instrument |
System.Double | K | Strike price of the option |
System.Double | T | Time to expiration (in years) |
System.Double | r | Risk-free interest rate (as fraction, e.g. 5% is 0.05) |
System.Double | C | Price of the option |
Returns
Type | Description |
---|---|
System.Double | Implied volatility of the option |
Remarks
Solves numerically using Newton-Raphson method. Might fail if result would fall outside of 0-1000% range.
CallPrice(Double, Double, Double, Double, Double)
Price of an european-style CALL option.
Declaration
public static double CallPrice(double S, double K, double T, double sigma, double r)
Parameters
Type | Name | Description |
---|---|---|
System.Double | S | Price of the underlying instrument |
System.Double | K | Strike price of the option |
System.Double | T | Time to expiration (in years) |
System.Double | sigma | Annual volatility of the underlying instrument (as fraction, e.g. 20% is 0.2) |
System.Double | r | Risk-free interest rate (as fraction, e.g. 5% is 0.05) |
Returns
Type | Description |
---|---|
System.Double | The option's price |
CallRho(Double, Double, Double, Double, Double)
Rho of an european-style CALL option, i.e. the derivative of option price with respect to risk-free interest rate.
Declaration
public static double CallRho(double S, double K, double T, double sigma, double r)
Parameters
Type | Name | Description |
---|---|---|
System.Double | S | Price of the underlying instrument |
System.Double | K | Strike price of the option |
System.Double | T | Time to expiration (in years) |
System.Double | sigma | Annual volatility of the underlying instrument (as fraction, e.g. 20% is 0.2) |
System.Double | r | Risk-free interest rate (as fraction, e.g. 5% is 0.05) |
Returns
Type | Description |
---|---|
System.Double | The option's rho.
|
CallTheta(Double, Double, Double, Double, Double)
Theta of an european-style CALL option, i.e. the derivative of the option's price with respect to passage of time.
Declaration
public static double CallTheta(double S, double K, double T, double sigma, double r)
Parameters
Type | Name | Description |
---|---|---|
System.Double | S | Price of the underlying instrument |
System.Double | K | Strike price of the option |
System.Double | T | Time to expiration (in years) |
System.Double | sigma | Annual volatility of the underlying instrument (as fraction, e.g. 20% is 0.2) |
System.Double | r | Risk-free interest rate (as fraction, e.g. 5% is 0.05) |
Returns
Type | Description |
---|---|
System.Double | The option's theta.
|
Gamma(Double, Double, Double, Double, Double)
Gamma of an european-style option (same for CALL and PUT), i.e. the second derivative of the option's price with respect to price of the underlying instrument. It reflects the convexity of Delta.
Declaration
public static double Gamma(double S, double K, double T, double sigma, double r)
Parameters
Type | Name | Description |
---|---|---|
System.Double | S | Price of the underlying instrument |
System.Double | K | Strike price of the option |
System.Double | T | Time to expiration (in years) |
System.Double | sigma | Annual volatility of the underlying instrument (as fraction, e.g. 20% is 0.2) |
System.Double | r | Risk-free interest rate (as fraction, e.g. 5% is 0.05) |
Returns
Type | Description |
---|---|
System.Double | The option's gamma |
PutDelta(Double, Double, Double, Double, Double)
Delta of an european-style PUT option, i.e. the derivative of the option's price with respect to price of the underlying instrument.
Declaration
public static double PutDelta(double S, double K, double T, double sigma, double r)
Parameters
Type | Name | Description |
---|---|---|
System.Double | S | Price of the underlying instrument |
System.Double | K | Strike price of the option |
System.Double | T | Time to expiration (in years) |
System.Double | sigma | Annual volatility of the underlying instrument (as fraction, e.g. 20% is 0.2) |
System.Double | r | Risk-free interest rate (as fraction, e.g. 5% is 0.05) |
Returns
Type | Description |
---|---|
System.Double | The option's delta |
PutImpliedVolatility(Double, Double, Double, Double, Double)
Calculate the annual implied volatility of an european PUT option given its price. (Value is returned as fraction, e.g. 0.2 is 20% volatility.)
Declaration
public static double PutImpliedVolatility(double S, double K, double T, double r, double P)
Parameters
Type | Name | Description |
---|---|---|
System.Double | S | Price of the underlying instrument |
System.Double | K | Strike price of the option |
System.Double | T | Time to expiration (in years) |
System.Double | r | Risk-free interest rate (as fraction, e.g. 5% is 0.05) |
System.Double | P | Price of the option |
Returns
Type | Description |
---|---|
System.Double | Implied volatility of the option |
Remarks
Solves numerically using Newton-Raphson method. Might fail if result would fall outside of 0-1000% range.
PutPrice(Double, Double, Double, Double, Double)
Price of an european-style PUT option.
Declaration
public static double PutPrice(double S, double K, double T, double sigma, double r)
Parameters
Type | Name | Description |
---|---|---|
System.Double | S | Price of the underlying instrument |
System.Double | K | Strike price of the option |
System.Double | T | Time to expiration (in years) |
System.Double | sigma | Annual volatility of the underlying instrument (as fraction, e.g. 20% is 0.2) |
System.Double | r | Risk-free interest rate (as fraction, e.g. 5% is 0.05) |
Returns
Type | Description |
---|---|
System.Double | The option's price |
PutRho(Double, Double, Double, Double, Double)
Rho of an european-style PUT option, i.e. the derivative of option price with respect to risk-free interest rate.
Declaration
public static double PutRho(double S, double K, double T, double sigma, double r)
Parameters
Type | Name | Description |
---|---|---|
System.Double | S | Price of the underlying instrument |
System.Double | K | Strike price of the option |
System.Double | T | Time to expiration (in years) |
System.Double | sigma | Annual volatility of the underlying instrument (as fraction, e.g. 20% is 0.2) |
System.Double | r | Risk-free interest rate (as fraction, e.g. 5% is 0.05) |
Returns
Type | Description |
---|---|
System.Double | The option's rho.
|
PutTheta(Double, Double, Double, Double, Double)
Theta of an european-style PUT option, i.e. the derivative of the option's price with respect to passage of time.
Declaration
public static double PutTheta(double S, double K, double T, double sigma, double r)
Parameters
Type | Name | Description |
---|---|---|
System.Double | S | Price of the underlying instrument |
System.Double | K | Strike price of the option |
System.Double | T | Time to expiration (in years) |
System.Double | sigma | Annual volatility of the underlying instrument (as fraction, e.g. 20% is 0.2) |
System.Double | r | Risk-free interest rate (as fraction, e.g. 5% is 0.05) |
Returns
Type | Description |
---|---|
System.Double | The option's theta.
|
Vega(Double, Double, Double, Double, Double)
Vega of an european-style option (same for CALL and PUT), i.e. the derivative of option price with respect to volatility.
Declaration
public static double Vega(double S, double K, double T, double sigma, double r)
Parameters
Type | Name | Description |
---|---|---|
System.Double | S | Price of the underlying instrument |
System.Double | K | Strike price of the option |
System.Double | T | Time to expiration (in years) |
System.Double | sigma | Annual volatility of the underlying instrument (as fraction, e.g. 20% is 0.2) |
System.Double | r | Risk-free interest rate (as fraction, e.g. 5% is 0.05) |
Returns
Type | Description |
---|---|
System.Double | The option's vega.
|
Vomma(Double, Double, Double, Double, Double)
Vomma (also known as "Volga") of an european-style option (same for CALL and PUT), i.e. the second-order derivative of option price with respect to volatility. It reflects the convexity of Vega.
Declaration
public static double Vomma(double S, double K, double T, double sigma, double r)
Parameters
Type | Name | Description |
---|---|---|
System.Double | S | Price of the underlying instrument |
System.Double | K | Strike price of the option |
System.Double | T | Time to expiration (in years) |
System.Double | sigma | Annual volatility of the underlying instrument (as fraction, e.g. 20% is 0.2) |
System.Double | r | Risk-free interest rate (as fraction, e.g. 5% is 0.05) |
Returns
Type | Description |
---|---|
System.Double | The option's Vomma.
|