Skip to content

Reference

Objects

Every structure that crosses the boundary, in both directions: what your datafeed returns, and what you pass to a chart method. Field by field, with the units.

Two directions

Worth separating before anything else, because the same word means different things depending on which way it is travelling.

FamilyDirectionObjects
Datafeed shapesyou → chartBar, SymbolInfo, SearchItem
Chart objectsyou → chartOrderLine, PositionLine, ExecutionShape
Both go the same way, and that is the point. Nothing here is something we send you, the chart’s replies are on Events, and they are deliberately small.

The two units that trip everyone

bar.time is milliseconds. period.from, period.to and every visible range are seconds. Inherited from the contract this mirrors, and the single commonest mistake in the whole integration. It fails as a chart that draws nothing in the window it asked about, which looks exactly like having no data for that symbol.

Bar

What getBars resolves to, as an array, ASCENDING by time with no duplicates. That is checked rather than assumed: every engine requires it, no backend guarantees it, and the failure is silent, a descending page renders with its x-axis running backwards inside one request and forwards across requests.

FieldTypeDefaultMeaning
timenumberrequiredMilliseconds since the epoch, while from and to in the request are seconds. Inherited from the contract this mirrors, and the commonest connection mistake: it fails as a chart that draws nothing in the window it just asked about.
opennumberrequiredMust be finite. One NaN scales the whole visible range and empties the chart.
highnumberrequiredMust be finite.
lownumberrequiredMust be finite.
closenumberrequiredMust be finite.
volumenumber–Omit it rather than sending 0. A volume pane of zeroes is a claim that nothing traded.
levelsFootprintLevel[]–Order flow per price level, { price, bid, ask } ascending by price, read by the footprint chart type only. ABSENT is not EMPTY: absent means you supplied no order flow for this bar and the chart draws an empty column, never a distribution invented from the candle; [] means you did and nothing traded.
levelStepnumber–The price step the levels sit on. Positive. Absent, the chart uses the symbol’s tick, then the spacing of the levels themselves.
footprintSourcestring–exchange_trades, sub_candles or synthetic. Anything below exchange_trades is drawn with a quality ring. Absent: exchange_trades when levels is present.
One bad bar is not a cosmetic problem. The renderer scales the whole visible range off the extremes, so a single NaN high or an accidental null close empties the chart. Every field is validated, and the refusal names the index.
The three footprint fields are read by the footprint chart type only, and on them ABSENT is not EMPTY: a bar with no levels is one you supplied no order flow for, drawn as an empty column; a bar with levels: [] is one where nothing traded. The chart never fills the first in from the candle.

Trade

What subscribeTrades pushes: one print, folded into the forming bar's levels by the bar its timestamp falls in. Only a footprint chart subscribes.

FieldTypeDefaultMeaning
pricenumberrequiredMust be finite.
sizenumberrequiredTraded quantity. Finite and not negative.
side'buy' | 'sell'requiredThe AGGRESSOR: buy lifted the offer and counts as ask, sell hit the bid and counts as bid.
timestampnumberrequiredMilliseconds since the epoch. Decides which bar the print is folded into.

FootprintSlice

What getFootprint resolves to, as an array, one per bar in the window. levels is required here where it is optional on a bar, because a slice always speaks for its bar.

FieldTypeDefaultMeaning
timenumberrequiredThe bar’s opening time in MILLISECONDS. Must match a bar the chart holds, or the slice lands nowhere.
levelsFootprintLevel[]requiredRequired, unlike on a bar: a slice always speaks for its bar, and [] says nothing traded.
levelStepnumber–As on a bar.
footprintSourcestring–As on a bar.

SymbolInfo

What resolveSymbol resolves to. A deliberate SUBSET of what a full charting library accepts, these are the fields the embed actually reads, and documenting more would be documenting fields that do nothing.

FieldTypeDefaultMeaning
namestringrequiredWhat the chart shows as the instrument. The only required field.
descriptionstring–The longer name, shown beside it.
typestring–stock · crypto · forex · index · futures. Drives nothing but the label.
exchangestring–The venue. Shown in the legend, and compared against provider; see below.
timezoneIANA nameEtc/UTCDefaults to Etc/UTC. What the time axis is drawn in.
sessionstring24x7Trading hours: 24x7, or 0930-1600. Defaults to 24x7, which draws no gaps.
pricescalenumber10010^decimals, so 100 for two places. Zero or negative is REFUSED rather than defaulted: it decides where the decimal point goes on every price the reader sees, and a wrong price is worse than none.
minmovnumber1The smallest price step, usually 1. Positive or refused, same reasoning.
has_intradaybooleantrueWhether you serve resolutions below a day. False hides the intraday intervals.
supported_resolutionsstring[]allWhich intervals you can answer for. Anything you leave out is not offered.
volume_precisionnumber0Decimal places for volume. 0 for whole shares, more for a crypto pair.
data_status"streaming" | "endofday" | "delayed_streaming"streamingWhat the reader is told about freshness. ABSENT grades real-time, because every first-party feed omits it and defaulting to delayed would badge live charts with a louder lie.
providerstring–Who SERVED the bars, when that is not the exchange. Set it only when they differ: a value repeating exchange is dropped rather than printed twice. It earns a "≈" glyph: live data that reached the reader through somebody other than the venue can disagree with the official print.
delayseconds–Publisher lag, when you know it. Absence renders as "the lag varies by exchange", never as zero, because claiming real-time on somebody else’s behalf is the one thing this field must never do.
pricescale decides where the decimal point goes on every price the reader sees, so a zero or a negative is refused rather than defaulted, a wrong price is worse than no price. provider and delay are how a redistributed or delayed feed says so on the chart; absence renders as unknown, never as a confident zero.

What searchSymbols resolves to. Optional, omit the method entirely and the chart's symbol search stays empty rather than erroring.

FieldTypeDefaultMeaning
symbolstringrequiredWhat the row shows. A row without it is dropped.
descriptionstring–The longer name, shown beneath.
exchangestring–The venue badge on the row.
typestring–Feeds the asset-class filter chips.
tickerstringsymbolWhat resolveSymbol will be called with, when that differs from what the row displays. Defaults to symbol.

OrderLine

Passed to createOrderLine, and any subset of it to handle.set(). A price level in the scale rather than a drawing on top of it, so it moves with the chart and can be made draggable.

PropertyTypeMeaning
pricenumberWhere the line sits, in the instrument’s own units.
textstringThe label in the line’s body. Up to 200 characters.
tooltipstringShown on hover, so detail that would crowd the label has somewhere to go.
quantitystringThe badge at the end of the line. A string rather than a number, because it is a label: “2.5 BTC” and “50%” are both things a host needs to put there.
lineColorcolourThe line itself. Hex or rgb(); url() is refused.
lineWidthpixels, 1–100Thickness. Zero and negative are refused.
lineStyle0–40 solid · 1 dotted · 2 dashed · 3 large-dashed · 4 sparse-dotted. Anything else is refused.
bodyAlignment"left" | "right"Defaults to right. Anchors the whole label, quantity and button group to the chosen plot edge. Position TP/SL, breakeven and drag-preview labels follow. Independent of lineLength and extendLeft. Set on creation or update with { bodyAlignment: "left" } to keep recent candles clear on narrow charts.
bodyPaddingLeftpixels, 0–100Inset from the left plot edge when bodyAlignment is left. Defaults to zero. Moves all controls and protection labels together; does not shorten the line. Available on creation and update.
bodyPaddingRightpixels, 0–100Right-aligned inset; default 0.
bodyPaddingHorizontalpixels, 0–100Padding on each side of body and quantity; default 6.
bodyPaddingVerticalpixels, 0–100Padding above and below the row text; default 3.
bodyBorderWidthpixels, 0–100Control outline width; zero hides outlines; default 1.
bodyBorderRadiuspixels, 0–100 or nullBody radius override; null inherits borderRadius.
quantityBorderRadiuspixels, 0–100 or nullQuantity radius override; null inherits borderRadius.
buttonBorderRadiuspixels, 0–100 or nullAction and drag-out button radius; null inherits borderRadius.
buttonWidthpixels, 0–100Minimum action button width; default 18.
buttonIconWidthpixels, 0–100Action icon stroke width; default 1.5.
extendLeftbooleanDraws the line across the full width rather than from the current bar rightward.
lineLengthpercent, 1–100How far left the line reaches, as a share of the plot. Only consulted when extendLeft is off, since a line pinned to the left edge already spans everything there is.
borderRadiuspixels, 0–100The corner radius of every box on the line: the label body, the quantity chip and each button. Individual bodyBorderRadius, quantityBorderRadius and buttonBorderRadius overrides may be set; null restores this shared value. 0 is square; anything past half the row’s height is a full pill, the embed accepts 0–100.
bodyBorderColorcolourOutline of the label body.
bodyBackgroundColorcolourFill behind the label text.
bodyTextColorcolourThe label text.
bodyFontCSS font, ≤120 charsThe label’s font, as a CSS shorthand: bold 12px "Inter", system-ui, sans-serif. url() is refused, for the reason a colour’s is, namely that the canvas would fetch from a page we do not control.
quantityBorderColorcolourOutline of the quantity badge.
quantityBackgroundColorcolourFill behind the quantity badge.
quantityTextColorcolourThe quantity text.
quantityFontCSS font, ≤120 charsThe quantity badge’s font. Same rules as bodyFont.
editablebooleanLets the reader DRAG the line, and fires orderMove where they dropped it. This is what makes an order line a control rather than a picture.
cancellablebooleanShows the ✕ and fires orderCancel. Your side decides what that means.
modifyTooltipstringHover text for the body, which fires orderModify when clicked rather than dragged. Says what the BUTTON does; the line’s own tooltip says what the level is.
cancelTooltipstringHover text for the ✕.
cancelButtonBorderColorcolourOutline of the ✕ button.
cancelButtonBackgroundColorcolourFill behind the ✕.
cancelButtonIconColorcolourThe ✕ itself.

PositionLine

Passed to createPositionLine. An entry with its protective legs, see the orders and positions guide for what a full bracket looks like on screen.

PropertyTypeMeaning
pricenumberWhere the line sits, in the instrument’s own units.
textstringThe label in the line’s body. Up to 200 characters.
tooltipstringShown on hover, so detail that would crowd the label has somewhere to go.
quantitystringThe badge at the end of the line. A string rather than a number, because it is a label: “2.5 BTC” and “50%” are both things a host needs to put there.
lineColorcolourThe line itself. Hex or rgb(); url() is refused.
lineWidthpixels, 1–100Thickness. Zero and negative are refused.
lineStyle0–40 solid · 1 dotted · 2 dashed · 3 large-dashed · 4 sparse-dotted. Anything else is refused.
bodyAlignment"left" | "right"Defaults to right. Anchors the whole label, quantity and button group to the chosen plot edge. Position TP/SL, breakeven and drag-preview labels follow. Independent of lineLength and extendLeft. Set on creation or update with { bodyAlignment: "left" } to keep recent candles clear on narrow charts.
bodyPaddingLeftpixels, 0–100Inset from the left plot edge when bodyAlignment is left. Defaults to zero. Moves all controls and protection labels together; does not shorten the line. Available on creation and update.
bodyPaddingRightpixels, 0–100Right-aligned inset; default 0.
bodyPaddingHorizontalpixels, 0–100Padding on each side of body and quantity; default 6.
bodyPaddingVerticalpixels, 0–100Padding above and below the row text; default 3.
bodyBorderWidthpixels, 0–100Control outline width; zero hides outlines; default 1.
bodyBorderRadiuspixels, 0–100 or nullBody radius override; null inherits borderRadius.
quantityBorderRadiuspixels, 0–100 or nullQuantity radius override; null inherits borderRadius.
buttonBorderRadiuspixels, 0–100 or nullAction and drag-out button radius; null inherits borderRadius.
buttonWidthpixels, 0–100Minimum action button width; default 18.
buttonIconWidthpixels, 0–100Action icon stroke width; default 1.5.
extendLeftbooleanDraws the line across the full width rather than from the current bar rightward.
lineLengthpercent, 1–100How far left the line reaches, as a share of the plot. Only consulted when extendLeft is off, since a line pinned to the left edge already spans everything there is.
borderRadiuspixels, 0–100The corner radius of every box on the line: the label body, the quantity chip and each button. Individual bodyBorderRadius, quantityBorderRadius and buttonBorderRadius overrides may be set; null restores this shared value. 0 is square; anything past half the row’s height is a full pill, the embed accepts 0–100.
bodyBorderColorcolourOutline of the label body.
bodyBackgroundColorcolourFill behind the label text.
bodyTextColorcolourThe label text.
bodyFontCSS font, ≤120 charsThe label’s font, as a CSS shorthand: bold 12px "Inter", system-ui, sans-serif. url() is refused, for the reason a colour’s is, namely that the canvas would fetch from a page we do not control.
quantityBorderColorcolourOutline of the quantity badge.
quantityBackgroundColorcolourFill behind the quantity badge.
quantityTextColorcolourThe quantity text.
quantityFontCSS font, ≤120 charsThe quantity badge’s font. Same rules as bodyFont.
closeablebooleanShows the close control and fires positionClose. On by default.
reversiblebooleanShows the reverse control and fires positionReverse. OFF by default, because turning it on is a promise to answer that event, and a control whose press goes nowhere is worse than one that is absent.
closeTooltipstringHover text for the close control.
reverseTooltipstringHover text for the reverse control.
closeButtonBorderColorcolourOutline of the close button.
closeButtonBackgroundColorcolourFill behind the close button.
closeButtonIconColorcolourThe close glyph.
reverseButtonBorderColorcolourOutline of the reverse button.
reverseButtonBackgroundColorcolourFill behind the reverse button.
reverseButtonIconColorcolourThe reverse glyph.
takeProfitnumber | nullThe take-profit leg. null clears it, which is why it is nullable.
stopLossnumber | nullThe stop leg. null clears it.
breakevennumber | nullThe breakeven marker. null clears it. A whole bracket is one line and one set(), so a host cancelling a stop never has to tear the position down and redraw it.
takeProfitColorcolour | nullThe take-profit leg’s ink, and the ink of its drag-out handle and the level in flight, so one leg is one colour throughout. null restores the built-in green.
stopLossColorcolour | nullThe stop leg’s ink. null restores the built-in red.
breakevenColorcolour | nullThe breakeven marker’s ink. null restores the chart theme’s muted ink.
canAddTakeProfitbooleanOffers the drag-out TP handle: the small square a reader pulls off the pill to ask for a take-profit at the price they release on, reported as positionAddTakeProfit. OFF by default. Turn it off again once that leg exists, or the gesture invites a second take-profit on one position.
canAddStopLossbooleanThe same for the stop handle, reported as positionAddStopLoss. OFF by default.
protectTooltipstringHover text for both drag-out handles.
takeProfitLabelstring, ≤24What the leg is CALLED on the pill at the end of its level, the “TP” in TP 43,000. An empty string draws no pill, which is how you turn the label off. Not the same property as addTakeProfitLabel: this one is a name printed beside a price, that one is the text on a button.
stopLossLabelstring, ≤24The same for the stop leg. Defaults to “SL”.
breakevenLabelstring, ≤24The same for the breakeven marker, and EMPTY by default: it has always drawn an unlabelled dotted reference, so naming it is opt-in rather than something that appears on charts already using it.
addTakeProfitLabelstring, ≤24The text on the drag-out TP handle. The handle measures its own label and grows to fit, so a longer one is legible rather than clipped. + TP is a common choice, since the gesture creates a leg rather than moving one.
addStopLossLabelstring, ≤24The text on the drag-out SL handle. Defaults to “SL”.
pnlPositiveColorcolour or nullPositive P&L ink; null follows the chart.
pnlNegativeColorcolour or nullNegative P&L ink; null follows the chart.
protectLabelFontCSS fontFont for TP, SL, breakeven and draft labels.
protectLabelPaddingHorizontalpixels, 0–100Protection-label horizontal padding; default 5.
protectLabelPaddingVerticalpixels, 0–100Protection-label vertical padding; default 2.
protectLabelBorderRadiuspixels, 0–100Protection-label corner radius; default 0.
protectLabelBorderWidthpixels, 0–100Protection-label outline width; default 0.
protectLabelBackgroundColorcolour or nullProtection-label fill; null follows the leg color.
protectLabelBorderColorcolour or nullProtection-label outline; null follows the leg color.
protectLabelTextColorcolour or nullProtection-label ink; null uses white.
protectButtonBackgroundColorcolour or nullDrag-out button fill; null follows the close button.
protectButtonBorderColorcolour or nullDrag-out button outline; null follows the leg color.
protectButtonTextColorcolour or nullDrag-out button ink; null follows the leg color.
protectFontCSS font, ≤120 charsThe font on both drag-out handles. Same rules as bodyFont.
protectLineWidthpixels, 1–100How thick the take-profit, stop and breakeven levels are drawn. Independent of the entry’s lineWidth, which is why it exists: thickening the entry used to leave a hairline stop beside it.
protectLineStyle0–4The dash pattern for the take-profit and stop levels, same vocabulary as lineStyle. Breakeven keeps its own dotted pattern, because it is a reference mark rather than a resting order and that difference is what the dash is carrying.
protectFillOpacity0–1How strongly a drag-out shades the span it is proposing. While the reader drags a handle away from the pill, everything between the entry and the level under the pointer is washed in that leg’s own colour: red down to a stop, green up to a target, so the gesture says how much is being risked and not only where the level lands. It belongs to the GESTURE: the wash goes the instant the release books the order, because a resting stop is a level and not a region. Defaults to 0.16, the same strength as the depth wash in the price gutter, so the two read as one chart. 0 turns it off and changes nothing else.
side"long" | "short" | nullWhich way the position points. Set it whenever you offer the drag-out handles: a long takes profit above its entry and stops below it, and unset the drag constrains NOTHING, so a reader can draw a take-profit into a loss and find out from your venue’s rejection.
editablebooleanLets the reader DRAG the position line, firing positionMove. Off by default, and the default is the point: a position line stands for a fill, whose price is not the reader’s to move. Turn it on only where the line stands for a level that has not been placed.

ExecutionShape

Passed to createExecutionShape. A buy or sell marker at one bar, where a fill happened, rather than a level that persists.

PropertyTypeMeaning
timesecondsWhen it happened. SECONDS since the epoch, not milliseconds.
pricenumberThe level it happened at.
direction"buy" | "sell"Which way the marker points, and which side of the price it sits on. Nothing else is accepted.
markerStyle"arrow" | "badge"The SHAPE. arrow is the default; a triangle at the price with the label beside it. badge puts the label INSIDE a roundel sitting against the price, which is what a trade history wants: a column of fills reads as B / S bubbles rather than as triangles each trailing a caption. It changes what two other properties mean; see text and textColor.
textstringThe label. Beside an arrow, so it can be a sentence; INSIDE a badge, where it wants a glyph or two; a longer one grows the roundel into a pill rather than being clipped.
tooltipstringShown on hover. Where a badge’s words go, since its label is one glyph.
arrowColorcolourThe arrow, or the badge’s fill.
textColorcolourThe label. On an arrow it is drawn on the CHART; on a badge it is drawn on arrowColor, so those two have to contrast; set them from the same place, or the letter ends up the colour of the disc it is inside.
fontCSS font, ≤120 charsThe label’s font. Same rules as a line’s bodyFont.
arrowHeightpixels, 1–100How tall the arrow is drawn, or the badge’s radius (7–14).
arrowSpacingpixels, 1–100The gap between the marker and the candle it marks; below the bar’s low for a buy, above its high for a sell. An arrow’s tip and a badge’s near EDGE both land there, so the bar is framed rather than covered.

ChartStyle

Passed to setStyle, using the same role names data-colors takes. Every key is optional and every value is a hex colour, so a call names only what it changes and leaves the rest of the palette at the theme's values. Each role sets a family of tokens: up moves the rising candle's body, wick and border together, so the object is smaller than the number of things it paints.

RoleTypePaints
bghex colourPlot background. One token.
texthex colourAxis labels and legend. One token.
gridhex colourGrid lines. One token.
uphex colourRising candles, body wick and border. 3 tokens, together.
downhex colourFalling candles, body wick and border. 3 tokens, together.
crosshairhex colourThe crosshair’s two lines. One token.
mutedhex colourSecondary text: the countdown to the next bar, hints, sub-labels. One token.
borderhex colourHairlines: the price scale, the time axis, the edges between panes. One token.
chromehex colourToolbars, dialogs and menus — only visible with the toolbar on. One token.
accenthex colourThe highlight: active controls, and a drawing while it is selected. 2 tokens, together.
This object is validated differently depending on how it arrives. setStyle({ background: '#fff' }) returns a commandError naming background, while the same mistake in data-colors drops that pair and renders the rest. A URL is written once and read by every visitor to your page, so a typo in one must not prevent the chart from rendering. See Styling.

PriceScale

Returned by getPriceScale() and getVisiblePriceRange(), and carried by the priceScaleChanged event. It is the price-to-pixel mapping: everything needed to place a level of your own on the chart. Unlike every other object here it travels OUT of the frame rather than in, so it is a flat bag of numbers rather than something with methods.

PropertyTypeWhat it is
fromnumberThe price at the BOTTOM edge of the plot band, or the top when inverted.
tonumberThe price at the other edge.
topnumberCSS pixels from the IFRAME’s top edge to the top of the plot band. Not zero on an embed with a toolbar.
heightnumberHeight of the plot band. Always above zero.
leftnumberCSS pixels from the iframe’s left edge.
widthnumberWidth of the plot band. Narrower than the iframe: the price gutter is outside it.
scalelinear or logHow price is distributed down the band. Read it rather than assuming: the reader can switch this from the chart’s own settings.
invertedbooleanTrue when the reader has flipped the scale, so from is at the top.
The plot band is the price pane, not the frame. The price scale gutter, the time axis and any indicator pane the reader has added all sit outside it, so an overlay drawn against the iframe’s own height lands slightly high on every level, by a margin that grows as the reader adds panes. Map with chart.priceToY(price) and the arithmetic is the chart’s own, including the logarithmic and inverted cases. See Methods.

ToolbarButton

Passed to createToolbarButton, which additionally takes align (left or right, defaulting to right) at creation only. These three are what a button can change about itself afterwards, through button.set().

PropertyTypeMeaning
textstring, ≤32The label. Short, because the cell sits in a fixed row beside the chart’s own controls and a long one displaces them.
tooltipstringDetail on hover. Never the button’s identity: title does not exist on a touchscreen, so anything a reader must know goes in text.
activebooleanThe pressed state, for a button that is a TOGGLE. Setting it once is what makes the control announce itself as a switch, so leave it out on a plain action.
iconicon name | nullA glyph before the label, from a fixed list we draw ourselves: star, bookmark, bell, settings, plus, refresh, download, link, search, camera, expand, info. Never markup, a data URI or a URL: those would put your DOM, or a fetch you can watch, on our origin, which is the one thing the iframe exists to prevent. It never replaces text, which stays the accessible name.
disabledbooleanPresent but not on offer: announced as disabled, skipped by the Tab key, and its presses are not reported. Use it where removing the button instead would make the header shuffle every time the symbol changes.
There is no html, no icon and no className, and that is the frame boundary rather than an omission: your code does not execute on our origin, which is the whole reason the embed is an iframe, so an option taking markup would hand back exactly what it exists to withhold. What you get instead is a control already matching the chart it sits in, on both themes.

How a bad object is refused

Never silently. An unknown property is refused by name, and a known property outside its domain is refused too.

Both refusals, and what comes back
await chart.createOrderLine({ price: 42000, lineColour: '#f00' });
// commandError: unknown property "lineColour"      ← a typo, named

await chart.createOrderLine({ price: 42000, lineStyle: 9 });
// commandError: lineStyle must be 0-4              ← in range, not in domain
The second one is why the domains are written out above rather than typed as number. lineStyle: 9 used to be accepted, applied, and draw nothing, accepted-then-silently-dropped, which is exactly what a property table exists to prevent. There is no honest way to document a domain of 0–4 for a field that takes any number.