Skip to main content

Core Interfaces Reference

This guide covers all the important interfaces and types used throughout the charting library. Understanding these will help you work with the API more effectively.


Data Feed Interfaces

IBasicDataFeed

The main interface your data feed must implement to provide data to the chart.

Required Methods:

interface IBasicDataFeed {
// Initialize and return configuration
onReady(callback: (config: DataFeedConfiguration) => void): void;

// Resolve symbol name to full metadata
resolveSymbol(
symbolName: string,
onResolve: (symbolInfo: SymbolState) => void,
onError?: (error: string) => void
): void;

// Fetch historical bars
getBars(
symbolInfo: SymbolState,
resolution: string,
from: number,
to: number,
onResult: (bars: Bar[], meta?: HistoryMetadata) => void,
onError?: (error: string) => void
): void;
}

Optional Methods:

  • searchSymbols() - Search for symbols
  • subscribeBars() - Subscribe to real-time updates
  • unsubscribeBars() - Unsubscribe from real-time updates
  • subscribeDepth() - Subscribe to depth/market data
  • createWatchlist() - Create watchlist
  • deleteWatchlist() - Delete watchlist
  • addSymbolToWatchlist() - Add symbol to watchlist
  • getWatchlists() - Get all watchlists
  • createAlert() - Create alert
  • getAlerts() - Get all alerts
  • updateAlert() - Update alert
  • deleteAlert() - Delete alert

Example Implementation:

const myDataFeed = {
onReady(callback) {
callback({
supported_resolutions: ['1', '5', '15', '1D', '1W'],
supports_search: true,
supports_group_request: false
});
},

resolveSymbol(symbolName, onResolve, onError) {
const symbolInfo = {
name: symbolName,
description: symbolName + ' Inc.',
type: 'stock',
session: '24x7',
timezone: 'America/New_York',
minmov: 1,
pricescale: 100,
has_intraday: true,
supported_resolutions: ['1', '5', '15', '1D', '1W']
};
onResolve(symbolInfo);
},

getBars(symbolInfo, resolution, from, to, onResult, onError) {
// Fetch bars from your API
fetch(`/api/bars?symbol=${symbolInfo.name}&from=${from}&to=${to}`)
.then(res => res.json())
.then(data => {
onResult(data.bars);
})
.catch(err => onError(err.message));
}
};

Data Types

Bar

Represents a single candlestick/bar on the chart.

Properties:

PropertyTypeDescription
timenumberTimestamp in milliseconds
opennumberOpening price
highnumberHighest price
lownumberLowest price
closenumberClosing price
volumenumber?Trading volume
openInterestnumber?Open interest (for futures)

Example:

const bar = {
time: 1234567890000, // milliseconds
open: 150.00,
high: 155.50,
low: 149.00,
close: 153.25,
volume: 1000000
};

SymbolState

Complete symbol information.

Properties:

PropertyTypeDescription
symbol_namestringSymbol ticker (AAPL)
tokenstringInternal token
exchangestringExchange name
descriptionstringFull description
ticksizenumberMinimum price movement
lotsizenumberLot size
precisionnumberDecimal precision
typestring?Type (stock, crypto, forex)
sessionstring?Trading session
timezonestring?Timezone
supported_resolutionsstring[]?Available timeframes

Example:

const symbol = {
symbol_name: 'AAPL',
token: 'AAPL_TOKEN',
exchange: 'NASDAQ',
description: 'Apple Inc.',
ticksize: 0.01,
lotsize: 1,
precision: 2,
type: 'stock',
session: '0930-1600',
timezone: 'America/New_York',
supported_resolutions: ['1', '5', '15', '1D', '1W']
};

DataFeedConfiguration

Configuration returned by datafeed's onReady method.

Properties:

PropertyTypeDescription
supported_resolutionsstring[]Available timeframes
supports_searchboolean?Enable symbol search
supports_group_requestboolean?Enable group requests
supports_marksboolean?Enable chart marks
supports_timescale_marksboolean?Enable timescale marks
supports_timeboolean?Enable time support
exchangesarray?Available exchanges
symbols_typesarray?Symbol types

Example:

const config = {
supported_resolutions: ['1', '5', '15', '30', '60', '1D', '1W', '1M'],
supports_search: true,
supports_group_request: false,
supports_marks: true,
exchanges: [
{ value: 'NASDAQ', name: 'NASDAQ', desc: 'NASDAQ Stock Exchange' },
{ value: 'NYSE', name: 'NYSE', desc: 'New York Stock Exchange' }
]
};

DepthData

Market depth (order book) data.

Properties:

PropertyTypeDescription
bidsDepthLevel[]Buy orders
asksDepthLevel[]Sell orders
volumenumber?Total volume
opennumber?Opening price
highnumber?High price
lownumber?Low price
closenumber?Closing price

Example:

const depth = {
bids: [
{ price: 150.00, quantity: 100, orders: 5 },
{ price: 149.90, quantity: 200, orders: 8 }
],
asks: [
{ price: 150.10, quantity: 150, orders: 6 },
{ price: 150.20, quantity: 250, orders: 10 }
]
};

Drawing Interfaces

DrawingType

Enumeration of all available drawing tools.

Available Types:

enum DrawingType {
TrendLine = "trend_line",
FibonacciRetracement = "fib_retracement",
Rectangle = "rectangle",
HorizontalLine = "horizontal_line",
ExtendedLine = "extended_line",
RayLine = "ray_line",
Circle = "circle",
Ellipse = "ellipse",
TrendChannel = "trend_channel",
Arrow = "arrow",
ArrowMarkUp = "arrow_mark_up",
ArrowMarkDown = "arrow_mark_down",
VerticalLine = "vertical_line",
CrossLine = "cross_line",
Path = "path",
Text = "text",
Note = "note",
OrderLine = "order_line",
PositionLine = "position_line",
// ... and more
}

DrawingPoint

A point on the chart for drawings.

Properties:

PropertyTypeDescription
timenumberTimestamp
pricenumberPrice level
barIndexnumberBar index

Example:

const point = {
time: 1234567890000,
price: 150.00,
barIndex: 100
};

DrawingOptions

Styling options for drawings.

Properties:

PropertyTypeDescription
colorstring?Primary color
opacitynumber?Opacity (0-1)
lineWidthnumber?Line width
lineDashnumber[]?Dash pattern
fillColorstring?Fill color
backgroundColorstring?Background color
textstring?Text content
fontSizenumber?Font size
fontFamilystring?Font family

Example:

const options = {
color: '#ff0000',
lineWidth: 2,
opacity: 0.8,
fillColor: 'rgba(255, 0, 0, 0.2)'
};

IDrawing

Complete drawing object.

Properties:

PropertyTypeDescription
idstringUnique ID
typeDrawingTypeDrawing type
pointsDrawingPoint[]Drawing points
optionsDrawingOptionsStyle options
paneIdstringPane ID
lockedbooleanIs locked
visiblebooleanIs visible
createdAtnumberCreation time
updatedAtnumberLast update time

Indicator Interfaces

CustomIndicatorDefinition

Interface for defining custom indicators.

Properties:

PropertyTypeDescription
namestringUnique indicator name
displayNamestring?Display name
descriptionstring?Description
categorystring?Category
inputsCustomIndicatorInput[]Input parameters
calculatefunctionCalculation function
renderLayersCustomIndicatorLayer[]Render layers
pane'main' | 'new'?Pane placement
categoryType'overlay' | 'oscillator'?Category type

Example:

const customIndicator = {
name: 'MySMA',
displayName: 'My Custom SMA',
description: 'Simple Moving Average',
category: 'Moving Averages',
inputs: [
{
name: 'period',
type: 'number',
defaultValue: 20,
min: 1,
max: 200,
description: 'Number of periods'
}
],
calculate: (getRealBar, getDerivedBar, index, options) => {
const { period } = options.inputs;
if (index < period - 1) return null;

let sum = 0;
for (let i = 0; i < period; i++) {
sum += getRealBar(index - i).close;
}
return sum / period;
},
renderLayers: [
{
type: 'line',
dataKey: 'value',
color: '#2196F3',
lineWidth: 2
}
],
pane: 'main',
categoryType: 'overlay'
};

CustomIndicatorInput

Input parameter for custom indicators.

Properties:

PropertyTypeDescription
namestringInput name
typestringType: 'number', 'string', 'boolean', 'color'
defaultValueanyDefault value
minnumber?Minimum value (for numbers)
maxnumber?Maximum value (for numbers)
stepnumber?Step value
descriptionstring?Description

RenderLayer

Defines how indicator data is rendered.

Properties:

PropertyTypeDescription
typestring'line', 'area', 'candle', 'column', 'scatter', 'histogram', 'bgcolor', 'fill'
dataKeystringKey in calculated data
colorstringColor
lineWidthnumber?Line width (for lines)
fillstring?Fill color (for areas)
opacitynumber?Opacity (0-1)
dashPatternnumber[]?Dash pattern

Example:

const layer = {
type: 'line',
dataKey: 'value',
color: '#2196F3',
lineWidth: 2,
opacity: 1
};

IStoreIndicator

Internal indicator representation.

Properties:

PropertyTypeDescription
idstringUnique ID
namestringIndicator name
metaInfoIndicatorMetadataMetadata
instanceanyCalculator instance
seriesBindingIndicatorSeriesBindingSeries binding
455→inputsIndicatorInputDefinition[]
456→stylesIndicatorStyleDefinition[]
457→optionsIndicatorOptions
458→visibleboolean
459→
460→---
461→
462→## Indicator Style Interfaces

Style configuration for built-in indicators.

ADXStyle

ADX (Average Directional Index) indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"

ATRStyle

ATR (Average True Range) indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"

AroonStyle

Aroon indicator style.

PropertyTypeDescription
upColorstringUp line color
downColorstringDown line color
lineWidthnumberLine width
lineStyle"solid""dashed"

BollingerBandsStyle

Bollinger Bands indicator style.

PropertyTypeDescription
middleBandColorstringMiddle band color
upperBandColorstringUpper band color
lowerBandColorstringLower band color
lineWidthnumberLine width
fillOpacitynumberFill opacity (0-1)
lineStyle"solid""dashed"

CentralPivotRangeStyle

Central Pivot Range indicator style.

PropertyTypeDescription
cpColorstringCentral pivot color
tcpColorstringTop central pivot color
bcpColorstringBottom central pivot color
lineWidthnumberLine width
lineStyle"solid""dashed"

DonchianChannelStyle

Donchian Channel indicator style.

PropertyTypeDescription
upperColorstringUpper channel color
lowerColorstringLower channel color
middleColorstringMiddle channel color
lineWidthnumberLine width
lineStyle"solid""dashed"
fillColorstringFill color

EMAStyle

EMA (Exponential Moving Average) indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"

EWMAStyle

EWMA (Exponentially Weighted Moving Average) indicator style.

PropertyTypeDescription
lineColorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"

GatorStyle

Gator Oscillator indicator style.

PropertyTypeDescription
jawColorstringJaw color
teethColorstringTeeth color
lipsColorstringLips color
lineWidthnumberLine width
lineStyle"solid""dashed"

HMAStyle

HMA (Hull Moving Average) indicator style.

571→| Property | Type | Description | 572→|----------|------|-------------| 573→| lineColor | string | Line color | 574→| lineWidth | number | Line width | 575→| lineStyle | "solid" | "dashed" | "dotted" | Line style | 576→ 577→---

HistoricalVolatilityStyle

Historical Volatility indicator style.

PropertyTypeDescription
lineColorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"

KAMAStyle

KAMA (Kaufman Adaptive Moving Average) indicator style.

PropertyTypeDescription
lineColorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"

KeltnerChannelsStyle

Keltner Channels indicator style.

PropertyTypeDescription
upperColorstringUpper channel color
middleColorstringMiddle channel color
lowerColorstringLower channel color
lineWidthnumberLine width
lineStyle"solid""dashed"

MACDStyle

MACD (Moving Average Convergence Divergence) indicator style.

PropertyTypeDescription
macdColorstringMACD line color
signalColorstringSignal line color
histogramColorstringHistogram color
lineWidthnumberLine width
lineStyle"solid""dashed"

MFIStyle

MFI (Money Flow Index) indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"

ParabolicSARStyle

Parabolic SAR indicator style.

PropertyTypeDescription
longColorstringLong position color
shortColorstringShort position color
dotSizenumberDot size
lineStyle"solid""dashed"

ROCStyle

ROC (Rate of Change) indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"

RSIStyle

RSI (Relative Strength Index) indicator style.

PropertyTypeDescription
colorstringLine color
signalColorstringSignal line color
lineWidthnumberLine width
signalLineWidthnumberSignal line width
lineStyle"solid""dashed"
overboughtColorstringOverbought level color
oversoldColorstringOversold level color
thresholdLineWidthnumberThreshold line width
thresholdLineStylenumber[]Threshold line style

SMAStyle

SMA (Simple Moving Average) indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"

VWMAStyle

VWMA (Volume Weighted Moving Average) indicator style.

| Property | Type | Description | 685→|----------|------|-------------| 686→| color | string | Line color | 687→| lineWidth | number | Line width | 688→| lineStyle | "solid" | "dashed" | "dotted" | Line style | 689→ 690→---

TypicalPriceStyle

Typical Price indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"

StochasticStyle

Stochastic Oscillator indicator style.

PropertyTypeDescription
kColorstring%K line color
dColorstring%D line color
lineWidthnumberLine width
lineStyle"solid""dashed"

TEMAStyle

TEMA (Triple Exponential Moving Average) indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"

WilliamsRStyle

Williams %R indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"

BBPercentBStyle

%b (Percent B) indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"
overboughtColorstringOverbought level color
oversoldColorstringOversold level color
middleColorstringMiddle level color
thresholdLineWidthnumberThreshold line width
thresholdLineStylenumber[]Threshold line style

BullBearPowerStyle

Bull/Bear Power indicator style.

PropertyTypeDescription
colorstringLine color
negativeColorstringNegative values color
zeroLineColorstringZero line color
lineWidthnumberLine width
lineStyle"solid""dashed"

SMIEOStyle

SMI Ergodic Oscillator indicator style.

PropertyTypeDescription
colorstringLine color
upColorstringUp direction color
downColorstringDown direction color
lineWidthnumberLine width

TrendStrengthStyle

Trend Strength indicator style.

PropertyTypeDescription
colorstringLine color
bullishColorstringBullish values color
bearishColorstringBearish values color
lineWidthnumberLine width
lineStyle"solid""dashed"

TRIXStyle

TRIX (Triple Exponential Average) indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"
zeroLineColorstringZero line color

UlcerIndexStyle

Ulcer Index indicator style.

798→| Property | Type | Description | 799→|----------|------|-------------| 800→| color | string | Line color | 801→| lineWidth | number | Line width | 802→| lineStyle | "solid" | "dashed" | "dotted" | Line style | 803→ 804→---

LSMAStyle

LSMA (Least Squares Moving Average) indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"

AcceleratorOscillatorStyle

Accelerator Oscillator indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"
positiveColorstringPositive values color
negativeColorstringNegative values color

UltimateOscillatorStyle

Ultimate Oscillator indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"

CMFStyle

CMF (Chaikin Money Flow) indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"
zeroLineColorstringZero line color

ChaikinOscillatorStyle

Chaikin Oscillator indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"
zeroLineColorstringZero line color

ChandeKrollStopStyle

Chande Kroll Stop indicator style.

PropertyTypeDescription
longColorstringLong position color
shortColorstringShort position color
lineWidthnumberLine width
lineStyle"solid""dashed"

DPOStyle

DPO (Detrended Price Oscillator) indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"
zeroLineColorstringZero line color
zeroLineWidthnumberZero line width

VortexStyle

Vortex Indicator style.

PropertyTypeDescription
viPlusColorstringVI+ line color
viMinusColorstringVI- line color
lineWidthnumberLine width

SMIStyle

SMI (Stochastic Momentum Index) indicator style.

PropertyTypeDescription
smiColorstringSMI line color
emaColorstringEMA line color
overboughtColorstringOverbought level color
oversoldColorstringOversold level color
middleColorstringMiddle level color
lineWidthnumberLine width
overboughtLevelnumberOverbought level
oversoldLevelnumberOversold level
overboughtFillColorstringOverbought fill color
oversoldFillColorstringOversold fill color
overboughtFillOpacitynumberOverbought fill opacity
oversoldFillOpacitynumberOversold fill opacity

CoppockStyle

Coppock Curve indicator style.

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
lineStyle"solid""dashed"

KSTStyle

KST (Know Sure Thing) indicator style.

PropertyTypeDescription
kstColorstringKST line color
signalColorstringSignal line color
lineWidthnumberLine width
signalLineWidthnumberSignal line width
lineStyle"solid""dashed"
zeroLineColorstringZero line color
zeroLineWidthnumberZero line width
zeroLineStylenumber[]Zero line style

Interaction Interfaces

MouseEventParam

Mouse event data passed to event handlers.

Properties:

PropertyTypeDescription
timenumberTimestamp
pricenumberPrice at cursor
xnumberX coordinate
ynumberY coordinate
paneIdstringPane ID
buttonnumber?Mouse button (0=left, 1=middle, 2=right)

Example:

api.subscribeMouseMove((event) => {
console.log(`Mouse at: (${event.x}, ${event.y})`);
console.log(`Price: ${event.price}, Time: ${event.time}`);
console.log(`Pane: ${event.paneId}`);
});

WheelEventParam

Mouse wheel event data (extends MouseEventParam).

Additional Properties:

PropertyTypeDescription
deltaXnumberHorizontal scroll
deltaYnumberVertical scroll
deltaModenumberScroll mode

TouchEventParam

Touch event data.

Properties:

PropertyTypeDescription
touchesarrayArray of touch points
paneIdstringPane ID

Touch Point:

{
time: number,
price: number,
x: number,
y: number
}

CursorType

Available cursor types.

Values:

  • 'default' - Default cursor
  • 'pointer' - Pointer/hand cursor
  • 'grab' - Grab cursor
  • 'grabbing' - Grabbing cursor
  • 'crosshair' - Crosshair cursor
  • 'ns-resize' - North-south resize
  • 'ew-resize' - East-west resize
  • 'nwse-resize' - Diagonal resize
  • 'nesw-resize' - Diagonal resize
  • 'not-allowed' - Not allowed
  • 'text' - Text selection
  • 'auto' - Automatic
  • 'none' - No cursor

CursorConfig

Configuration for cursor behavior.

Properties:

PropertyTypeDescription
defaultCursorTypeDefault cursor
defaultHoverCursorTypeDefault hover cursor
drawingCursorTypeDrawing mode cursor
drawingActiveCursorTypeActive drawing cursor
hoverCursorTypeHover cursor
grabCursorTypeGrab cursor
grabbingCursorTypeGrabbing cursor
resizingCursorTypeResizing cursor

Template & Style Interfaces

TemplateEventData

Complete template styling configuration.

Properties:

PropertyTypeDescription
statusLineStatusLineSettings?Status line settings
gridGridStyleSettings?Grid settings
priceScaleLabelsPriceScaleLabelSettings?Price scale labels
timeScaleFormatTimeScaleFormatSettings?Time scale format
crosshairCrosshairStyleSettings?Crosshair style
canvasBackgroundCanvasBackgroundSettings?Canvas background
eventsEventsSettings?Events display

GridStyleSettings

Grid styling configuration.

Properties:

PropertyTypeDescription
vertLineColorstring?Vertical line color
horzLineColorstring?Horizontal line color
modestring?'normal' or 'logarithmic'
lineWidthnumber?Line width
lineStylestring?'solid', 'dashed', or 'dotted'

Example:

const gridStyle = {
vertLineColor: 'rgba(128, 128, 128, 0.3)',
horzLineColor: 'rgba(128, 128, 128, 0.3)',
mode: 'normal',
lineWidth: 1,
lineStyle: 'dashed'
};

CrosshairStyleSettings

Crosshair styling.

Properties:

PropertyTypeDescription
colorstring?Crosshair color
modestring?'normal', 'x-only', 'y-only', 'hidden'
lineWidthnumber?Line width
lineStylestring?'solid', 'dashed', 'dotted'

CanvasBackgroundSettings

Canvas background configuration.

Properties:

PropertyTypeDescription
typestring?'solid' or 'gradient'
colorstring?Background color
gradientobject?Gradient configuration

Gradient:

{
startColor: string,
endColor: string,
direction: 'vertical' | 'horizontal'
}

Example:

const background = {
type: 'gradient',
gradient: {
startColor: '#1a1a2e',
endColor: '#16213e',
direction: 'vertical'
}
};

PriceScaleLabelSettings

Price scale label configuration.

Properties:

PropertyTypeDescription
showSymbolNameboolean?Show symbol name
showLastPriceboolean?Show last price
showIndicatorsNameboolean?Show indicator names
showIndicatorsValueboolean?Show indicator values
showLastPricePercentageboolean?Show price percentage
noOverlappingLabelsboolean?Prevent overlapping

EventsSettings

Corporate events display settings.

Properties:

PropertyTypeDescription
showDividendsboolean?Show dividends
showSplitsboolean?Show stock splits
showEarningsboolean?Show earnings
showNewsboolean?Show news

State Interfaces

CrosshairState

Current crosshair state.

Properties:

PropertyTypeDescription
xnumberX coordinate
ynumberY coordinate
visiblebooleanIs visible
modestringCrosshair mode
isInBoundarybooleanIs in chart boundary
barIndexnumber?Current bar index
timenumber?Current time
pricenumber?Current price
paneIdstring?Current pane

TooltipState

Tooltip state.

Properties:

PropertyTypeDescription
visiblebooleanIs visible
xnumber?X position
ynumber?Y position

TimeScaleState

Time scale configuration.

Properties:

PropertyTypeDescription
startnumberStart index
endnumberEnd index
barSpacingnumber?Bar spacing
scrollOffsetnumber?Scroll offset

PriceScaleState

Price scale configuration.

Properties:

PropertyTypeDescription
minnumberMinimum price
maxnumberMaximum price
autoScalebooleanAuto scale enabled
logScalebooleanLogarithmic scale
percentageScalebooleanPercentage scale
invertedbooleanInverted scale

Trading Interfaces

TradingLineStyleOptions

Options for order and position lines.

Properties:

PropertyTypeDescription
kindstring'order' or 'position'
lineIdstringLine ID
sidestring?'buy' or 'sell'
quantitystring?Quantity
textstring?Label text
orderTypestring?'limit', 'stop', 'market'
statusstring?'open', 'filled', 'cancelled', 'rejected'
tpPricenumber?Take profit price
slPricenumber?Stop loss price
baseLineColorstring?Base line color
tpLineColorstring?TP line color
slLineColorstring?SL line color

TradingLineAction

Available trading line actions.

Values:

  • 'modify' - Modify the order
  • 'cancel' - Cancel the order
  • 'reverse' - Reverse position
  • 'close' - Close position

TradingLineKind

Trading line types.

Values:

  • 'order' - Order line
  • 'position' - Position line

TradingLineSide

Trading sides.

Values:

  • 'buy' - Buy side
  • 'sell' - Sell side

Watchlist & Alert Interfaces

IWatchlist

Watchlist structure.

Properties:

PropertyTypeDescription
idstringUnique ID
namestringWatchlist name
symbolsIWatchlistSymbol[]Symbols in watchlist

IWatchlistSymbol

Symbol in a watchlist.

Properties:

PropertyTypeDescription
symbolstringSymbol ticker
exchangestring?Exchange
tokenstring?Token

ISymbolDetails

Detailed symbol information.

Properties:

PropertyTypeDescription
namestringDisplay name
symbolstringSymbol ticker
exchangestring?Exchange
pricenumberLast price
changenumberPrice change
changePercentagenumberChange percentage
volumenumberVolume
logostringLogo URL

Layout Interfaces

LayoutType

Available layout types.

Values:

  • '1' - Single chart
  • '2h' - 2 horizontal
  • '2v' - 2 vertical
  • '4' - 2x2 grid
  • '8' - 8 charts
  • Custom layouts

SyncSettings

Synchronization settings between panels.

Properties:

PropertyTypeDescription
symbolbooleanSync symbols
intervalbooleanSync intervals
crosshairbooleanSync crosshair
timeRangebooleanSync time range

Alert Interfaces

Alert

Complete alert definition.

Properties:

PropertyTypeDescription
idstringUnique alert ID
symbolstringSymbol ticker
tickerstringTicker symbol
resolutionstringTimeframe
timeframestringTime period
conditionAlertConditionAlert condition
optionsAlertOptionsTrigger options
actionsAlertActionsNotification actions
stateAlertStateAlert state
contextAlertContextChart context
activebooleanIs alert active
namestring?Alert name
messagestring?Alert message
expirationstring?Expiration date

Example:

const alert = {
id: 'alert_123',
symbol: 'AAPL',
ticker: 'AAPL',
resolution: '1D',
condition: {
leftOperand: 'close',
operator: 'greater than',
rightOperand: 150
},
options: {
trigger: 'on_bar_close',
once: false
},
actions: {
popup: true,
sound: true,
email: false
},
active: true,
name: 'AAPL > $150',
message: 'Apple stock crossed $150'
};

AlertOperator

Available comparison operators for alerts.

Values:

  • 'greater than' - Price > value
  • 'less than' - Price < value
  • 'greater than or equal' - Price >= value
  • 'less than or equal' - Price <= value
  • 'crosses above' - Price crosses above value
  • 'crosses below' - Price crosses below value
  • 'crosses' - Price crosses value (either direction)
  • 'equals' - Price = value
  • 'entering channel' - Price enters range
  • 'exiting channel' - Price exits range
  • 'inside channel' - Price is inside range
  • 'outside channel' - Price is outside range
  • 'moving up' - Price moving up
  • 'moving down' - Price moving down
  • 'moving up percent' - % increase
  • 'moving down percent' - % decrease

AlertTrigger

When the alert should trigger.

Values:

  • 'on_bar_close' - Trigger when bar closes
  • 'on_tick' - Trigger on every price change
  • 'once_per_bar' - Trigger once per bar

AlertCondition

Alert condition definition.

Properties:

PropertyTypeDescription
leftOperandstringWhat to compare (e.g., 'close', 'high')
operatorAlertOperatorComparison operator
rightOperandstring | numberValue to compare against

AlertActions

Notification actions when alert triggers.

Properties:

PropertyTypeDescription
popupbooleanShow popup notification
soundbooleanPlay sound
webhookstring?Webhook URL
emailbooleanSend email

AlertState

Alert tracking state.

Properties:

PropertyTypeDescription
lastValuenumberLast checked value
triggeredbooleanHas been triggered
lastTriggerednumber?Last trigger timestamp
triggerCountnumber?Number of triggers

AlertContext

Alert creation context.

Properties:

PropertyTypeDescription
chart_idstringChart ID
pane_idstringPane ID
created_atstringCreation timestamp

Crosshair Interfaces

CrosshairPosition

Basic crosshair position.

Properties:

PropertyTypeDescription
xnumberX coordinate (pixels)
ynumberY coordinate (pixels)

CrosshairSnappedPosition

Crosshair snapped to a bar.

Properties:

PropertyTypeDescription
xnumberX position (pixels)
ynumberY position (pixels)
barIndexnumberSnapped bar index
timenumberSnapped bar timestamp

CrosshairMode

Crosshair display mode.

Values:

  • 'normal' - Full crosshair (horizontal + vertical)
  • 'x-only' - Only vertical line
  • 'y-only' - Only horizontal line
  • 'hidden' - Crosshair hidden

CrosshairStyle

Crosshair visual styling.

Properties:

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width
modeCrosshairMode?Display mode
lineStylestring?'dotted', 'dashed', 'solid'

Export Interfaces

ExportOptions

Screenshot and export configuration.

Properties:

PropertyTypeDescription
includeWatermarkboolean?Include watermark
includeLegendboolean?Include legend
themestring?'light' or 'dark'
widthnumber?Image width
heightnumber?Image height
scopeExportScope?Export scope
panelIdstring?Panel ID (for panel scope)
pixelRationumber?Pixel ratio for retina
filenamestring?Output filename

Example:

const options = {
includeWatermark: false,
includeLegend: true,
theme: 'dark',
width: 1920,
height: 1080,
scope: 'active',
pixelRatio: 2,
filename: 'chart-screenshot'
};

ExportScope

What to export.

Values:

  • 'workspace' - Entire workspace (all panels)
  • 'active' - Only active panel
  • 'panel' - Specific panel

ScreenshotOptions

Basic screenshot options (base for ExportOptions).

Properties:

PropertyTypeDescription
includeWatermarkboolean?Include watermark
includeLegendboolean?Include legend
themestring?'light' or 'dark'
widthnumber?Image width
heightnumber?Image height

Layout Interfaces

Pane

Chart pane (panel) definition.

Properties:

PropertyTypeDescription
idnumberPane ID
isMainbooleanIs main price pane
ordernumberDisplay order
topnumberTop position (pixels)
heightnumberHeight (pixels)
widthnumberWidth (pixels)
visiblebooleanIs visible
seriesstring[]Series IDs in pane
indicatorsPaneIndicator[]Indicators in pane
drawingsDrawing[]Drawings in pane
needsRedrawbooleanNeeds redraw
dirtyStateobjectWhat needs redraw
optionsPaneOptionsPane options

PaneIndicator

Indicator in a pane.

Properties:

PropertyTypeDescription
idstringIndicator ID
namestringIndicator name
seriesIndicatorSeriesBindingSeries binding

PaneOptions

Pane configuration.

Properties:

PropertyTypeDescription
backgroundColorstringBackground color
showGridbooleanShow grid lines
autoScalebooleanAuto scale enabled
scaleMarginsobjectTop/bottom margins

Example:

const paneOptions = {
backgroundColor: '#ffffff',
showGrid: true,
autoScale: true,
scaleMargins: { top: 0.1, bottom: 0.1 }
};

PanelDimensions

Panel size and position.

Properties:

PropertyTypeDescription
xnumberX position
ynumberY position
widthnumberPanel width
heightnumberPanel height
topnumberTop offset
bottomnumberBottom offset

ChartLayout

Complete chart layout.

Properties:

PropertyTypeDescription
mainChartPanelDimensionsMain chart dimensions
panelsMap<string, PanelDimensions>All panels
totalHeightnumberTotal height
reservedPanelSpacenumberReserved space

PaneInteractionState

Pane interaction tracking.

Properties:

PropertyTypeDescription
isPanningbooleanIs panning
isPriceScaleDraggingbooleanIs dragging price scale
lastYnumberLast Y position
interactionModestringCurrent mode
cursorstringCursor type
crosshairanyCrosshair state

ContainerDimensions

Container size.

Properties:

PropertyTypeDescription
widthnumberContainer width
heightnumberContainer height

Layout Adapter Interfaces

LayoutData

Complete layout data for save/load.

Properties:

PropertyTypeDescription
idstring?Layout ID
namestring?Layout name
layoutTypeLayoutTypeLayout type
panelRatiosPanelRatio[]?Panel size ratios
panelsLayoutPanelData[]Panel data
themeITheme?Theme
linkGroupsarray?Sync groups
activePanelIdstring?Active panel
createdAtnumber?Creation time
updatedAtnumber?Last update time
versionstring?Version

LayoutPanelData

Individual panel data.

Properties:

PropertyTypeDescription
idstringPanel ID
symbolSymbolState | stringSymbol
intervalstring?Timeframe
chartTypeSeriesType | string?Chart type
indicatorsLayoutPanelIndicator[]?Indicators
drawingsIDrawing[]?Drawings
compareSymbolsCompareSeries[]?Compare symbols
timezonestring?Timezone
linkGroupstring?Sync group ID

LayoutPanelIndicator

Indicator in layout panel.

Properties:

PropertyTypeDescription
idstring?Indicator ID
namestringIndicator name
optionsIndicatorOptions?Options
visibleboolean?Visibility
paneIdnumber?Pane ID

LayoutSummary

Layout summary for listing.

Properties:

PropertyTypeDescription
idstringLayout ID
namestringLayout name
layoutTypeLayoutType?Layout type
updatedAtnumber?Last update

LayoutAdapter

Interface for layout save/load operations.

Methods:

  • saveLayout(layoutData) - Save layout
  • loadLayout(layoutId) - Load layout
  • removeLayout(layoutId) - Delete layout
  • getLayouts() - Get all layouts
  • renameLayout(layoutId, newName) - Rename layout
  • autosaveLayout(layoutId, layoutData) - Auto-save layout

ExternalSaveLoadAdapter

Extended adapter for all persistence operations.

Methods:

  • All LayoutAdapter methods
  • saveChartTemplate(template) - Save chart template
  • getChartTemplates() - Get chart templates
  • loadChartTemplate(templateId) - Load chart template
  • removeChartTemplate(templateId) - Delete chart template
  • saveStudyTemplate(template) - Save study template
  • getStudyTemplates() - Get study templates
  • removeStudyTemplate(templateId) - Delete study template
  • applyStudyTemplate(templateId) - Apply study template
  • saveDrawing(drawing) - Save drawing
  • loadDrawings(symbol) - Load drawings
  • getAllDrawings() - Get all drawings
  • updateDrawing(drawing) - Update drawing
  • removeDrawing(drawingId) - Delete drawing

Market Profile Interfaces

MarketProfileConfig

Market profile (TPO) configuration.

Properties:

PropertyTypeDescription
profileTypeMarketProfileType?Profile type
bracketMinutesnumber?15, 30, or 60
valueAreaPercentnumber?Value area %
rowSizeTicksnumber?Row size in ticks
placementMarketProfilePlacement?'left' or 'right'
displayModeMarketProfileDisplayMode?'letters', 'blocks', 'adaptive'
showPOCboolean?Show Point of Control
showVAHVALboolean?Show VAH/VAL
showIBboolean?Show Initial Balance
showSinglePrintsboolean?Show single prints
showExcessboolean?Show excess tails
rthEthModeMarketProfileRthEthMode?'rth', 'eth', 'combined'
periodicPeriodMarketProfilePeriodicPeriod?'D', 'W', 'M'

MarketProfileType

Profile calculation type.

Values:

  • 'session' - Per session
  • 'fixed_range' - Fixed range
  • 'composite' - Composite multiple sessions
  • 'periodic' - Periodic (daily/weekly/monthly)

MarketProfilePlacement

Profile display placement.

Values:

  • 'left' - Left side of chart
  • 'right' - Right side of chart

MarketProfileDisplayMode

How to display TPO letters.

Values:

  • 'letters' - Show letters
  • 'blocks' - Show blocks
  • 'adaptive' - Adaptive display

MarketProfileLevels

Key market profile levels.

Properties:

PropertyTypeDescription
pocnumber | nullPoint of Control
vahnumber | nullValue Area High
valnumber | nullValue Area Low
ibHighnumber | nullInitial Balance High
ibLownumber | nullInitial Balance Low
singlePrintsarraySingle print levels
excessTailsarrayExcess tail levels

TpoRow

Single TPO price row.

Properties:

PropertyTypeDescription
pricenumberPrice level
lettersstring[]TPO letters
bracketIndicesnumber[]Bracket indices
countnumberTPO count
isValueAreabooleanIn value area
isPocbooleanIs POC
isSinglePrintbooleanIs single print

MarketProfileResult

Complete market profile calculation result.

Properties:

PropertyTypeDescription
rowsTpoRow[]All TPO rows
levelsMarketProfileLevelsKey levels
totalTposnumberTotal TPO count
maxTposPerRownumberMax TPOs in a row
rowSizenumberRow size
startTimenumberStart time
endTimenumberEnd time
bracketsarrayTime brackets

MarketProfile

Market profile instance.

Properties:

PropertyTypeDescription
idstringProfile ID
profileTypeMarketProfileTypeProfile type
visiblebooleanIs visible
configMarketProfileConfigConfiguration

Volume Profile Interfaces

VolumeProfileConfig

Volume profile configuration.

Properties:

PropertyTypeDescription
profileTypeProfileType?Profile type
valueAreaPercentnumber?Value area %
bucketSizeMultipliernumber?Bucket size
profileWidthPercentnumber?Width %
placementVolumeProfilePlacement?'left', 'right', 'overlay'
showPOCboolean?Show POC
showVAHVALboolean?Show VAH/VAL
rollingBarsnumber?Rolling window bars
periodicPeriodVolumeProfilePeriodicPeriod?'D', 'W', 'M'

ProfileType

Volume profile type.

Values:

  • 'visible_range' - Current visible range
  • 'fixed_range' - User-selected range
  • 'session' - Per session
  • 'anchored' - Anchored to point
  • 'periodic' - Periodic
  • 'rolling' - Rolling window

VolumeProfilePlacement

Profile placement.

Values:

  • 'left' - Left side
  • 'right' - Right side
  • 'overlay' - Overlay on chart

VolumeProfileBin

Single volume bin.

Properties:

PropertyTypeDescription
pricenumberPrice level
volumenumberVolume at price
percentnumberPercentage of total
isValueAreabooleanIn value area

ProfileLevels

Volume profile levels.

Properties:

PropertyTypeDescription
pocnumber | nullPoint of Control
vahnumber | nullValue Area High
valnumber | nullValue Area Low
developingPocnumber | nullDeveloping POC

VolumeProfileResult

Volume profile calculation result.

Properties:

PropertyTypeDescription
binsVolumeProfileBin[]All volume bins
levelsProfileLevelsKey levels
totalVolumenumberTotal volume
maxVolumenumberMax volume in a bin
bucketSizenumberBucket size
rangeStartTimenumberRange start
rangeEndTimenumberRange end

VolumeProfile

Volume profile instance.

Properties:

PropertyTypeDescription
idstringProfile ID
profileTypeProfileTypeProfile type
visiblebooleanIs visible
configVolumeProfileConfigConfiguration

Order Flow (Footprint) Interfaces

FootprintConfig

Footprint chart configuration.

Properties:

PropertyTypeDescription
typeFootprintTypeFootprint type
layoutFootprintLayoutDisplay layout
rowSizeModeFootprintRowSizeModeRow size mode
rowSizeTicksnumberRow size in ticks
showImbalancebooleanShow imbalances
showDeltabooleanShow delta
showTotalbooleanShow totals
imbalanceRationumberImbalance ratio
fontSizenumberFont size
rowHeightPxnumberRow height

FootprintType

Footprint display type.

Values:

  • 'bid_ask' - Bid/ask volumes
  • 'volume' - Total volume
  • 'delta' - Delta (buy - sell)
  • 'imbalance' - Volume imbalances

FootprintLayout

Cell layout.

Values:

  • 'side_by_side' - Buy/sell side by side
  • 'diagonal' - Diagonal split
  • 'histogram_overlay' - Histogram overlay

FootprintRow

Single price row in footprint.

Properties:

PropertyTypeDescription
pricenumberPrice level
buyValuenumberBuy volume
sellValuenumberSell volume
totalValuenumberTotal volume
deltanumberDelta
isPocbooleanIs POC
isValueAreabooleanIn value area
isBullishImbalancebooleanBullish imbalance
isBearishImbalancebooleanBearish imbalance

FootprintBarData

Complete footprint bar data.

Properties:

PropertyTypeDescription
barIndexnumberBar index
startTimenumberStart time
endTimenumberEnd time
isFinalbooleanIs bar complete
rowsFootprintRow[]Price rows
volumenumberTotal volume
barDeltanumberBar delta
pocPricenumberPOC price
opennumberOpen
highnumberHigh
lownumberLow
closenumberClose

Pattern Recognition Interfaces

DetectedPattern

A detected chart pattern.

Properties:

PropertyTypeDescription
idstringPattern ID
patternIdstringPattern type ID
namestringPattern name
startIndexnumberStart bar index
endIndexnumberEnd bar index
startTimenumberStart time
startPricenumberStart price
pointsPatternPoint[]Pattern points
confidencenumberConfidence (0-100)
statusstring'forming', 'confirmed', 'failed'
stylePatternStylesVisual style
metadataobject?Additional metadata

Example:

const pattern = {
id: 'pattern_123',
patternId: 'bearish_flag',
name: 'Bearish Flag',
startIndex: 50,
endIndex: 75,
confidence: 85,
status: 'confirmed',
points: [
{ barIndex: 50, time: 1234567890000, price: 150, type: 'flagpole_start' },
{ barIndex: 60, time: 1234567890000, price: 160, type: 'flagpole_end' }
],
metadata: {
breakoutDirection: 'bearish',
targetPrice: 140,
stopLossPrice: 165
}
};

PatternPoint

Point in a pattern.

Properties:

PropertyTypeDescription
barIndexnumberBar index
timenumberTimestamp
pricenumberPrice
typestring?Point type
labelstring?Display label

PatternInputs

Pattern detection inputs.

Properties:

PropertyTypeDescription
minConfidencenumberMinimum confidence (0-100)
sensitivitynumberSensitivity (0-1)
lookbackPeriodnumberBars to analyze
volumeConfirmationbooleanRequire volume confirmation

PatternStyles

Pattern visual styles.

Properties:

PropertyTypeDescription
colorstringLine color
lineWidthnumberLine width (1-10)
fillColorstringBackground fill
labelBgColorstring?Label background
showLabelsbooleanShow labels

PatternCategory

Pattern category.

Values:

  • 'candlestick' - Candlestick patterns
  • 'chart' - Chart patterns
  • 'harmonic' - Harmonic patterns

PatternInputDefinition

Pattern input parameter definition.

Properties:

PropertyTypeDescription
namestringInput name
typestring'number', 'string', 'boolean', 'color'
defaultValueanyDefault value
optionsstring[]?Options (for select)
minnumber?Minimum value
maxnumber?Maximum value
stepnumber?Step value
descriptionstring?Description

IPatternDetector

Interface for pattern detectors.

Methods:

  • detect(dataSeries) - Detect patterns in data
  • validate(pattern) - Validate a pattern
  • calculateConfidence(pattern) - Calculate confidence score

Properties:

PropertyTypeDescription
idstringDetector ID
namestringDisplay name
categoryPatternCategoryPattern category
enabledbooleanIs enabled
sensitivitynumberSensitivity (0-1)
minConfidencenumberMin confidence

ChartPattern

Pattern stored in state.

Properties:

Extends DetectedPattern with:

PropertyTypeDescription
paneIdstringPane ID
visiblebooleanIs visible
typestring?Pattern type
symbolstring?Symbol
resolutionstring?Resolution

Module Interfaces

KeyboardConfig

Keyboard shortcut configuration.

Properties:

All properties are string arrays for key combinations:

  • deleteKey - Delete drawings
  • undoKey - Undo
  • redoKey - Redo
  • selectAllKey - Select all
  • deselectAllKey - Deselect all
  • copyKey - Copy
  • pasteKey - Paste
  • deactivateKey - Deactivate tool
  • exitAllKey - Exit all tools
  • quickSearchKey - Quick search
  • indicatorsKey - Add indicators
  • panLeftKey - Pan left
  • panRightKey - Pan right
  • zoomInKey - Zoom in
  • zoomOutKey - Zoom out
  • resetScaleKey - Reset scale
  • logScaleKey - Toggle log scale
  • trendLineKey - Trend line tool
  • horizontalLineKey - Horizontal line
  • downloadImageKey - Download image
  • copyImageKey - Copy image
  • drawingToolKeys - Drawing tool shortcuts

PeriodInfo

Timeframe information.

Properties:

PropertyTypeDescription
codestringPeriod code (e.g., '1D', '1H')
secondsnumberSeconds in period
displayNamestringDisplay name
groupstring'intra', 'daily', 'weekly', 'monthly', 'tick'
labelstring?Custom label

TimezoneInfo

Timezone information.

Properties:

PropertyTypeDescription
namestringIANA timezone name
offsetnumberUTC offset in minutes
labelstringDisplay label
abbrstringAbbreviation (EST, PST, etc.)

Example:

const tz = {
name: 'America/New_York',
offset: -300,
label: 'America/New_York (UTC-05:00)',
abbr: 'EST'
};

SessionInfo

Trading session information.

Properties:

PropertyTypeDescription
sessionStringstringSession time string
sessionModestring'regular', 'extended', 'continuous'
enabledbooleanIs session filter enabled

Model Interfaces

VirtualBar

Virtual bar for rendering.

Properties:

PropertyTypeDescription
indexnumberBar index
timenumber?Timestamp
isEmptyboolean?Is empty bar

LogicalRange

Logical bar range.

Properties:

PropertyTypeDescription
fromnumberStart index
tonumberEnd index

XTick

X-axis tick mark.

Properties:

PropertyTypeDescription
indexnumber?Bar index
xnumberX position
timenumber?Timestamp
labelstring?Display label
isStrongboolean?Is strong tick

VisibleRange

Visible bar range.

Properties:

PropertyTypeDescription
startnumberStart index
endnumberEnd index

PriceRange

Price range.

Properties:

PropertyTypeDescription
minnumberMinimum price
maxnumberMaximum price

ChartDimensions

Chart size.

Properties:

PropertyTypeDescription
widthnumberWidth in pixels
heightnumberHeight in pixels

MousePosition

Mouse coordinates.

Properties:

PropertyTypeDescription
xnumberX coordinate
ynumberY coordinate

Measurement Interfaces

MeasurementResult

Measurement tool result.

Properties:

PropertyTypeDescription
typestring'distance', 'price', 'time', 'risk_reward'
valuenumberMeasured value
unitstringUnit of measurement
labelstringDisplay label
startPointDrawingPointStart point
endPointDrawingPointEnd point
metadataobject?Additional data

Example:

const measurement = {
type: 'price',
value: 10.50,
unit: 'USD',
label: 'Price: $10.50',
startPoint: { time: 1234567890000, price: 140, barIndex: 50 },
endPoint: { time: 1234567890000, price: 150.50, barIndex: 100 }
};

Compare Series Interfaces

CompareSeries

Symbol comparison data.

Properties:

PropertyTypeDescription
idstringCompare ID
symbolstringSymbol ticker
symbolInfoSymbolStateSymbol metadata
dataPriceData[]Price data
colorstringLine color
lineWidthnumber?Line width
lineStylenumber?0: Solid, 1: Dotted, 2: Dashed
visiblebooleanIs visible
loadingbooleanIs loading
errorstring?Error message
paneIdstringPane ID
typestring'overlay' or 'new'
dataSeriesIdstringData series ID
seriesIdstring | nullSeries ID

UI State Interfaces

UIState

UI visibility state.

Properties:

PropertyTypeDescription
leftSidebarVisiblebooleanLeft sidebar visible
rightSidebarVisiblebooleanRight sidebar visible
bottomToolbarVisiblebooleanBottom toolbar visible
activeToolstring | nullCurrently active tool
isFullscreenbooleanIs fullscreen

OverlayState

Overlay content state.

Properties:

PropertyTypeDescription
indicatorsIStoreIndicator[]Active indicators
drawingsarrayActive drawings

Throttle Type

Throttle

Throttle function type.

Definition:

type Throttle<T extends (...args: any[]) => any> = (
...args: Parameters<T>
) => void;

Usage:

const throttledHandler: Throttle<(x: number, y: number) => void> =
throttle(handleMouse, 100);

Canvas Layer Interfaces

CanvasLayer

Canvas rendering layer.

Properties:

PropertyTypeDescription
canvasHTMLCanvasElementCanvas element
contextCanvasRenderingContext2D2D rendering context

CanvasLayerType

Available canvas layer types.

Values:

  • 'grid' - Grid layer
  • 'candle' - Candlestick layer
  • 'indicators' - Indicator layer
  • 'patterns' - Pattern layer
  • 'drawings' - Drawing layer
  • 'tradingOverlay' - Trading overlay layer
  • 'ui' - UI layer
  • 'priceScale' - Price scale layer
  • 'timeScale' - Time scale layer
  • 'compare' - Compare symbols layer

Chart State Interfaces

ChartState

Complete chart state.

Properties:

PropertyTypeDescription
timeScaleTimeScaleStateTime scale configuration
priceScalePriceScaleStatePrice scale configuration
crosshairCrosshairStateCrosshair state
tooltipTooltipStateTooltip state
overlaysOverlayStateIndicators and drawings
uiUIStateUI visibility state
dataPriceData[]Chart data
chartTypeSeriesTypeChart type
visible_plots_setstring'ohlc', 'ohlcv', or 'c'
seriesMap<string, any>Data series
compareSymbolsCompareSeries[]Compare symbols
dataFeedConfigDataFeedConfiguration | nullDatafeed config
timezonestringChart timezone
priceScalePositionstring'left' or 'right'
interactionModestringInteraction mode
cursorModestringCursor mode
interactionSubStateobjectDetailed interaction state
sessionobjectSession settings
drawingsobjectDrawing state
alertsAlert[]Active alerts
notificationsNotification[]Notifications
patternsChartPattern[]Patterns
visibilityobjectVisibility settings
replayobjectReplay state
tradeobjectTrade panel state
panesPane[]All panes
activePaneIdnumber | nullActive pane ID
dimensionsobjectDimensions
timeContextsobject?Time contexts
zoomPanobjectZoom/pan state
watchlistsobjectWatchlist state
exchangeCalendarsRecord<string, ExchangeCalendarData>Calendars
workspaceobject?Workspace state

ChartAction

Chart state action types.

Actions:

  • SET_SYMBOL - Set symbol
  • SET_INTERVAL - Set timeframe
  • SET_TIME_SCALE - Set time scale
  • SET_PRICE_SCALE - Set price scale
  • UPDATE_PANE_SCALES - Update pane scales
  • UPDATE_CROSSHAIR - Update crosshair
  • SET_CROSSHAIR_MODE - Set crosshair mode
  • SET_CROSSHAIR_VISIBLE - Toggle crosshair visibility
  • SET_TOOLTIP_VISIBLE - Toggle tooltip visibility
  • ADD_INDICATOR - Add indicator
  • REMOVE_INDICATOR - Remove indicator
  • SET_THEME - Set theme
  • TOGGLE_LEFT_SIDEBAR - Toggle left sidebar
  • TOGGLE_RIGHT_SIDEBAR - Toggle right sidebar
  • TOGGLE_BOTTOM_TOOLBAR - Toggle bottom toolbar
  • SET_ACTIVE_TOOL - Set active tool
  • SET_FULLSCREEN - Toggle fullscreen
  • SET_DATA - Set chart data
  • SET_CHART_TYPE - Set chart type
  • SET_TIMEZONE - Set timezone
  • SET_PRICE_SCALE_POSITION - Set price scale position
  • SET_INTERACTION_MODE - Set interaction mode
  • SET_CURSOR_MODE - Set cursor mode
  • SET_HOVER_STATE - Set hover state
  • SET_SELECTING_STATE - Set selection state
  • SET_ERROR_STATE - Set error state
  • CLEAR_ERROR_STATE - Clear error state
  • SET_SESSION - Set session
  • SET_SESSION_MODE - Set session mode
  • TOGGLE_SESSION - Toggle session
  • ADD_DRAWING - Add drawing
  • REMOVE_DRAWING - Remove drawing
  • UPDATE_DRAWING - Update drawing
  • SELECT_DRAWING - Select drawing
  • HOVER_DRAWING - Hover drawing
  • SELECT_DRAWINGS - Select multiple drawings
  • ADD_SELECTED_DRAWING - Add to selection
  • REMOVE_SELECTED_DRAWING - Remove from selection
  • CLEAR_SELECTED_DRAWINGS - Clear selections
  • SET_ACTIVE_DRAWING_TOOL - Set drawing tool
  • SET_DRAWING_STYLE - Set drawing style
  • SET_DRAWING_SNAP_CONFIG - Set snap config
  • CLEAR_DRAWINGS - Clear all drawings
  • CLEAR_INDICATORS - Clear indicators
  • SCALES_CHANGED - Scales changed
  • ADD_ALERT - Add alert
  • REMOVE_ALERT - Remove alert
  • UPDATE_ALERT - Update alert
  • LOAD_ALERTS - Load alerts
  • ADD_NOTIFICATION - Add notification
  • REMOVE_NOTIFICATION - Remove notification
  • CLEAR_ALL_NOTIFICATIONS - Clear all notifications
  • ADD_PANE - Add pane
  • REMOVE_PANE - Remove pane
  • UPDATE_PANE - Update pane
  • RESET_STATE - Reset state
  • UPDATE_DIMENSIONS - Update dimensions
  • ADD_SERIES - Add series
  • REMOVE_SERIES - Remove series
  • UPDATE_SERIES - Update series
  • UPDATE_ZOOM_PAN_STATE - Update zoom/pan state
  • RESET_ZOOM_PAN_STATE - Reset zoom/pan state
  • ADD_WATCHLIST - Add watchlist
  • REMOVE_WATCHLIST - Remove watchlist
  • UPDATE_WATCHLIST - Update watchlist
  • SET_WATCHLISTS - Set watchlists
  • ADD_SYMBOL_TO_WATCHLIST - Add symbol to watchlist
  • REMOVE_SYMBOL_FROM_WATCHLIST - Remove symbol from watchlist
  • UPDATE_WATCHLIST_SYMBOL_DETAILS - Update symbol details
  • SET_ACTIVE_WATCHLIST_ID - Set active watchlist
  • UPDATE_INDICATOR_VISIBILITY - Update indicator visibility
  • UPDATE_INDICATOR - Update indicator
  • UPDATE_VISIBILITY_SETTINGS - Update visibility settings
  • ADD_PATTERN - Add pattern
  • REMOVE_PATTERN - Remove pattern
  • UPDATE_PATTERN - Update pattern
  • UPDATE_PATTERN_MATCHES - Update pattern matches
  • CLEAR_PATTERNS - Clear patterns
  • SET_PATTERN_VISIBILITY - Set pattern visibility
  • SET_EXCHANGE_CALENDARS - Set exchange calendars
  • SET_DATAFEED_CONFIG - Set datafeed config
  • SET_ENABLED_RESOLUTION - Set enabled resolutions
  • SET_WORKSPACE_ID - Set workspace ID
  • SET_ACTIVE_PANEL - Set active panel
  • SET_SYNC_MODE - Set sync mode
  • SET_LAYOUT_TYPE - Set layout type
  • UPDATE_PANEL_RATIOS - Update panel ratios

Pattern Stubs Interfaces

ChartPattern

Pattern stub interface (API compatibility).

Properties:

PropertyTypeDescription
idstringPattern ID
typePatternTypePattern type
namestringPattern name
symbolstringSymbol
resolutionstringResolution
visiblebooleanIs visible
showLabelboolean?Show label
showConfidenceboolean?Show confidence
showTargetboolean?Show target
matchesany[]?Pattern matches
styleany?Style
configany?Configuration

PatternMatch

Pattern match result.

Properties:

PropertyTypeDescription
idstringMatch ID
patternIdstringPattern ID
startIndexnumberStart bar index
endIndexnumberEnd bar index
startTimenumberStart timestamp
endTimenumberEnd timestamp
startPricenumberStart price
endPricenumberEnd price
confidencenumberConfidence score
statusstring'active', 'completed', 'failed', 'expired'
targetPricenumber?Target price

PatternDefinition

Pattern definition.

Properties:

PropertyTypeDescription
typePatternTypePattern type
namestringPattern name
categorystringCategory
descriptionstring?Description

PatternConfig

Pattern configuration.

Properties:

PropertyTypeDescription
minConfidencenumber?Minimum confidence
minCompletionnumber?Minimum completion
swingLookbacknumber?Swing lookback
priceTolerancenumber?Price tolerance
timeTolerancenumber?Time tolerance
2799→minDurationnumber?
2800→maxDurationnumber?
2801→
2802→---

PatternManager

Pattern manager stub class (empty implementation for API compatibility).

Methods:

  • scanPatterns() - Scan for patterns (no-op)
  • getPatterns() - Get current patterns (returns empty array)
  • addPattern(pattern) - Add pattern (no-op)
  • removePattern(id) - Remove pattern (no-op)
  • updatePattern(id, updates) - Update pattern (no-op)
  • setPatternVisibility(id, visible) - Set pattern visibility (no-op)
  • clearPatterns() - Clear all patterns (no-op)

Note: Pattern detection has been removed from the charting library. This class is maintained for API compatibility only.


Store Interfaces

ISeries

Series interface.

Properties:

PropertyTypeDescription
seriesTypeSeriesTypeSeries type
isUsedDerivedDatabooleanWhether derived data is used
getIsUsedDerivedData()functionGet derived data usage
setIsUsedDerivedData()functionSet derived data usage
getVisibleBars()functionGet visible bars
getLogicalRange()functionGet logical range
getRealBar()functionGet real bar
getBar()functionGet bar
getBarSpacing()functionGet bar spacing
invalidateCache()functionInvalidate cache
handleDerivedData()functionHandle derived data
getDerivedBar()functionGet derived bar
getDerivedBars()functionGet derived bars

IStoreIndicator

Stored indicator interface.

Properties:

PropertyTypeDescription
idstringIndicator ID
namestringIndicator name
metaInfoIndicatorMetadataMetadata
instanceanyInstance
seriesBindingIndicatorSeriesBindingSeries binding
inputsIndicatorInputDefinition[]Inputs
stylesIndicatorStyleDefinition[]Styles
optionsIndicatorOptionsOptions
visiblebooleanIs visible

OverlayState

Overlay state interface.

Properties:

PropertyTypeDescription
indicatorsIStoreIndicator[]Indicators
drawingsobject[]Drawings array
drawings[].idstringDrawing ID
drawings[].typestringDrawing type
drawings[].pointsobject[]Points array
drawings[].points[].xnumberX coordinate
drawings[].points[].ynumberY coordinate
drawings[].optionsRecord<string, any>Options

CompareSeries

Compare series interface.

Properties:

PropertyTypeDescription
idstringSeries ID
symbolstringSymbol
symbolInfoSymbolStateSymbol info
dataPriceData[]Data
colorstringColor
lineWidthnumber?Line width
lineStylenumber?Line style (0=solid, 1=dotted, 2=dashed)
visiblebooleanIs visible
loadingbooleanIs loading
errorstring?Error message
paneIdstringPane ID
typestring'overlay' or 'new'
dataSeriesIdstringData series ID
seriesIdstring | nullSeries ID

ThemeState

Theme state interface.

Description: Extends ITheme interface.

UIState

UI state interface.

Properties:

PropertyTypeDescription
leftSidebarVisiblebooleanLeft sidebar visibility
rightSidebarVisiblebooleanRight sidebar visibility
bottomToolbarVisiblebooleanBottom toolbar visibility
activeToolstring | nullActive tool
isFullscreenbooleanFullscreen state

UILayerState

UI layer state interface.

Properties:

PropertyTypeDescription
crosshairCrosshairStateCrosshair state
tooltipTooltipStateTooltip state

SymbolState

Symbol state interface.

Properties:

PropertyTypeDescription
symbol_namestringSymbol name
tokenstringToken
exchangestringExchange
descriptionstringDescription
ticksizenumberTick size
lotsizenumberLot size
tickerstringTicker
precisionnumberPrecision
imgstring | HTMLElementImage
is_tradablebooleanIs tradable
typestring?Type
sessionstring?Session
timezonestring?Timezone
supported_resolutionsstring[]?Supported resolutions

TimeScaleState

Time scale state interface.

Properties:

PropertyTypeDescription
startnumberStart time
endnumberEnd time
fromnumber?From time
tonumber?To time
barSpacingnumber?Bar spacing
scrollOffsetnumber?Scroll offset

PriceScaleState

Price scale state interface.

Properties:

PropertyTypeDescription
minnumberMinimum price
maxnumberMaximum price
autoScalebooleanAuto scale
logScalebooleanLog scale
percentageScalebooleanPercentage scale
invertedbooleanInverted

CrosshairState

Crosshair state interface.

Properties:

PropertyTypeDescription
xnumberX position
ynumberY position
visiblebooleanIs visible
modestring'normal', 'x-only', 'y-only', 'hidden'
isInBoundarybooleanIs in boundary
barIndexnumber?Bar index
timenumber?Timestamp
pricenumber?Price
paneIdstring?Pane ID

TooltipState

Tooltip state interface.

Properties:

PropertyTypeDescription
visiblebooleanIs visible
xnumber?X position
ynumber?Y position

Data Feed Interfaces

IBasicDataFeed

Basic data feed interface for connecting to external data sources.

Methods:

  • onReady(callback) - Called when charting library is ready to initialize
  • resolveSymbol(symbolName, onResolve, onError) - Resolve symbol to metadata
  • searchSymbols(userInput, exchange, symbolType, onResult) - Search for symbols
  • getBars(symbolInfo, resolution, from, to, onResult, onError) - Fetch historical bars
  • subscribeBars(symbolInfo, resolution, onRealtimeCallback, subscriberUID, onResetCacheNeededCallback) - Subscribe to real-time updates
  • unsubscribeBars(subscriberUID) - Unsubscribe from real-time updates
  • subscribeDepth(symbolInfo, onDataCallback, subscriberUID) - Subscribe to depth data
  • unsubscribeDepth(subscriberUID) - Unsubscribe from depth data
  • onTrade(action_type, price, quantity, symbol_info) - Handle trade events
  • createWatchlist(name, symbols, callback) - Create new watchlist
  • deleteWatchlist(id, callback) - Delete watchlist
  • addSymbolToWatchlist(watchlistId, symbol, callback) - Add symbol to watchlist
  • deleteSymbolFromWatchlist(watchlistId, symbolId, callback) - Remove symbol from watchlist
  • getWatchlists(callback) - Get all watchlists
  • getSymbolDetails(symbols, callback) - Get symbol details
  • subscribeSymbolDetails(symbols, callback, subscriberUID) - Subscribe to symbol details
  • unsubscribeSymbolDetails(subscriberUID) - Unsubscribe from symbol details
  • createAlert(alert, callback) - Create alert
  • getAlerts(callback) - Get alerts
  • updateAlert(alertId, alert, callback) - Update alert
  • deleteAlert(alertId, callback) - Delete alert
  • loadExchangeCalendars() - Load exchange calendar data

DataFeedConfiguration

Data feed configuration returned by onReady.

Properties:

PropertyTypeDescription
supports_searchboolean?Supports search functionality
supports_group_requestboolean?Supports group requests
supports_marksboolean?Supports marks/annotations
supports_timescale_marksboolean?Supports timescale marks
supports_timeboolean?Supports time-based queries
exchangesobject[]?Available exchanges
symbols_typesobject[]?Available symbol types
supported_resolutionsstring[]Supported timeframes

SymbolInfo

Symbol metadata interface.

Properties:

PropertyTypeDescription
namestringSymbol name
full_namestring?Full name
tickerstring?Ticker
descriptionstring?Description
typestring?Type (stock, crypto, forex)
sessionstring?Trading session
exchangestring?Exchange
minmovnumber?Minimum movement
pricescalenumber?Price scale
has_intradayboolean?Has intraday data
supported_resolutionsstring[]?Supported resolutions

Bar

Historical bar interface.

Properties:

PropertyTypeDescription
timenumberTimestamp in milliseconds
opennumberOpen price
highnumberHigh price
lownumberLow price
closenumberClose price
volumenumber?Volume
openInterestnumber?Open interest
totalValuenumber?Total value (footprint)
deltanumber?Delta (footprint)
pocPricenumber?Point of control price
levelsobject?Level data

DepthLevel

Depth level interface.

Properties:

PropertyTypeDescription
pricenumberPrice level
ordersnumberNumber of orders
quantitynumberQuantity at price

DepthData

Depth data interface.

Properties:

PropertyTypeDescription
bidsDepthLevel[]Bid levels
asksDepthLevel[]Ask levels
opennumber?Open price
highnumber?High price
lownumber?Low price
closenumber?Close price
volumenumber?Volume
open_interestnumber?Open interest
percentage_changenumber?Percentage change
'52_week_high'number?52-week high
'52_week_low'number?52-week low
avg_pricenumber?Average price
lower_circuitnumber?Lower circuit
upper_circuitnumber?Upper circuit
lttnumber?Last trade time
total_bids_quantitynumber?Total bids quantity
total_asks_quantitynumber?Total asks quantity

Mark

Mark/annotation interface.

Properties:

PropertyTypeDescription
idstringMark ID
timenumberTimestamp
colorstring?Color
textstring?Text

TimeMark

Time mark interface.

Properties:

PropertyTypeDescription
idstringMark ID
timenumberTimestamp
colorstring?Color
labelstring?Label

QuoteData

Quote data interface.

Properties:

PropertyTypeDescription
symbolstringSymbol
bidnumber?Bid price
asknumber?Ask price
lastnumber?Last price
volumenumber?Volume

HistoryMetadata

History metadata interface.

Properties:

PropertyTypeDescription
noDataboolean?No data available
nextTimenumber?Next timestamp

IWatchlistSymbol

Watchlist symbol interface.

Properties:

PropertyTypeDescription
symbolstringSymbol
exchangestring?Exchange
tokenstring?Token

IWatchlist

Watchlist interface.

Properties:

PropertyTypeDescription
idstringWatchlist ID
namestringWatchlist name
symbolsIWatchlistSymbol[]Symbols in watchlist

ISymbolDetails

Symbol details interface.

Properties:

PropertyTypeDescription
namestringDisplay name (Apple Inc.)
symbolstringAAPL
exchangestring?NASDAQ
tokenstring?Internal/broker token
pricenumberLast traded price
changenumberAbsolute change
changePercentagenumber% change
volumenumberVolume
logostringURL or asset key

Core Interfaces

PriceData

Price data interface for chart data points.

Properties:

PropertyTypeDescription
timenumberTimestamp in milliseconds
opennumberOpen price
highnumberHigh price
lownumberLow price
closenumberClose price
volumenumberVolume
isCompletedboolean?Is bar completed
changenumber?Change
changePercentnumber?Change percentage
openInterestnumber?Open interest
totalValuenumber?Total value (footprint)
deltanumber?Delta (footprint)
buyValuenumber?Buy value
sellValuenumber?Sell value
pocPricenumber?Point of control price
levelsobject?Level data

ChartData

Chart data interface.

Properties:

PropertyTypeDescription
dataPriceData[]Chart data
widthnumberChart width
heightnumberChart height
visibleRangeVisibleRangeVisible range
priceRangePriceRangePrice range

CanvasLayers

Canvas layers interface.

Properties:

PropertyTypeDescription
gridHTMLCanvasElementGrid layer
candlesHTMLCanvasElementCandlestick layer
indicatorsHTMLCanvasElementIndicator layer
patternsHTMLCanvasElementPattern recognition layer
subpanelsHTMLCanvasElementSubpanels layer
drawingHTMLCanvasElementDrawing layer
uiHTMLCanvasElementUI layer
priceLabelsHTMLCanvasElementPrice labels layer
timeLabelsHTMLCanvasElementTime labels layer

IndicatorBase

Base indicator interface.

Methods:

  • calculate(prices, period) - Calculate indicator values
  • render(context, chartData, options) - Render indicator
  • updateParameters(newPeriod) - Update parameters
  • setStyle(styleOptions) - Set style
  • setScaleMapper(scaleMapper) - Set scale mapper
  • setZoomPan(zoomPan) - Set zoom/pan
  • setTheme(theme) - Set theme

Indicator

Indicator interface.

Properties:

PropertyTypeDescription
idnumberIndicator ID
typestringIndicator type
instanceIndicatorBaseIndicator instance
optionsRecord<string, any>Options

Interaction Interfaces

CursorType

Cursor type enumeration.

Values:

  • 'default' - Default cursor
  • 'pointer' - Pointer cursor
  • 'grab' - Grab cursor
  • 'grabbing' - Grabbing cursor
  • 'crosshair' - Crosshair cursor
  • 'ns-resize' - North-south resize cursor
  • 'ew-resize' - East-west resize cursor
  • 'nwse-resize' - Northwest-southeast resize cursor
  • 'nesw-resize' - Northeast-southwest resize cursor
  • 'not-allowed' - Not allowed cursor
  • 'text' - Text cursor
  • 'auto' - Auto cursor
  • 'none' - No cursor

CursorConfig

Cursor configuration interface.

Properties:

PropertyTypeDescription
defaultCursorTypeDefault cursor
defaultHoverCursorTypeDefault hover cursor
drawingCursorTypeDrawing mode cursor
drawingActiveCursorTypeActive drawing cursor
hoverCursorTypeHover cursor
grabCursorTypeGrab cursor
grabbingCursorTypeGrabbing cursor
resizingCursorTypeResizing cursor
anchorDefaultCursorTypeAnchor default cursor
anchorHoverCursorTypeAnchor hover cursor
anchorDragCursorTypeAnchor drag cursor
invalidCursorTypeInvalid state cursor

CursorThemeColors

Cursor theme colors interface.

Properties:

PropertyTypeDescription
dot.borderstringDot border color
dot.fillstringDot fill color
demonstration.fillstringDemonstration fill color
demonstration.strokestringDemonstration stroke color
magic.starFillstringMagic star fill color
magic.starStrokestringMagic star stroke color
magic.particleFillstringMagic particle fill color
magic.handleFillstringMagic handle fill color
magic.handleStrokestringMagic handle stroke color
eraser.borderstringEraser border color
eraser.fillstringEraser fill color

InteractionState

Interaction state interface.

Properties:

PropertyTypeDescription
isHoveringbooleanIs hovering
isDrawingbooleanIs drawing
isDraggingbooleanIs dragging
isResizingbooleanIs resizing
isInvalidbooleanIs invalid
partTypestring?Part type
anchorPositionstring?Anchor position

TouchConfig

Touch configuration interface.

Properties:

PropertyTypeDescription
longPressDurationnumberLong press duration (ms)
doubleTapTimeoutnumberDouble tap timeout (ms)
tapThresholdnumberTap threshold (pixels)
pinchThresholdnumberPinch threshold (pixels)

TouchState

Touch state interface.

Properties:

PropertyTypeDescription
touchesTouch[]Touch points
startTimenumberStart time
isLongPressedbooleanIs long pressed
lastTapTimenumberLast tap time
lastTapPointobject?Last tap point
isPinchingbooleanIs pinching
pinchStartDistancenumberPinch start distance

MouseEventParam

Mouse event parameter interface.

Properties:

PropertyTypeDescription
timenumberTimestamp
pricenumberPrice
xnumberX coordinate
ynumberY coordinate
paneIdstringPane ID
buttonnumber?Mouse button

WheelEventParam

Wheel event parameter interface (extends MouseEventParam).

Properties:

PropertyTypeDescription
deltaXnumberX delta
deltaYnumberY delta
deltaModenumberDelta mode

TouchEventParam

Touch event parameter interface.

Properties:

PropertyTypeDescription
touchesobject[]Touch points
touches[].timenumberTimestamp
touches[].pricenumberPrice
touches[].xnumberX coordinate
touches[].ynumberY coordinate
paneIdstringPane ID

Template Interfaces

GradientSettings

Gradient settings interface.

Properties:

PropertyTypeDescription
startColorstringStart color
endColorstringEnd color
directionstring'vertical' or 'horizontal'

PriceLabelsStyle

Price labels style interface.

Properties:

PropertyTypeDescription
fontstringFont
colorstringColor
fontSizenumberFont size
fontFamilystringFont family
paddingnumberPadding
backgroundColorstringBackground color
backgroundTypestring?'solid' or 'gradient'
gradientGradientSettings?Gradient settings

PriceOverlayStyle

Price overlay style interface.

Properties:

PropertyTypeDescription
fontstringFont
colorstringColor
fontSizenumberFont size
fontFamilystringFont family
backgroundColorstringBackground color
textColorstringText color
paddingnumberPadding

TimeLabelsStyle

Time labels style interface.

Properties:

PropertyTypeDescription
fontstringFont
colorstringColor
fontSizenumberFont size
fontFamilystringFont family
paddingnumberPadding
backgroundColorstringBackground color
backgroundTypestring?'solid' or 'gradient'
gradientGradientSettings?Gradient settings

TimeOverlayStyle

Time overlay style interface.

Properties:

PropertyTypeDescription
fontstringFont
colorstringColor
fontSizenumberFont size
fontFamilystringFont family
backgroundColorstringBackground color
textColorstringText color
paddingnumberPadding

StatusLineSettings

Status line settings interface.

Properties:

PropertyTypeDescription
showIconbooleanShow icon
showSymbolbooleanShow symbol
showIntervalbooleanShow interval
showExchangebooleanShow exchange
showOHLCValuesbooleanShow OHLC values
showChangeValuesbooleanShow change values

GridStyleSettings

Grid style settings interface.

Properties:

PropertyTypeDescription
vertLineColorstring?Vertical line color
horzLineColorstring?Horizontal line color
modestring?'normal' or 'logarithmic'
lineWidthnumber?Line width
lineStylestring?'solid', 'dashed', or 'dotted'

PriceScaleLabelSettings

Price scale label settings interface.

Properties:

PropertyTypeDescription
showSymbolNameboolean?Show symbol name
showLastPriceboolean?Show last price
showIndicatorsNameboolean?Show indicators name
showIndicatorsValueboolean?Show indicators value
showLastPricePercentageboolean?Show last price percentage
noOverlappingLabelsboolean?Prevent overlapping labels

TimeScaleFormatSettings

Time scale format settings interface.

Properties:

PropertyTypeDescription
dateFormatstring?Date format
timeFormatstring?Time format

CrosshairStyleSettings

Crosshair style settings interface.

Properties:

PropertyTypeDescription
colorstring?Color
modestring?'normal', 'x-only', 'y-only', or 'hidden'
lineWidthnumber?Line width
lineStylestring?'solid', 'dashed', or 'dotted'

CanvasBackgroundSettings

Canvas background settings interface.

Properties:

PropertyTypeDescription
typestring?'solid' or 'gradient'
colorstring?Color
gradient.startColorstring?Gradient start color
gradient.endColorstring?Gradient end color
gradient.directionstring?'vertical' or 'horizontal'

EventsSettings

Events settings interface.

Properties:

PropertyTypeDescription
showDividendsboolean?Show dividends
showSplitsboolean?Show splits
showEarningsboolean?Show earnings
showNewsboolean?Show news

TemplateEventData

Template event data interface.

Properties:

PropertyTypeDescription
statusLineStatusLineSettings?Status line settings
gridGridStyleSettings?Grid settings
priceScaleLabelsPriceScaleLabelSettings?Price scale labels
timeScaleFormatTimeScaleFormatSettings?Time scale format
crosshairCrosshairStyleSettings?Crosshair settings
canvasBackgroundCanvasBackgroundSettings?Canvas background
eventsEventsSettings?Events settings

Volume Profile Interfaces

ProfileType

Volume profile type enumeration.

Values:

  • 'visible_range' - Visible range profile
  • 'fixed_range' - Fixed range profile
  • 'session' - Session profile
  • 'anchored' - Anchored profile
  • 'periodic' - Periodic profile
  • 'rolling' - Rolling profile

VolumeProfilePlacement

Volume profile placement enumeration.

Values:

  • 'left' - Left side of chart
  • 'right' - Right side of chart
  • 'overlay' - Overlay on chart

VolumeProfilePeriodicPeriod

Volume profile periodic period enumeration.

Values:

  • 'D' - Daily
  • 'W' - Weekly
  • 'M' - Monthly

VolumeProfileConfig

Volume profile configuration interface.

Properties:

PropertyTypeDescription
profileTypeProfileType?Profile type
valueAreaPercentnumber?Value area percentage
bucketSizeMultipliernumber?Bucket size multiplier
profileWidthPercentnumber?Profile width percentage
profileWidthPxnumber?Profile width in pixels (deprecated)
fixedStartIndexnumber?Fixed start index
fixedEndIndexnumber?Fixed end index
anchorIndexnumber?Anchor index
fixedStartTimeMsnumber?Fixed start time (deprecated)
fixedEndTimeMsnumber?Fixed end time (deprecated)
anchorTimeMsnumber?Anchor time (deprecated)
placementVolumeProfilePlacement?Placement
opacitynumber?Opacity
showPOCboolean?Show point of control
showVAHVALboolean?Show value area high/low
showDevelopingPOCboolean?Show developing POC
rollingBarsnumber?Rolling bars count
periodicPeriodVolumeProfilePeriodicPeriod?Periodic period
historyCountnumber?History count
histogramColorstring?Histogram color
valueAreaColorstring?Value area color
pocColorstring?Point of control color
vahValColorstring?Value area high/low color
developingPocColorstring?Developing POC color

VolumeProfileBin

Volume profile bin interface.

Properties:

PropertyTypeDescription
pricenumberPrice level
volumenumberVolume at price
percentnumberPercentage of total volume
isValueAreabooleanIs in value area

ProfileLevels

Profile levels interface.

Properties:

PropertyTypeDescription
pocnumber | nullPoint of control
vahnumber | nullValue area high
valnumber | nullValue area low
developingPocnumber | nullDeveloping point of control

VolumeProfileResult

Volume profile result interface.

Properties:

PropertyTypeDescription
binsVolumeProfileBin[]Volume bins
levelsProfileLevelsProfile levels
totalVolumenumberTotal volume
maxVolumenumberMaximum volume
bucketSizenumberBucket size
rangeStartTimenumberRange start time
rangeEndTimenumberRange end time

VolumeProfile

Volume profile interface.

Properties:

PropertyTypeDescription
idstringProfile ID
profileTypeProfileTypeProfile type
visiblebooleanIs visible
configVolumeProfileConfigConfiguration

Market Profile Interfaces

MarketProfileType

Market profile type enumeration.

Values:

  • 'session' - Session profile
  • 'fixed_range' - Fixed range profile
  • 'composite' - Composite profile
  • 'periodic' - Periodic profile

MarketProfilePlacement

Market profile placement enumeration.

Values:

  • 'left' - Left side of chart
  • 'right' - Right side of chart

MarketProfileDisplayMode

Market profile display mode enumeration.

Values:

  • 'letters' - Letters display
  • 'blocks' - Blocks display
  • 'adaptive' - Adaptive display

MarketProfileRthEthMode

Market profile RTH/ETH mode enumeration.

Values:

  • 'rth' - Regular trading hours
  • 'eth' - Extended trading hours
  • 'combined' - Combined RTH/ETH

MarketProfilePeriodicPeriod

Market profile periodic period enumeration.

Values:

  • 'D' - Daily
  • 'W' - Weekly
  • 'M' - Monthly

MarketProfileConfig

Market profile configuration interface.

Properties:

PropertyTypeDescription
profileTypeMarketProfileType?Profile type
bracketMinutesnumber?Bracket minutes (15, 30, or 60)
valueAreaPercentnumber?Value area percentage
rowSizeTicksnumber?Row size in ticks
placementMarketProfilePlacement?Placement
displayModeMarketProfileDisplayMode?Display mode
showPOCboolean?Show point of control
showVAHVALboolean?Show value area high/low
showIBboolean?Show initial balance
showSinglePrintsboolean?Show single prints
showExcessboolean?Show excess tails
rthEthModeMarketProfileRthEthMode?RTH/ETH mode
fixedStartIndexnumber?Fixed start index
fixedEndIndexnumber?Fixed end index
periodicPeriodMarketProfilePeriodicPeriod?Periodic period
compositeSessionCountnumber?Composite session count
opacitynumber?Opacity
tpoTextColorstring?TPO text color
tpoBlockColorstring?TPO block color
valueAreaColorstring?Value area color
pocColorstring?Point of control color
vahValColorstring?Value area high/low color
ibRangeColorstring?Initial balance range color
singlePrintColorstring?Single print color
excessColorstring?Excess color

TpoRow

TPO row interface.

Properties:

PropertyTypeDescription
pricenumberPrice level
lettersstring[]Bracket letters that touched this price
bracketIndicesnumber[]Original bracket indices for each letter
countnumberCount of TPOs
isValueAreabooleanIs in value area
isPocbooleanIs point of control
isSinglePrintbooleanIs single print

MarketProfileLevels

Market profile levels interface.

Properties:

PropertyTypeDescription
pocnumber | nullPoint of control
vahnumber | nullValue area high
valnumber | nullValue area low
ibHighnumber | nullInitial balance high
ibLownumber | nullInitial balance low
singlePrintsobject[]Single print ranges
excessTailsobject[]Excess tail ranges

MarketProfileResult

Market profile result interface.

Properties:

PropertyTypeDescription
rowsTpoRow[]TPO rows
levelsMarketProfileLevelsProfile levels
totalTposnumberTotal TPOs
maxTposPerRownumberMaximum TPOs per row
rowSizenumberRow size
startTimenumberStart time
endTimenumberEnd time
bracketsobject[]Bracket information

MarketProfile

Market profile interface.

Properties:

PropertyTypeDescription
idstringProfile ID
profileTypeMarketProfileTypeProfile type
visiblebooleanIs visible
configMarketProfileConfigConfiguration

Order Flow (Footprint Chart) Interfaces

FootprintType

Footprint chart type enumeration.

Values:

  • 'bid_ask' - Bid/ask footprint
  • 'volume' - Volume footprint
  • 'delta' - Delta footprint
  • 'imbalance' - Imbalance footprint

FootprintLayout

Footprint chart layout enumeration.

Values:

  • 'side_by_side' - Side by side layout
  • 'diagonal' - Diagonal layout
  • 'histogram_overlay' - Histogram overlay layout

FootprintRowSizeMode

Footprint row size mode enumeration.

Values:

  • 'tick_size' - Size based on tick size
  • 'custom' - Custom size

FootprintConfig

Footprint chart configuration interface.

Properties:

PropertyTypeDescription
typeFootprintTypeChart type
aggregationstring'per_candle' only
layoutFootprintLayoutLayout
rowSizeModeFootprintRowSizeModeRow size mode
rowSizeTicksnumberRow size in ticks
showImbalancebooleanShow imbalance
showDeltabooleanShow delta
showTotalbooleanShow total
valueAreaHighlightbooleanHighlight value area
imbalanceRationumberImbalance ratio
fontSizenumberFont size
rowHeightPxnumberRow height in pixels
highlightMaxVolumeRowbooleanHighlight max volume row
buyColorstringBuy color
sellColorstringSell color
neutralColorstringNeutral color
imbalanceBuyColorstringImbalance buy color
imbalanceSellColorstringImbalance sell color
pocColorstringPoint of control color
vaColorstringValue area color

FootprintLevel

Footprint level interface.

Properties:

PropertyTypeDescription
pricenumberPrice level
buyValuenumberBuy value
sellValuenumberSell value

FootprintRow

Footprint row interface.

Properties:

PropertyTypeDescription
pricenumberPrice level
buyValuenumberBuy value
sellValuenumberSell value
totalValuenumberTotal value
deltanumberDelta
isPocbooleanIs point of control
isValueAreabooleanIs in value area
isBullishImbalancebooleanIs bullish imbalance
isBearishImbalancebooleanIs bearish imbalance
isStackedImbalanceboolean?Is stacked imbalance

FootprintBarData

Footprint bar data interface.

Properties:

PropertyTypeDescription
barIndexnumberBar index
startTimenumberStart time
endTimenumberEnd time
isFinalbooleanIs final bar
rowsFootprintRow[]Rows
volumenumberTotal volume
totalValuenumberTotal value
barDeltanumberBar delta
buyValuenumberBuy value
sellValuenumberSell value
pocPricenumberPoint of control price
opennumberOpen price
highnumberHigh price
lownumberLow price
closenumberClose price

Quick Reference

Most Commonly Used Interfaces

  1. IBasicDataFeed - Implement this for your data source
  2. Bar - Historical price data
  3. SymbolState - Symbol information
  4. DrawingOptions - Drawing styles
  5. CustomIndicatorDefinition - Create custom indicators
  6. MouseEventParam - Event handler parameters
  7. DataFeedConfiguration - Datafeed capabilities

Type Usage Examples

Creating a Bar:

const bar = {
time: Date.now(),
open: 100,
high: 105,
low: 99,
close: 103,
volume: 50000
};

Defining a Drawing:

const drawing = {
type: 'trend_line',
points: [
{ time: 1234567890000, price: 100, barIndex: 50 },
{ time: 1234567890000, price: 110, barIndex: 100 }
],
options: {
color: '#ff0000',
lineWidth: 2
}
};

Creating Custom Indicator:

const indicator = {
name: 'EMA',
inputs: [{ name: 'period', type: 'number', defaultValue: 20 }],
calculate: (getRealBar, getDerivedBar, index, options) => {
// Calculation logic
return calculatedValue;
},
renderLayers: [
{ type: 'line', dataKey: 'value', color: '#00ff00' }
]
};

Next Steps