CandlestickSeries
QuantConnect.CandlestickSeries
CandlestickSeries()
CandlestickSeries(name: str)
CandlestickSeries(name: str, index: int)
CandlestickSeries(name: str, index: int, unit: str)
CandlestickSeries(name: str, unit: str)
Bases: BaseSeries
Candlestick Chart Series Object - Series data and properties for a candlestick 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
|
index
|
Optional[int]
|
Index position on the chart of the series |
None
|
unit
|
Optional[str]
|
Unit for the series axis |
None
|
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.
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],
open: float,
high: float,
low: float,
close: float,
) -> None
add_point(bar: TradeBar) -> 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
|
open
|
Optional[float]
|
Candlestick open price |
None
|
high
|
Optional[float]
|
Candlestick high price |
None
|
low
|
Optional[float]
|
Candlestick low price |
None
|
close
|
Optional[float]
|
Candlestick close price |
None
|
point
|
Optional[ISeriesPoint]
|
The data point to add |
None
|
values
|
Optional[List[float]]
|
The values of the data point |
None
|
consolidate_chart_points
consolidate_chart_points() -> ISeriesPoint
Will sum up all candlesticks into a new single one, using the time of latest point
Returns:
| Type | Description |
|---|---|
ISeriesPoint
|
The new candlestick. |
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