BasketBlackScholes
Portfolio model for calculating the values of Greeks by the Black-Scholes formula.
Inherits: BlackScholes
Constructors
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.
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
public IInnerModelList InnerModels { get; }
value = basketBlackScholes.InnerModels
Information about options.
public IPositionProvider PositionProvider { get; set; }
value = basketBlackScholes.PositionProvider
basketBlackScholes.PositionProvider = value
The position provider.
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.
public override Security UnderlyingAsset { get; }
value = basketBlackScholes.UnderlyingAsset
Underlying asset.
Methods
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.
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.
public override decimal? ImpliedVolatility(DateTime currentTime, decimal premium)
result = basketBlackScholes.ImpliedVolatility(currentTime, premium)
To calculate the implied volatility.
- currentTime
- The current time.
- premium
- The option premium.
Returns: The implied volatility. If the value is equal to , then the value calculation currently is impossible.
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.
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.
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.
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.