Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Candlestick — OHLC Time Series

Signature

sp.candlestick(title, labels, open, high, low, close, *, variant="basic", palette=None, **kwargs) -> Chart

Description

sp.candlestick() is the unified entry point for the entire candlestick-chart family. A candlestick chart shows OHLC (Open, High, Low, Close) bars over time and is the de facto standard for financial markets, crypto, commodities, energy spot prices and any time-series with intra-period spread. The variant keyword switches the visual style without touching the data — including derived views like Heikin-Ashi smoothing, close-only line, mountain area and high-low range bars.

Color convention — by default green = up (close >= open) and red = down. Override with palette=[up_color, down_color]. Bars are rendered left-to-right in input order; use sort_order="asc" to sort by close price.

Parameters

ParameterTypeDefaultDescription
titlestrrequiredChart title
labelslist[str]requiredPeriod labels (e.g. dates)
openlist[float]requiredOpening price per period
highlist[float]requiredHighest price per period
lowlist[float]requiredLowest price per period
closelist[float]requiredClosing price per period
variantstr"basic"Visual style (see table)
palettelist[int]None[up_color, down_color] (defaults: green/red)
gridlinesboolFalseHorizontal price gridlines
x_labelstr""X-axis label
y_labelstr""Y-axis label
sort_orderstr"none""none", "asc", "desc" (by close)
widthint1100Canvas width (px)
heightint500Canvas height (px)

Returns

Chart — object with .html property and .show() method.


Signature

sp.candlestick(title, labels, open, high, low, close, *, variant="basic", palette=None, **kwargs) -> Chart

Description

sp.candlestick() est le point d entree unifie pour toute la famille des chandeliers. Un graphique en chandeliers affiche des barres OHLC (Ouverture, Haut, Bas, Cloture) dans le temps et constitue le standard de fait pour les marches financiers, la crypto, les matieres premieres, le spot energie et toute serie temporelle avec spread intra-periode. Le mot-cle variant change le style sans toucher aux donnees — y compris des vues derivees comme le lissage Heikin-Ashi, la ligne de cloture, l aire mountain et les barres haut-bas.

Convention de couleur — par defaut vert = hausse (close >= open) et rouge = baisse. Surchargez avec palette=[couleur_hausse, couleur_baisse]. Les barres sont rendues de gauche a droite dans l ordre d entree ; sort_order="asc" pour trier par prix de cloture.

Parametres

ParametreTypeDefautDescription
titlestrrequisTitre du graphique
labelslist[str]requisLibelles de periode (ex. dates)
openlist[float]requisPrix d ouverture par periode
highlist[float]requisPrix le plus haut par periode
lowlist[float]requisPrix le plus bas par periode
closelist[float]requisPrix de cloture par periode
variantstr"basic"Style visuel (voir tableau)
palettelist[int]None[hausse, baisse] (defaut : vert/rouge)
gridlinesboolFalseLignes de grille horizontales
x_labelstr""Libelle axe X
y_labelstr""Libelle axe Y
sort_orderstr"none""none", "asc", "desc" (par cloture)
widthint1100Largeur du canvas (px)
heightint500Hauteur du canvas (px)

Retour

Chart — objet avec une propriete .html et une methode .show().