Table of Contents

Class BasketBlackScholes

Namespace
StockSharp.Algo.Derivatives
Assembly
StockSharp.Algo.dll

Portfolio model for calculating the values of Greeks by the Black-Scholes formula.

public class BasketBlackScholes : BlackScholes, IBlackScholes
Inheritance
BasketBlackScholes
Implements
Inherited Members
Extension Methods

Constructors

BasketBlackScholes(ISecurityProvider, IMarketDataProvider, IExchangeInfoProvider, IPositionProvider)

Initializes a new instance of the BasketBlackScholes.

public BasketBlackScholes(ISecurityProvider securityProvider, IMarketDataProvider dataProvider, IExchangeInfoProvider exchangeInfoProvider, IPositionProvider positionProvider)

Parameters

securityProvider ISecurityProvider

The provider of information about instruments.

dataProvider IMarketDataProvider

The market data provider.

exchangeInfoProvider IExchangeInfoProvider

Exchanges and trading boards provider.

positionProvider IPositionProvider

The position provider.

BasketBlackScholes(Security, IMarketDataProvider, IExchangeInfoProvider, IPositionProvider)

Initializes a new instance of the BasketBlackScholes.

public BasketBlackScholes(Security underlyingAsset, IMarketDataProvider dataProvider, IExchangeInfoProvider exchangeInfoProvider, IPositionProvider positionProvider)

Parameters

underlyingAsset Security

Underlying asset.

dataProvider IMarketDataProvider

The market data provider.

exchangeInfoProvider IExchangeInfoProvider

Exchanges and trading boards provider.

positionProvider IPositionProvider

The position provider.

Properties

InnerModels

Information about options.

public BasketBlackScholes.IInnerModelList InnerModels { get; }

Property Value

BasketBlackScholes.IInnerModelList

Option

Options contract.

public override Security Option { get; }

Property Value

Security

PositionProvider

The position provider.

public IPositionProvider PositionProvider { get; set; }

Property Value

IPositionProvider

RoundDecimals

The number of decimal places at calculated values. The default is -1, which means no values rounding.

public override int RoundDecimals { set; }

Property Value

int

UnderlyingAsset

Underlying asset.

public override Security UnderlyingAsset { get; }

Property Value

Security

Methods

Delta(DateTimeOffset, decimal?, decimal?)

To calculate the option delta.

public override decimal? Delta(DateTimeOffset currentTime, decimal? deviation = null, decimal? assetPrice = null)

Parameters

currentTime DateTimeOffset

The current time.

deviation decimal?

Standard deviation.

assetPrice decimal?

Underlying asset price.

Returns

decimal?

The option delta. If the value is equal to null, then the value calculation currently is impossible.

Gamma(DateTimeOffset, decimal?, decimal?)

To calculate the option gamma.

public override decimal? Gamma(DateTimeOffset currentTime, decimal? deviation = null, decimal? assetPrice = null)

Parameters

currentTime DateTimeOffset

The current time.

deviation decimal?

Standard deviation.

assetPrice decimal?

Underlying asset price.

Returns

decimal?

The option gamma. If the value is equal to null, then the value calculation currently is impossible.

ImpliedVolatility(DateTimeOffset, decimal)

To calculate the implied volatility.

public override decimal? ImpliedVolatility(DateTimeOffset currentTime, decimal premium)

Parameters

currentTime DateTimeOffset

The current time.

premium decimal

The option premium.

Returns

decimal?

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

Premium(DateTimeOffset, decimal?, decimal?)

To calculate the option premium.

public override decimal? Premium(DateTimeOffset currentTime, decimal? deviation = null, decimal? assetPrice = null)

Parameters

currentTime DateTimeOffset

The current time.

deviation decimal?

Standard deviation.

assetPrice decimal?

Underlying asset price.

Returns

decimal?

The option premium. If the value is equal to null, then the value calculation currently is impossible.

Rho(DateTimeOffset, decimal?, decimal?)

To calculate the option rho.

public override decimal? Rho(DateTimeOffset currentTime, decimal? deviation = null, decimal? assetPrice = null)

Parameters

currentTime DateTimeOffset

The current time.

deviation decimal?

Standard deviation.

assetPrice decimal?

Underlying asset price.

Returns

decimal?

The option rho. If the value is equal to null, then the value calculation currently is impossible.

Theta(DateTimeOffset, decimal?, decimal?)

To calculate the option theta.

public override decimal? Theta(DateTimeOffset currentTime, decimal? deviation = null, decimal? assetPrice = null)

Parameters

currentTime DateTimeOffset

The current time.

deviation decimal?

Standard deviation.

assetPrice decimal?

Underlying asset price.

Returns

decimal?

The option theta. If the value is equal to null, then the value calculation currently is impossible.

Vega(DateTimeOffset, decimal?, decimal?)

To calculate the option vega.

public override decimal? Vega(DateTimeOffset currentTime, decimal? deviation = null, decimal? assetPrice = null)

Parameters

currentTime DateTimeOffset

The current time.

deviation decimal?

Standard deviation.

assetPrice decimal?

Underlying asset price.

Returns

decimal?

The option vega. If the value is equal to null, then the value calculation currently is impossible.