Skip to content

IndicatorDataPoint

QuantConnect.Indicators.IndicatorDataPoint

IndicatorDataPoint(
    symbol: Union[Symbol, str, BaseContract, Security],
    time: Union[datetime, date],
    value: float,
)
IndicatorDataPoint()
IndicatorDataPoint(
    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 instance of the DataPoint type using the specified time/data

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

Parameters:

Name Type Description Default
symbol Optional[Union[Symbol, str, BaseContract, Security]]

The symbol associated with this data

None
time Optional[Union[datetime, date]]

The time this data was produced

None
value Optional[float]

The 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 Field is protected.

DAILY_RESOLUTION

DAILY_RESOLUTION: List[Resolution] = ...

A list of Resolution.DAILY

This Field is protected.

MINUTE_RESOLUTION

MINUTE_RESOLUTION: List[Resolution] = ...

A list of Resolution.MINUTE

This Field is protected.

HIGH_RESOLUTION

HIGH_RESOLUTION: List[Resolution] = ...

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

This Field is protected.

OPTION_RESOLUTIONS

OPTION_RESOLUTIONS: List[Resolution] = ...

A list of resolutions support by Options

This Field is protected.

is_fill_forward

is_fill_forward: bool

True if this is a fill forward piece of data

__add__

__add__(other: IndicatorDataPoint) -> float
__add__(other: float) -> float

__ge__

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

__gt__

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

__float__

__float__() -> float

__le__

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

__lt__

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

__mul__

__mul__(other: IndicatorDataPoint) -> float
__mul__(other: float) -> float

__sub__

__sub__(other: IndicatorDataPoint) -> float
__sub__(other: float) -> float

__truediv__

__truediv__(other: IndicatorDataPoint) -> float
__truediv__(other: float) -> float

compare_to

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

Signature descriptions:

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

  • 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.

Parameters:

Name Type Description Default
other Optional[IndicatorDataPoint]

An object to compare with this object.

None
obj Optional[Any]

An object to compare with this instance.

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 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.]; Case 2: [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.]

equals

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

Signature descriptions:

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

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

Parameters:

Name Type Description Default
other Optional[IndicatorDataPoint]

An object to compare with this object.

None
obj Optional[Any]

Another object to compare to.

None

Returns:

Type Description
bool

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

__int__

__int__() -> int

__neg__

__neg__() -> float

__radd__

__radd__(other: float) -> float

__rmul__

__rmul__(other: float) -> float

__rsub__

__rsub__(other: float) -> float

__rtruediv__

__rtruediv__(other: float) -> float

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.

protobuf_serialize

protobuf_serialize(guid: Guid) -> List[int]
protobuf_serialize(stream: Stream) -> None

Serialize a base data instance using protobuf

Parameters:

Name Type Description Default
guid Optional[Guid]

Unique guid

None
stream Optional[Stream]

The destination stream

None

Returns:

Type Description
Optional[List[int]]

The resulting byte array.

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) -> Sequence[BaseData]

Deserialize the message from the data server

Parameters:

Name Type Description Default
serialized str

The data server's message

required

Returns:

Type Description
Sequence[BaseData]

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

get_update_price_scale_frontier

get_update_price_scale_frontier() -> datetime

Helper method to determine if price scales need an update based on the given data point

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.

normalize

normalize(
    factor: float,
    normalization_mode: DataNormalizationMode,
    sum_of_dividends: float,
) -> BaseData

Normalize prices based on configuration

Parameters:

Name Type Description Default
factor float

Price scale

required
normalization_mode DataNormalizationMode

The price scaling normalization mode

required
sum_of_dividends float

The current dividend sum

required

Returns:

Type Description
BaseData

The provided data point adjusted.

scale

scale(
    factor_func: Callable[[float, float, float], float],
    volume_factor: float,
    factor: float,
    sum_of_dividends: float,
) -> BaseData

Scale data based on factor function

Parameters:

Name Type Description Default
factor_func Callable[[float, float, float], float]

Function to factor prices by

required
volume_factor float

Factor to multiply volume/askSize/bidSize/quantity by

required
factor float

Price scale

required
sum_of_dividends float

The current dividend sum

required

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