BlackScholes

StockSharp.Algo.Derivatives

El modelo para calcular los valores griegos por la fórmula Black-Scholes.

Implementa: IBlackScholes

Constructores

BlackScholes
protected BlackScholes(IMarketDataProvider dataProvider, DateTime? expirationTime)
blackScholes = BlackScholes(dataProvider, expirationTime)

Constructor de base para modelos heredados.

dataProvider
El proveedor de datos del mercado.
expirationTime
Explicit option expiration moment. Si null, la medianoche de ExpiryDate se utiliza cuando está disponible.
BlackScholes
public BlackScholes(Security option, Security underlyingAsset, IMarketDataProvider dataProvider, DateTime? expirationTime)
blackScholes = BlackScholes(option, underlyingAsset, dataProvider, expirationTime)

Inicia una nueva instancia de BlackScholes@ para una opción específica con su activo subyacente.

option
Contrato de opciones.
underlyingAsset
Activo subyacente.
dataProvider
El proveedor de datos del mercado.
expirationTime
Explicit option expiration moment. Si null, la medianoche de ExpiryDate se utiliza cuando está disponible.
BlackScholes
protected BlackScholes(Security underlyingAsset, IMarketDataProvider dataProvider, DateTime? expirationTime)
blackScholes = BlackScholes(underlyingAsset, dataProvider, expirationTime)

Inicia una nueva instancia de BlackScholes para un activo subyacente (modelos no operativos).

underlyingAsset
Activo subyacente.
dataProvider
El proveedor de datos del mercado.
expirationTime
Explicit option expiration moment. Si null, la medianoche de ExpiryDate se utiliza cuando está disponible.

Propiedades

DataProvider
public virtual IMarketDataProvider DataProvider { get; }
value = blackScholes.DataProvider

El proveedor de datos del mercado.

DefaultDeviation
public decimal? DefaultDeviation { get; }
value = blackScholes.DefaultDeviation

La desviación estándar por defecto.

Dividend
public virtual decimal Dividend { get; set; }
value = blackScholes.Dividend
blackScholes.Dividend = value

El importe de dividendo en acciones.

ExpirationTime
public virtual DateTime? ExpirationTime { get; set; }
value = blackScholes.ExpirationTime
blackScholes.ExpirationTime = value

Explicit expiration moment. Si null, la medianoche de ExpiryDate se utiliza cuando está disponible.

Option
public virtual Security Option { get; }
value = blackScholes.Option

Contrato de opciones.

OptionType
protected OptionTypes OptionType { get; }
value = blackScholes.OptionType

Tipo de opción.

RiskFree
public decimal RiskFree { get; set; }
value = blackScholes.RiskFree
blackScholes.RiskFree = value

La tasa de interés libre de riesgo.

RoundDecimals
public virtual int RoundDecimals { get; set; }
value = blackScholes.RoundDecimals
blackScholes.RoundDecimals = value

El número de lugares decimales a valores calculados. El valor predeterminado es -1, lo que significa que no hay redondeo de valores.

UnderlyingAsset
public virtual Security UnderlyingAsset { get; set; }
value = blackScholes.UnderlyingAsset
blackScholes.UnderlyingAsset = value

Activo subyacente.

Métodos

CalcDelta
protected virtual decimal CalcDelta(decimal deviation, decimal assetPrice, double timeToExp)
result = blackScholes.CalcDelta(deviation, assetPrice, timeToExp)

To calculate the option delta from resolved inputs, before rounding.

deviation
Standard deviation.
assetPrice
Underlying asset price.
timeToExp
The option period before the expiration.

Devuelve: Option delta.

CalcGamma
protected virtual decimal CalcGamma(decimal deviation, decimal assetPrice, double timeToExp)
result = blackScholes.CalcGamma(deviation, assetPrice, timeToExp)

To calculate the option gamma from resolved inputs, before rounding.

deviation
Standard deviation.
assetPrice
Underlying asset price.
timeToExp
The option period before the expiration.

Devuelve: Option gamma.

CalcPremium
protected virtual decimal CalcPremium(decimal deviation, decimal assetPrice, double timeToExp)
result = blackScholes.CalcPremium(deviation, assetPrice, timeToExp)

To calculate the option premium from the model inputs already resolved by Decimal}).

deviation
Standard deviation.
assetPrice
Underlying asset price.
timeToExp
The option period before the expiration.

Devuelve: The option premium.

CalcRho
protected virtual decimal CalcRho(decimal deviation, decimal assetPrice, double timeToExp)
result = blackScholes.CalcRho(deviation, assetPrice, timeToExp)

To calculate the option rho from resolved inputs, before rounding.

deviation
Standard deviation.
assetPrice
Underlying asset price.
timeToExp
The option period before the expiration.

Devuelve: Option rho.

CalcTheta
protected virtual decimal CalcTheta(decimal deviation, decimal assetPrice, double timeToExp)
result = blackScholes.CalcTheta(deviation, assetPrice, timeToExp)

To calculate the option theta from resolved inputs, before rounding.

deviation
Standard deviation.
assetPrice
Underlying asset price.
timeToExp
The option period before the expiration.

Devuelve: Option theta.

CalcVega
protected virtual decimal CalcVega(decimal deviation, decimal assetPrice, double timeToExp)
result = blackScholes.CalcVega(deviation, assetPrice, timeToExp)

To calculate the option vega from resolved inputs, before rounding.

deviation
Standard deviation.
assetPrice
Underlying asset price.
timeToExp
The option period before the expiration.

Devuelve: Option vega.

D1
protected virtual double D1(decimal deviation, decimal assetPrice, double timeToExp)
result = blackScholes.D1(deviation, assetPrice, timeToExp)

Para calcular el parámetro d1 de la estimación de probabilidad de realización de la opción.

deviation
Desviación estándar.
assetPrice
Precio de activos subyacente.
timeToExp
El período de opción antes de la expiración.

Devuelve: El parámetro d1.

Delta
public virtual decimal? Delta(DateTime currentTime, decimal? deviation, decimal? assetPrice)
result = blackScholes.Delta(currentTime, deviation, assetPrice)

Para calcular la opción delta.

currentTime
El momento actual.
deviation
Desviación estándar.
assetPrice
Precio de activos subyacente.

Devuelve: La opción delta. Si el valor es igual a , entonces el cálculo de valor actualmente es imposible.

Gamma
public virtual decimal? Gamma(DateTime currentTime, decimal? deviation, decimal? assetPrice)
result = blackScholes.Gamma(currentTime, deviation, assetPrice)

Para calcular la gamma de opción.

currentTime
El momento actual.
deviation
Desviación estándar.
assetPrice
Precio de activos subyacente.

Devuelve: La opción gamma. Si el valor es igual a , entonces el cálculo de valor actualmente es imposible.

GetAssetPrice
public decimal? GetAssetPrice(decimal? assetPrice)
result = blackScholes.GetAssetPrice(assetPrice)

Para obtener el precio del activo subyacente.

assetPrice
El precio del activo subyacente si se especifica.

Devuelve: El precio del activo subyacente. Si el valor es igual a , entonces el cálculo de valor actualmente es imposible.

GetExpirationTimeLine
public virtual double? GetExpirationTimeLine(DateTime currentTime)
result = blackScholes.GetExpirationTimeLine(currentTime)

El tiempo antes del cálculo de caducidad.

currentTime
El momento actual.

Devuelve: El tiempo restante hasta la expiración. Si el valor es igual a , entonces el cálculo de valor actualmente es imposible.

GetInputs
protected ValueTuple<decimal, decimal, double>? GetInputs(DateTime currentTime, decimal? deviation, decimal? assetPrice)
result = blackScholes.GetInputs(currentTime, deviation, assetPrice)

What every value of the model is computed from: the deviation the caller gives or the one quoted, the asset price the caller gives or the last trade, and the time left to expiry.

currentTime
The current time.
deviation
The standard deviation, or for the quoted one.
assetPrice
The price of the underlying asset, or for its last trade.

Devuelve: The inputs, or when one of them is not known.

ImpliedVolatility
public virtual decimal? ImpliedVolatility(DateTime currentTime, decimal premium, decimal? assetPrice)
result = blackScholes.ImpliedVolatility(currentTime, premium, assetPrice)

To calculate the implied volatility.

currentTime
The current time.
premium
The option premium.
assetPrice
Underlying asset price.

Devuelve: The implied volatility. If the value is equal to , then the value calculation currently is impossible.

IsExpired
internal bool IsExpired(DateTime currentTime)
result = blackScholes.IsExpired(currentTime)

Whether the option has expired by the given moment, as the model takes its expiry.

currentTime
The current time.

Devuelve: when the expiry is known and is not later than .

Payoff
internal decimal? Payoff(decimal? assetPrice)
result = blackScholes.Payoff(assetPrice)

What the option pays at its expiry, before rounding: its intrinsic value at the price of the underlying asset.

assetPrice
The price of the underlying asset if it is specified.

Devuelve: The payoff. If the value is equal to , then the price of the underlying asset is unknown.

PayoffDelta
internal decimal? PayoffDelta(decimal? assetPrice)
result = blackScholes.PayoffDelta(assetPrice)

The slope of what the option pays at its expiry: the asset it delivers, one for one while it is in the money.

assetPrice
The price of the underlying asset if it is specified.

Devuelve: The delta of the payoff. If the value is equal to , then the price of the underlying asset is unknown.

Premium
public virtual decimal? Premium(DateTime currentTime, decimal? deviation, decimal? assetPrice)
result = blackScholes.Premium(currentTime, deviation, assetPrice)

Para calcular la prima de opción.

currentTime
El momento actual.
deviation
Desviación estándar.
assetPrice
Precio de activos subyacente.

Devuelve: La prima de opción. Si el valor es igual a , entonces el cálculo de valor actualmente es imposible.

Rho
public virtual decimal? Rho(DateTime currentTime, decimal? deviation, decimal? assetPrice)
result = blackScholes.Rho(currentTime, deviation, assetPrice)

Para calcular la opción rho.

currentTime
El momento actual.
deviation
Desviación estándar.
assetPrice
Precio de activos subyacente.

Devuelve: La opción rho. Si el valor es igual a , entonces el cálculo de valor actualmente es imposible.

Theta
public virtual decimal? Theta(DateTime currentTime, decimal? deviation, decimal? assetPrice)
result = blackScholes.Theta(currentTime, deviation, assetPrice)

Para calcular la opción theta.

currentTime
El momento actual.
deviation
Desviación estándar.
assetPrice
Precio de activos subyacente.

Devuelve: La opción theta. Si el valor es igual a , entonces el cálculo de valor actualmente es imposible.

TryRound
protected decimal? TryRound(decimal? value)
result = blackScholes.TryRound(value)

A la vuelta a RoundDecimals@.

value
El valor inicial.

Devuelve: El valor redondeado.

Vega
public virtual decimal? Vega(DateTime currentTime, decimal? deviation, decimal? assetPrice)
result = blackScholes.Vega(currentTime, deviation, assetPrice)

Para calcular la opción vega.

currentTime
El momento actual.
deviation
Desviación estándar.
assetPrice
Precio de activos subyacente.

Devuelve: La opción vega. Si el valor es igual a , entonces el cálculo de valor actualmente es imposible.