Skip to content

Series

QuantConnect.Series

Series()
Series(name: str)
Series(name: str, type: SeriesType, index: int)
Series(name: str, type: SeriesType, index: int, unit: str)
Series(name: str, type: SeriesType = ..., unit: str = '$')
Series(
    name: str, type: SeriesType, unit: str, color: Color
)
Series(
    name: str,
    type: SeriesType,
    unit: str,
    color: Color,
    symbol: ScatterMarkerSymbol = ...,
)

Bases: BaseSeries

Chart Series Object - Series data and properties for a chart:

Signature descriptions:

  • Default constructor for chart series

  • Constructor method for Chart Series

  • Foundational constructor on the series class

Parameters:

Name Type Description Default
name Optional[str]

Name of the chart series

None
type Optional[SeriesType]

Type of the series

...
index Optional[int]

Index position on the chart of the series

None
unit Optional[str]

Unit for the series axis

'$'
color Optional[Color]

Color of the series

None
symbol Optional[ScatterMarkerSymbol]

Symbol for the marker in a scatter plot series

...

color

color: Color

Color the series

scatter_marker_symbol

scatter_marker_symbol: ScatterMarkerSymbol

Shape or symbol for the marker in a scatter plot

name

name: str

Name of the series.

unit

unit: str

Axis for the chart series.

index

index: int

Index/position of the series on the chart.

index_name

index_name: str

Axis name for the chart series.

z_index

z_index: Optional[int]

Defines the visual Z index of the series on the chart.

series_type

series_type: SeriesType

Chart type for the series:

tooltip

tooltip: str

An optional tooltip template

values

values: List[ISeriesPoint]

The series list of values. These values are assumed to be in ascending time order (first points earliest, last points latest)

add_point

add_point(
    time: Union[datetime, date], value: float
) -> None
add_point(point: ISeriesPoint) -> None
add_point(
    time: Union[datetime, date], values: List[float]
) -> None

Add a new point to this series

Parameters:

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

Time of the chart point

None
value Optional[float]

Value of the chart point

None
point Optional[ISeriesPoint]

The data point to add

None
values Optional[List[float]]

The values of the data point

None

clone

clone(empty: bool = False) -> BaseSeries

Return a new instance clone of this object

consolidate_chart_points

consolidate_chart_points() -> ISeriesPoint

Will sum up all chart points into a new single value, using the time of latest point

Returns:

Type Description
ISeriesPoint

The new chart point.

clone_values

clone_values() -> List[ISeriesPoint]

Return a list of cloned values

This codeEntityType is protected.

create

create(
    series_type: SeriesType,
    name: str,
    index: int = 0,
    unit: str = "$",
) -> BaseSeries

Creates a series according to the specified type.

Parameters:

Name Type Description Default
series_type SeriesType

The series type

required
name str

The name of the series

required
index int

Series index position on the chart

0
unit str

Unit for the series axis

'$'

Returns:

Type Description
BaseSeries

A CandlestickSeries if series_type is SeriesType.CANDLE. A Series otherwise.

get_updates

get_updates() -> BaseSeries

Get the updates since the last call to this function.

Returns:

Type Description
BaseSeries

List of the updates from the series.

purge

purge() -> None

Removes the data from this series and resets the update position to 0