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 QQ 的新实例, 仅用于一个基础资产( 非选项模式) 。

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

明确过期时刻。 如果无效, 则使用% 1 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)

用来计算选项 ro。

currentTime
现相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相
deviation
标准偏差。
assetPrice
基础资产价格.

返回值: 选项 ro。 如果值等于 , 那么目前无法计算值 。

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

计算选项Theta。

currentTime
现相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相
deviation
标准偏差。
assetPrice
基础资产价格.

返回值: 选项 seta。 如果值等于 , 那么目前无法计算值 。

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

To round to RoundDecimals.

value
初标相相相相相.

返回值: 圆相值.

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

计算选项 vega.

currentTime
现相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相
deviation
标准偏差。
assetPrice
基础资产价格.

返回值: 选项 vega。 如果值等于 , 那么目前无法计算值 。