BasketBlackScholes

StockSharp.Algo.Derivatives

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

Inherits: BlackScholes

Constructors

BasketBlackScholes
public BasketBlackScholes(IMarketDataProvider dataProvider, IPositionProvider positionProvider, DateTime? expirationTime)
basketBlackScholes = BasketBlackScholes(dataProvider, positionProvider, expirationTime)

Initializes a new instance of the BasketBlackScholes.

dataProvider
The market data provider.
positionProvider
The position provider.
expirationTime
Explicit options expiration moment for the whole basket. If null, models' own settings are used.
BasketBlackScholes
public BasketBlackScholes(Security underlyingAsset, IMarketDataProvider dataProvider, IPositionProvider positionProvider, DateTime? expirationTime)
basketBlackScholes = BasketBlackScholes(underlyingAsset, dataProvider, positionProvider, expirationTime)

Initializes a new instance of the BasketBlackScholes with explicit underlying.

underlyingAsset
Underlying asset.
dataProvider
The market data provider.
positionProvider
The position provider.
expirationTime
Explicit options expiration moment for the whole basket.

Properties

ExpirationTime
public override DateTime? ExpirationTime { get; set; }
value = basketBlackScholes.ExpirationTime
basketBlackScholes.ExpirationTime = value

Explicit expiration moment. If null, ExpiryDate is used when available: with its time of day, or at the board's expiry time for a date alone.

InnerModels
public IInnerModelList InnerModels { get; }
value = basketBlackScholes.InnerModels

Information about options.

Option
public override Security Option { get; }
value = basketBlackScholes.Option

Options contract.

PositionProvider
public IPositionProvider PositionProvider { get; set; }
value = basketBlackScholes.PositionProvider
basketBlackScholes.PositionProvider = value

The position provider.

RoundDecimals
public override int RoundDecimals { set; }
basketBlackScholes.RoundDecimals = value

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

UnderlyingAsset
public override Security UnderlyingAsset { get; }
value = basketBlackScholes.UnderlyingAsset

Underlying asset.

Methods

Delta
public override decimal? Delta(DateTime currentTime, decimal? deviation, decimal? assetPrice)
result = basketBlackScholes.Delta(currentTime, deviation, assetPrice)

To calculate the option delta.

currentTime
The current time.
deviation
Standard deviation.
assetPrice
Underlying asset price.

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

Gamma
public override decimal? Gamma(DateTime currentTime, decimal? deviation, decimal? assetPrice)
result = basketBlackScholes.Gamma(currentTime, deviation, assetPrice)

To calculate the option gamma.

currentTime
The current time.
deviation
Standard deviation.
assetPrice
Underlying asset price.

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

GetExpirationTimeLine
public override double? GetExpirationTimeLine(DateTime currentTime)
result = basketBlackScholes.GetExpirationTimeLine(currentTime)

The time before expiration calculation.

currentTime
The current time.

Returns: The time remaining until expiration. If the value is equal to , then the value calculation currently is impossible.

ImpliedVolatility
public override decimal? ImpliedVolatility(DateTime currentTime, decimal premium, decimal? assetPrice)
result = basketBlackScholes.ImpliedVolatility(currentTime, premium, assetPrice)

To calculate the implied volatility.

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

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

Premium
public override decimal? Premium(DateTime currentTime, decimal? deviation, decimal? assetPrice)
result = basketBlackScholes.Premium(currentTime, deviation, assetPrice)

To calculate the option premium.

currentTime
The current time.
deviation
Standard deviation.
assetPrice
Underlying asset price.

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

ProcessOptions
private decimal? ProcessOptions(Func<BlackScholes, decimal?> func)
result = basketBlackScholes.ProcessOptions(func)

To sum a value over the options of the basket, each weighted by the position in it.

func
The value of one option.

Returns: The sum; when an option the book holds cannot be valued, for the sum of the others is not the book's.

Rho
public override decimal? Rho(DateTime currentTime, decimal? deviation, decimal? assetPrice)
result = basketBlackScholes.Rho(currentTime, deviation, assetPrice)

To calculate the option rho.

currentTime
The current time.
deviation
Standard deviation.
assetPrice
Underlying asset price.

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

Theta
public override decimal? Theta(DateTime currentTime, decimal? deviation, decimal? assetPrice)
result = basketBlackScholes.Theta(currentTime, deviation, assetPrice)

To calculate the option theta.

currentTime
The current time.
deviation
Standard deviation.
assetPrice
Underlying asset price.

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

Vega
public override decimal? Vega(DateTime currentTime, decimal? deviation, decimal? assetPrice)
result = basketBlackScholes.Vega(currentTime, deviation, assetPrice)

To calculate the option vega.

currentTime
The current time.
deviation
Standard deviation.
assetPrice
Underlying asset price.

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