BlackScholes

StockSharp.Algo.Derivatives

Модель расчета значений греков по формуле Блэка-Шоулза.

Реализует: IBlackScholes

Конструкторы

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

Базовый конструктор для унаследованных моделей.

dataProvider
Поставщик рыночных данных.
expirationTime
Явный момент истечения опциона. Если значение равно нулю, используется полночь ExpiryDate, если она доступна.
BlackScholes
public BlackScholes(Security option, Security underlyingAsset, IMarketDataProvider dataProvider, DateTime? expirationTime)
blackScholes = BlackScholes(option, underlyingAsset, dataProvider, expirationTime)

Инициализирует новый экземпляр BlackScholes для определенного опциона с его базовым активом.

option
Опционный контракт.
underlyingAsset
Базовый актив.
dataProvider
Поставщик рыночных данных.
expirationTime
Явный момент истечения опциона. Если значение равно нулю, используется полночь ExpiryDate, если она доступна.
BlackScholes
protected BlackScholes(Security underlyingAsset, IMarketDataProvider dataProvider, DateTime? expirationTime)
blackScholes = BlackScholes(underlyingAsset, dataProvider, expirationTime)

Инициализирует новый экземпляр BlackScholes только для базового актива (модели без опционов).

underlyingAsset
Базовый актив.
dataProvider
Поставщик рыночных данных.
expirationTime
Явный момент истечения опциона. Если значение равно нулю, используется полночь ExpiryDate, если она доступна.

Свойства

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

Поставщик рыночных данных.

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

Стандартное отклонение по умолчанию.

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

Размер дивидендов по акциям.

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

Если недействительно, то при наличии полуночи ExpiryDate используется.

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

Опционный контракт.

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

Тип опции.

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

Безрисковая процентная ставка.

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

Число десятичных мест при вычисляемых значениях. По умолчанию -1, что означает отсутствие округления значений.

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

Базовый актив.

Методы

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.

Возвращает: 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.

Возвращает: 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.

Возвращает: 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.

Возвращает: 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.

Возвращает: 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.

Возвращает: Option vega.

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

Вычислить параметр d1 оценки вероятности исполнения опциона.

deviation
Стандартное отклонение.
assetPrice
Цена базового актива.
timeToExp
Период опциона до истечения срока его действия.

Возвращает: Параметр d1.

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

Для расчета дельты опциона.

currentTime
Текущее время.
deviation
Стандартное отклонение.
assetPrice
Цена базового актива.

Возвращает: Опцион Дельта. Если значение равно , то расчет значения в настоящий момент невозможен.

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

Рассчитать вариант гаммы.

currentTime
Текущее время.
deviation
Стандартное отклонение.
assetPrice
Цена базового актива.

Возвращает: Вариант гамма. Если значение равно , то расчет значения в настоящий момент невозможен.

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

Чтобы получить цену базового актива.

assetPrice
Цена базового актива, если она указана.

Возвращает: Цена базового актива. Если значение равно , то расчет значения в настоящий момент невозможен.

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

Расчет времени до истечения срока действия.

currentTime
Текущее время.

Возвращает: Время, оставшееся до истечения срока действия. Если значение равно , то расчет значения в настоящий момент невозможен.

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.

Возвращает: 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.

Возвращает: 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.

Возвращает: 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.

Возвращает: 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.

Возвращает: 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)

Рассчитать опционную премию.

currentTime
Текущее время.
deviation
Стандартное отклонение.
assetPrice
Цена базового актива.

Возвращает: Опционная премия. Если значение равно , то расчет значения в настоящий момент невозможен.

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

Для расчета варианта ро.

currentTime
Текущее время.
deviation
Стандартное отклонение.
assetPrice
Цена базового актива.

Возвращает: Вариант ро. Если значение равно , то расчет значения в настоящий момент невозможен.

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

Для расчета опциона тета.

currentTime
Текущее время.
deviation
Стандартное отклонение.
assetPrice
Цена базового актива.

Возвращает: Вариант тета. Если значение равно , то расчет значения в настоящий момент невозможен.

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

Округлить до RoundDecimals.

value
Начальное значение.

Возвращает: Округленное значение.

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

Для расчета варианта Вега.

currentTime
Текущее время.
deviation
Стандартное отклонение.
assetPrice
Цена базового актива.

Возвращает: Вариант Вега. Если значение равно , то расчет значения в настоящий момент невозможен.