Show / Hide Table of Contents

Class BlackScholesEuropeanOptionsFunctions

Set of static functions for Black-Scholes model calculations for european-style options.

Inheritance
System.Object
BlackScholesEuropeanOptionsFunctions
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.
Important: The value returned is the raw value of the derivative of option price with respect to risk-free rate. To get Rho value per the conventional definition ("per 1% of rate change"), divide the result by 100.

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.
Important: The value is the raw value of the derivative of option price with respect to time. To get Theta value per the conventional definition ("decay per 1 day"), divide the result by 365. Additionally, the value will be positive for long positions because T decreases as time moves forward, therefore conventional understanding of Theta requires multiplication by -1.

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.
Important: The value returned is the raw value of the derivative of option price with respect to risk-free rate. To get Rho value per the conventional definition ("per 1% of rate change"), divide the result by 100.

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.
Important: The value is the raw value of the derivative of option price with respect to time. To get Theta value per the conventional definition ("decay per 1 day"), divide the result by 365. Additionally, the value will be positive for long positions because T decreases as time moves forward, therefore conventional understanding of Theta requires multiplication by -1.

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.
Important: The value is the raw value of the derivative of option price with respect to volatility. To get Vega value per the conventional definition ("per 1% of volatility change"), divide the result by 100.

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.
Important: The value is the raw value of the second-order derivative of option price with respect to volatility. To get Vomma value per the conventional definition ("per 1% of volatility change"), divide the result by 100.

☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾