BlackScholes<T>

Models & Types · AiDotNet.Finance.Options

Closed-form Black-Scholes-Merton European option pricing, the full first-order Greeks (delta, gamma, vega, theta, rho) and implied-volatility solve.

Implements: IOptionPricer<T>

For Beginners

The Black-Scholes formula gives the fair price of a European call or put option from five inputs: the current price (spot), the strike, time to expiry (in years), the risk-free interest rate, and the volatility. The “Greeks” are its sensitivities — delta (price vs. spot), gamma (delta vs. spot), vega (price vs. volatility), theta (price vs. time), rho (price vs. rate) — which traders use to size positions and hedge risk.

How It Works

AiDotNet ships BlackScholesEquation — the PDE residual for a PINN solver — but no analytic pricer. This is the cheap, exact closed form for European options: pricing + Greeks in O(1) with no training, which is what trading/sizing/hedging actually needs. Feed a GARCH / forecast volatility in as volatility.

Constructors

Constructor Summary
BlackScholes()

Properties

Property Summary
IOptionPricer<T> Default { get; } Shared stateless default instance for injection as an IOptionPricer.

Methods

Method Summary
T Delta(T spot, T strike, T timeToExpiry, T riskFreeRate, T volatility, bool isCall) Delta — ∂Price/∂Spot.
T Gamma(T spot, T strike, T timeToExpiry, T riskFreeRate, T volatility) Gamma — ∂²Price/∂Spot² (same for calls and puts): φ(d1) / (S·σ·√T).
T ImpliedVolatility(T marketPrice, T spot, T strike, T timeToExpiry, T riskFreeRate, bool isCall, int maxIterations, double tolerance) Implied volatility from a market option price, via Newton-Raphson seeded with Brenner-Subrahmanyam, falling back to bisection if a Newton step leaves the bracket.
T Price(T spot, T strike, T timeToExpiry, T riskFreeRate, T volatility, bool isCall) Black-Scholes price of a European call (isCall = true) or put.
T Rho(T spot, T strike, T timeToExpiry, T riskFreeRate, T volatility, bool isCall) Rho — ∂Price/∂r (per 1.0 of rate).
T Theta(T spot, T strike, T timeToExpiry, T riskFreeRate, T volatility, bool isCall) Theta — ∂Price/∂t (per year; typically negative).
T Vega(T spot, T strike, T timeToExpiry, T riskFreeRate, T volatility) Vega — ∂Price/∂σ (per 1.0 of vol, same for calls and puts): S·φ(d1)·√T.