Skip to content

IOptionPrice

QuantConnect.Interfaces.IOptionPrice

Bases: ISecurityPrice

Reduced interface for accessing Option specific price properties and methods

underlying

underlying: ISecurityPrice

Gets a reduced interface of the underlying security object.

price

price: float

Get the current value of the security.

close

close: float

If this uses trade bar data, return the most recent close.

volume

volume: float

Access to the volume of the equity today

bid_price

bid_price: float

Gets the most recent bid price if available

bid_size

bid_size: float

Gets the most recent bid size if available

ask_price

ask_price: float

Gets the most recent ask price if available

ask_size

ask_size: float

Gets the most recent ask size if available

open_interest

open_interest: int

Access to the open interest of the security today

symbol

symbol: Symbol

symbol for the asset.

symbol_properties

symbol_properties: SymbolProperties

symbol_properties of the symbol

evaluate_price_model

evaluate_price_model(
    slice: Slice, contract: OptionContract
) -> OptionPriceModelResult

Evaluates the specified option contract to compute a theoretical price, IV and greeks

Parameters:

Name Type Description Default
slice Slice

The current data slice. This can be used to access other information available to the algorithm

required
contract OptionContract

The option contract to evaluate

required

Returns:

Type Description
OptionPriceModelResult

An instance of OptionPriceModelResult containing the theoretical price of the specified option contract.

get_last_data

get_last_data() -> BaseData

Get the last price update set to the security.

Returns:

Type Description
BaseData

BaseData object for this security.

set_market_price

set_market_price(data: BaseData) -> None

Update any security properties based on the latest market data and time

Parameters:

Name Type Description Default
data BaseData

New data packet from LEAN

required

update

update(
    data: Sequence[BaseData],
    data_type: Type,
    contains_fill_forward_data: Optional[bool],
    is_internal_config: bool,
) -> None

Updates all of the security properties, such as price/OHLCV/bid/ask based on the data provided. Data is also stored into the security's data cache

Parameters:

Name Type Description Default
data Sequence[BaseData]

The security update data

required
data_type Type

The data type

required
contains_fill_forward_data Optional[bool]

Flag indicating whether True if this update data corresponds to an internal subscription such as currency or security benchmarkdata contains any fill forward bar or not

required
is_internal_config bool

True if this update data corresponds to an internal subscription such as currency or security benchmark

required