Skip to content

IndicatorDataPoint

QuantConnect.Indicators.IndicatorDataPoint

IndicatorDataPoint()
IndicatorDataPoint(
    time: Union[datetime, date], value: float
)
IndicatorDataPoint(
    symbol: Union[Symbol, str, BaseContract],
    time: Union[datetime, date],
    value: float,
)

Bases: BaseData, IEquatable[QuantConnect_Indicators_IndicatorDataPoint], IComparable[QuantConnect_Indicators_IndicatorDataPoint]

Represents a piece of data at a specific time

Signature descriptions:

  • Initializes a new default instance of IndicatorDataPoint with a time of DateTime.MinValue and a Value of 0m.

  • Initializes a new instance of the DataPoint type using the specified time/data

Parameters:

Name Type Description Default
time Optional[Union[datetime, date]]

The time this data was produced

None
value Optional[float]

The data

None
symbol Optional[Union[Symbol, str, BaseContract]]

The symbol associated with this data

None

symbol

symbol: Symbol

Symbol representation for underlying Security

data_type

data_type: MarketDataType

Market Data Type of this data - does it come in individual price packets or is it grouped into OHLC.

time

time: datetime

Current time marker of this data packet.

end_time

end_time: datetime

The end time of this data. Some data covers spans (trade bars) and as such we want to know the entire time span covered

value

value: float

Value representation of this data packet. All data requires a representative value for this moment in time. For streams of data this is the price now, for OHLC packets this is the closing price.

price

price: float

As this is a backtesting platform we'll provide an alias of value as price.

ALL_RESOLUTIONS

ALL_RESOLUTIONS: List[Resolution] = ...

A list of all Resolution

This codeEntityType is protected.

DAILY_RESOLUTION

DAILY_RESOLUTION: List[Resolution] = ...

A list of Resolution.DAILY

This codeEntityType is protected.

MINUTE_RESOLUTION

MINUTE_RESOLUTION: List[Resolution] = ...

A list of Resolution.MINUTE

This codeEntityType is protected.

HIGH_RESOLUTION

HIGH_RESOLUTION: List[Resolution] = ...

A list of high Resolution, including minute, second, and tick.

This codeEntityType is protected.

OPTION_RESOLUTIONS

OPTION_RESOLUTIONS: List[Resolution] = ...

A list of resolutions support by Options

This codeEntityType is protected.

is_fill_forward

is_fill_forward: bool

True if this is a fill forward piece of data

__ge__

__ge__(other: Any) -> bool
__ge__(other: IndicatorDataPoint) -> bool

__gt__

__gt__(other: Any) -> bool
__gt__(other: IndicatorDataPoint) -> bool

__le__

__le__(other: Any) -> bool
__le__(other: IndicatorDataPoint) -> bool

__lt__

__lt__(other: Any) -> bool
__lt__(other: IndicatorDataPoint) -> bool

compare_to

compare_to(obj: Any) -> int
compare_to(other: IndicatorDataPoint) -> int

Signature descriptions:

  • Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

  • Compares the current object with another object of the same type.

Parameters:

Name Type Description Default
obj Optional[Any]

An object to compare with this instance.

None
other Optional[IndicatorDataPoint]

An object to compare with this object.

None

Returns:

Type Description
int

Depends on the signature used. Case 1: [A value that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes obj in the sort order. Zero This instance occurs in the same position in the sort order as obj. Greater than zero This instance follows obj in the sort order.]; Case 2: [A value that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the other parameter.Zero This object is equal to other. Greater than zero This object is greater than other.]

equals

equals(obj: Any) -> bool
equals(other: IndicatorDataPoint) -> bool

Signature descriptions:

  • Indicates whether this instance and a specified object are equal.

  • Indicates whether the current object is equal to another object of the same type.

Parameters:

Name Type Description Default
obj Optional[Any]

Another object to compare to.

None
other Optional[IndicatorDataPoint]

An object to compare with this object.

None

Returns:

Type Description
bool

Depends on the signature used. Case 1: [true if obj and this instance are the same type and represent the same value; otherwise, false.]; Case 2: [true if the current object is equal to the other parameter; otherwise, false.]

get_hash_code

get_hash_code() -> int

Returns the hash code for this instance.

Returns:

Type Description
int

A 32-bit signed integer that is the hash code for this instance.

get_source

get_source(
    config: SubscriptionDataConfig,
    date: datetime,
    is_live_mode: bool,
) -> SubscriptionDataSource

This function is purposefully not implemented.

reader

reader(
    config: SubscriptionDataConfig,
    line: str,
    date: datetime,
    is_live_mode: bool,
) -> BaseData

This function is purposefully not implemented.

to_string

to_string() -> str

Returns a string representation of this DataPoint instance using ISO8601 formatting for the date

Returns:

Type Description
str

A System.String containing a fully qualified type name.

clone

clone(fill_forward: bool) -> BaseData
clone() -> BaseData

Return a new instance clone of this object, used in fill forward

Parameters:

Name Type Description Default
fill_forward Optional[bool]

True if this is a fill forward clone

None

Returns:

Type Description
BaseData

A clone of the current object.

requires_mapping

requires_mapping() -> bool

Indicates if there is support for mapping

Returns:

Type Description
bool

True indicates mapping should be used.

data_time_zone

data_time_zone() -> Any

Specifies the data time zone for this data type. This is useful for custom data types

Returns:

Type Description
Any

The DateTimeZone of this data type.

default_resolution

default_resolution() -> Resolution

Gets the default resolution for this data and security type

deserialize_message

deserialize_message(serialized: str) -> Iterable[BaseData]

Deserialize the message from the data server

Parameters:

Name Type Description Default
serialized str

The data server's message

required

Returns:

Type Description
Iterable[BaseData]

An enumerable of base data, if unsuccessful, returns an empty enumerable.

is_sparse_data

is_sparse_data() -> bool

Indicates that the data set is expected to be sparse

Returns:

Type Description
bool

True if the data set represented by this type is expected to be sparse.

should_cache_to_security

should_cache_to_security() -> bool

Indicates whether this contains data that should be stored in the security cache

Returns:

Type Description
bool

Whether this contains data that should be stored in the security cache.

supported_resolutions

supported_resolutions() -> List[Resolution]

Gets the supported resolution for this data and security type

update

update(
    last_trade: float,
    bid_price: float,
    ask_price: float,
    volume: float,
    bid_size: float,
    ask_size: float,
) -> None

Update routine to build a bar/tick from a data update.

Parameters:

Name Type Description Default
last_trade float

The last trade price

required
bid_price float

Current bid price

required
ask_price float

Current asking price

required
volume float

Volume of this trade

required
bid_size float

The size of the current bid, if available

required
ask_size float

The size of the current ask, if available

required

update_ask

update_ask(ask_price: float, ask_size: float) -> None

Updates this base data with the new quote ask information

Parameters:

Name Type Description Default
ask_price float

The current ask price

required
ask_size float

The current ask size

required

update_bid

update_bid(bid_price: float, bid_size: float) -> None

Updates this base data with the new quote bid information

Parameters:

Name Type Description Default
bid_price float

The current bid price

required
bid_size float

The current bid size

required

update_quote

update_quote(
    bid_price: float,
    bid_size: float,
    ask_price: float,
    ask_size: float,
) -> None

Updates this base data with new quote information

Parameters:

Name Type Description Default
bid_price float

The current bid price

required
bid_size float

The current bid size

required
ask_price float

The current ask price

required
ask_size float

The current ask size

required

update_trade

update_trade(last_trade: float, trade_size: float) -> None

Updates this base data with a new trade

Parameters:

Name Type Description Default
last_trade float

The price of the last trade

required
trade_size float

The quantity traded

required