Skip to content

ISecurityPrice

QuantConnect.Interfaces.ISecurityPrice

Reduced interface which allows setting and accessing price properties for a Security

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

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