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 symbolssubscribeBars()- Subscribe to real-time updatesunsubscribeBars()- Unsubscribe from real-time updatessubscribeDepth()- Subscribe to depth/market datacreateWatchlist()- Create watchlistdeleteWatchlist()- Delete watchlistaddSymbolToWatchlist()- Add symbol to watchlistgetWatchlists()- Get all watchlistscreateAlert()- Create alertgetAlerts()- Get all alertsupdateAlert()- Update alertdeleteAlert()- 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:
| Property | Type | Description |
|---|---|---|
time | number | Timestamp in milliseconds |
open | number | Opening price |
high | number | Highest price |
low | number | Lowest price |
close | number | Closing price |
volume | number? | Trading volume |
openInterest | number? | 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:
| Property | Type | Description |
|---|---|---|
symbol_name | string | Symbol ticker (AAPL) |
token | string | Internal token |
exchange | string | Exchange name |
description | string | Full description |
ticksize | number | Minimum price movement |
lotsize | number | Lot size |
precision | number | Decimal precision |
type | string? | Type (stock, crypto, forex) |
session | string? | Trading session |
timezone | string? | Timezone |
supported_resolutions | string[]? | 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:
| Property | Type | Description |
|---|---|---|
supported_resolutions | string[] | Available timeframes |
supports_search | boolean? | Enable symbol search |
supports_group_request | boolean? | Enable group requests |
supports_marks | boolean? | Enable chart marks |
supports_timescale_marks | boolean? | Enable timescale marks |
supports_time | boolean? | Enable time support |
exchanges | array? | Available exchanges |
symbols_types | array? | 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:
| Property | Type | Description |
|---|---|---|
bids | DepthLevel[] | Buy orders |
asks | DepthLevel[] | Sell orders |
volume | number? | Total volume |
open | number? | Opening price |
high | number? | High price |
low | number? | Low price |
close | number? | 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:
| Property | Type | Description |
|---|---|---|
time | number | Timestamp |
price | number | Price level |
barIndex | number | Bar index |
Example:
const point = {
time: 1234567890000,
price: 150.00,
barIndex: 100
};
DrawingOptions
Styling options for drawings.
Properties:
| Property | Type | Description |
|---|---|---|
color | string? | Primary color |
opacity | number? | Opacity (0-1) |
lineWidth | number? | Line width |
lineDash | number[]? | Dash pattern |
fillColor | string? | Fill color |
backgroundColor | string? | Background color |
text | string? | Text content |
fontSize | number? | Font size |
fontFamily | string? | Font family |
Example:
const options = {
color: '#ff0000',
lineWidth: 2,
opacity: 0.8,
fillColor: 'rgba(255, 0, 0, 0.2)'
};
IDrawing
Complete drawing object.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Unique ID |
type | DrawingType | Drawing type |
points | DrawingPoint[] | Drawing points |
options | DrawingOptions | Style options |
paneId | string | Pane ID |
locked | boolean | Is locked |
visible | boolean | Is visible |
createdAt | number | Creation time |
updatedAt | number | Last update time |
Indicator Interfaces
CustomIndicatorDefinition
Interface for defining custom indicators.
Properties:
| Property | Type | Description |
|---|---|---|
name | string | Unique indicator name |
displayName | string? | Display name |
description | string? | Description |
category | string? | Category |
inputs | CustomIndicatorInput[] | Input parameters |
calculate | function | Calculation function |
renderLayers | CustomIndicatorLayer[] | 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:
| Property | Type | Description |
|---|---|---|
name | string | Input name |
type | string | Type: 'number', 'string', 'boolean', 'color' |
defaultValue | any | Default value |
min | number? | Minimum value (for numbers) |
max | number? | Maximum value (for numbers) |
step | number? | Step value |
description | string? | Description |
RenderLayer
Defines how indicator data is rendered.
Properties:
| Property | Type | Description |
|---|---|---|
type | string | 'line', 'area', 'candle', 'column', 'scatter', 'histogram', 'bgcolor', 'fill' |
dataKey | string | Key in calculated data |
color | string | Color |
lineWidth | number? | Line width (for lines) |
fill | string? | Fill color (for areas) |
opacity | number? | Opacity (0-1) |
dashPattern | number[]? | Dash pattern |
Example:
const layer = {
type: 'line',
dataKey: 'value',
color: '#2196F3',
lineWidth: 2,
opacity: 1
};
IStoreIndicator
Internal indicator representation.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Unique ID |
name | string | Indicator name |
metaInfo | IndicatorMetadata | Metadata |
instance | any | Calculator instance |
seriesBinding | IndicatorSeriesBinding | Series binding |
| 455→ | inputs | IndicatorInputDefinition[] |
| 456→ | styles | IndicatorStyleDefinition[] |
| 457→ | options | IndicatorOptions |
| 458→ | visible | boolean |
| 459→ | ||
| 460→--- | ||
| 461→ | ||
| 462→## Indicator Style Interfaces |
Style configuration for built-in indicators.
ADXStyle
ADX (Average Directional Index) indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
ATRStyle
ATR (Average True Range) indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
AroonStyle
Aroon indicator style.
| Property | Type | Description |
|---|---|---|
upColor | string | Up line color |
downColor | string | Down line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
BollingerBandsStyle
Bollinger Bands indicator style.
| Property | Type | Description |
|---|---|---|
middleBandColor | string | Middle band color |
upperBandColor | string | Upper band color |
lowerBandColor | string | Lower band color |
lineWidth | number | Line width |
fillOpacity | number | Fill opacity (0-1) |
lineStyle | "solid" | "dashed" |
CentralPivotRangeStyle
Central Pivot Range indicator style.
| Property | Type | Description |
|---|---|---|
cpColor | string | Central pivot color |
tcpColor | string | Top central pivot color |
bcpColor | string | Bottom central pivot color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
DonchianChannelStyle
Donchian Channel indicator style.
| Property | Type | Description |
|---|---|---|
upperColor | string | Upper channel color |
lowerColor | string | Lower channel color |
middleColor | string | Middle channel color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
fillColor | string | Fill color |
EMAStyle
EMA (Exponential Moving Average) indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
EWMAStyle
EWMA (Exponentially Weighted Moving Average) indicator style.
| Property | Type | Description |
|---|---|---|
lineColor | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
GatorStyle
Gator Oscillator indicator style.
| Property | Type | Description |
|---|---|---|
jawColor | string | Jaw color |
teethColor | string | Teeth color |
lipsColor | string | Lips color |
lineWidth | number | Line 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.
| Property | Type | Description |
|---|---|---|
lineColor | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
KAMAStyle
KAMA (Kaufman Adaptive Moving Average) indicator style.
| Property | Type | Description |
|---|---|---|
lineColor | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
KeltnerChannelsStyle
Keltner Channels indicator style.
| Property | Type | Description |
|---|---|---|
upperColor | string | Upper channel color |
middleColor | string | Middle channel color |
lowerColor | string | Lower channel color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
MACDStyle
MACD (Moving Average Convergence Divergence) indicator style.
| Property | Type | Description |
|---|---|---|
macdColor | string | MACD line color |
signalColor | string | Signal line color |
histogramColor | string | Histogram color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
MFIStyle
MFI (Money Flow Index) indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
ParabolicSARStyle
Parabolic SAR indicator style.
| Property | Type | Description |
|---|---|---|
longColor | string | Long position color |
shortColor | string | Short position color |
dotSize | number | Dot size |
lineStyle | "solid" | "dashed" |
ROCStyle
ROC (Rate of Change) indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
RSIStyle
RSI (Relative Strength Index) indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
signalColor | string | Signal line color |
lineWidth | number | Line width |
signalLineWidth | number | Signal line width |
lineStyle | "solid" | "dashed" |
overboughtColor | string | Overbought level color |
oversoldColor | string | Oversold level color |
thresholdLineWidth | number | Threshold line width |
thresholdLineStyle | number[] | Threshold line style |
SMAStyle
SMA (Simple Moving Average) indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line 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.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
StochasticStyle
Stochastic Oscillator indicator style.
| Property | Type | Description |
|---|---|---|
kColor | string | %K line color |
dColor | string | %D line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
TEMAStyle
TEMA (Triple Exponential Moving Average) indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
WilliamsRStyle
Williams %R indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
BBPercentBStyle
%b (Percent B) indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
overboughtColor | string | Overbought level color |
oversoldColor | string | Oversold level color |
middleColor | string | Middle level color |
thresholdLineWidth | number | Threshold line width |
thresholdLineStyle | number[] | Threshold line style |
BullBearPowerStyle
Bull/Bear Power indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
negativeColor | string | Negative values color |
zeroLineColor | string | Zero line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
SMIEOStyle
SMI Ergodic Oscillator indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
upColor | string | Up direction color |
downColor | string | Down direction color |
lineWidth | number | Line width |
TrendStrengthStyle
Trend Strength indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
bullishColor | string | Bullish values color |
bearishColor | string | Bearish values color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
TRIXStyle
TRIX (Triple Exponential Average) indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
zeroLineColor | string | Zero 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.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
AcceleratorOscillatorStyle
Accelerator Oscillator indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
positiveColor | string | Positive values color |
negativeColor | string | Negative values color |
UltimateOscillatorStyle
Ultimate Oscillator indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
CMFStyle
CMF (Chaikin Money Flow) indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
zeroLineColor | string | Zero line color |
ChaikinOscillatorStyle
Chaikin Oscillator indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
zeroLineColor | string | Zero line color |
ChandeKrollStopStyle
Chande Kroll Stop indicator style.
| Property | Type | Description |
|---|---|---|
longColor | string | Long position color |
shortColor | string | Short position color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
DPOStyle
DPO (Detrended Price Oscillator) indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
zeroLineColor | string | Zero line color |
zeroLineWidth | number | Zero line width |
VortexStyle
Vortex Indicator style.
| Property | Type | Description |
|---|---|---|
viPlusColor | string | VI+ line color |
viMinusColor | string | VI- line color |
lineWidth | number | Line width |
SMIStyle
SMI (Stochastic Momentum Index) indicator style.
| Property | Type | Description |
|---|---|---|
smiColor | string | SMI line color |
emaColor | string | EMA line color |
overboughtColor | string | Overbought level color |
oversoldColor | string | Oversold level color |
middleColor | string | Middle level color |
lineWidth | number | Line width |
overboughtLevel | number | Overbought level |
oversoldLevel | number | Oversold level |
overboughtFillColor | string | Overbought fill color |
oversoldFillColor | string | Oversold fill color |
overboughtFillOpacity | number | Overbought fill opacity |
oversoldFillOpacity | number | Oversold fill opacity |
CoppockStyle
Coppock Curve indicator style.
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
lineStyle | "solid" | "dashed" |
KSTStyle
KST (Know Sure Thing) indicator style.
| Property | Type | Description |
|---|---|---|
kstColor | string | KST line color |
signalColor | string | Signal line color |
lineWidth | number | Line width |
signalLineWidth | number | Signal line width |
lineStyle | "solid" | "dashed" |
zeroLineColor | string | Zero line color |
zeroLineWidth | number | Zero line width |
zeroLineStyle | number[] | Zero line style |
Interaction Interfaces
MouseEventParam
Mouse event data passed to event handlers.
Properties:
| Property | Type | Description |
|---|---|---|
time | number | Timestamp |
price | number | Price at cursor |
x | number | X coordinate |
y | number | Y coordinate |
paneId | string | Pane ID |
button | number? | 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:
| Property | Type | Description |
|---|---|---|
deltaX | number | Horizontal scroll |
deltaY | number | Vertical scroll |
deltaMode | number | Scroll mode |
TouchEventParam
Touch event data.
Properties:
| Property | Type | Description |
|---|---|---|
touches | array | Array of touch points |
paneId | string | Pane 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:
| Property | Type | Description |
|---|---|---|
default | CursorType | Default cursor |
defaultHover | CursorType | Default hover cursor |
drawing | CursorType | Drawing mode cursor |
drawingActive | CursorType | Active drawing cursor |
hover | CursorType | Hover cursor |
grab | CursorType | Grab cursor |
grabbing | CursorType | Grabbing cursor |
resizing | CursorType | Resizing cursor |
Template & Style Interfaces
TemplateEventData
Complete template styling configuration.
Properties:
| Property | Type | Description |
|---|---|---|
statusLine | StatusLineSettings? | Status line settings |
grid | GridStyleSettings? | Grid settings |
priceScaleLabels | PriceScaleLabelSettings? | Price scale labels |
timeScaleFormat | TimeScaleFormatSettings? | Time scale format |
crosshair | CrosshairStyleSettings? | Crosshair style |
canvasBackground | CanvasBackgroundSettings? | Canvas background |
events | EventsSettings? | Events display |
GridStyleSettings
Grid styling configuration.
Properties:
| Property | Type | Description |
|---|---|---|
vertLineColor | string? | Vertical line color |
horzLineColor | string? | Horizontal line color |
mode | string? | 'normal' or 'logarithmic' |
lineWidth | number? | Line width |
lineStyle | string? | '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:
| Property | Type | Description |
|---|---|---|
color | string? | Crosshair color |
mode | string? | 'normal', 'x-only', 'y-only', 'hidden' |
lineWidth | number? | Line width |
lineStyle | string? | 'solid', 'dashed', 'dotted' |
CanvasBackgroundSettings
Canvas background configuration.
Properties:
| Property | Type | Description |
|---|---|---|
type | string? | 'solid' or 'gradient' |
color | string? | Background color |
gradient | object? | 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:
| Property | Type | Description |
|---|---|---|
showSymbolName | boolean? | Show symbol name |
showLastPrice | boolean? | Show last price |
showIndicatorsName | boolean? | Show indicator names |
showIndicatorsValue | boolean? | Show indicator values |
showLastPricePercentage | boolean? | Show price percentage |
noOverlappingLabels | boolean? | Prevent overlapping |
EventsSettings
Corporate events display settings.
Properties:
| Property | Type | Description |
|---|---|---|
showDividends | boolean? | Show dividends |
showSplits | boolean? | Show stock splits |
showEarnings | boolean? | Show earnings |
showNews | boolean? | Show news |
State Interfaces
CrosshairState
Current crosshair state.
Properties:
| Property | Type | Description |
|---|---|---|
x | number | X coordinate |
y | number | Y coordinate |
visible | boolean | Is visible |
mode | string | Crosshair mode |
isInBoundary | boolean | Is in chart boundary |
barIndex | number? | Current bar index |
time | number? | Current time |
price | number? | Current price |
paneId | string? | Current pane |
TooltipState
Tooltip state.
Properties:
| Property | Type | Description |
|---|---|---|
visible | boolean | Is visible |
x | number? | X position |
y | number? | Y position |
TimeScaleState
Time scale configuration.
Properties:
| Property | Type | Description |
|---|---|---|
start | number | Start index |
end | number | End index |
barSpacing | number? | Bar spacing |
scrollOffset | number? | Scroll offset |
PriceScaleState
Price scale configuration.
Properties:
| Property | Type | Description |
|---|---|---|
min | number | Minimum price |
max | number | Maximum price |
autoScale | boolean | Auto scale enabled |
logScale | boolean | Logarithmic scale |
percentageScale | boolean | Percentage scale |
inverted | boolean | Inverted scale |
Trading Interfaces
TradingLineStyleOptions
Options for order and position lines.
Properties:
| Property | Type | Description |
|---|---|---|
kind | string | 'order' or 'position' |
lineId | string | Line ID |
side | string? | 'buy' or 'sell' |
quantity | string? | Quantity |
text | string? | Label text |
orderType | string? | 'limit', 'stop', 'market' |
status | string? | 'open', 'filled', 'cancelled', 'rejected' |
tpPrice | number? | Take profit price |
slPrice | number? | Stop loss price |
baseLineColor | string? | Base line color |
tpLineColor | string? | TP line color |
slLineColor | string? | 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:
| Property | Type | Description |
|---|---|---|
id | string | Unique ID |
name | string | Watchlist name |
symbols | IWatchlistSymbol[] | Symbols in watchlist |
IWatchlistSymbol
Symbol in a watchlist.
Properties:
| Property | Type | Description |
|---|---|---|
symbol | string | Symbol ticker |
exchange | string? | Exchange |
token | string? | Token |
ISymbolDetails
Detailed symbol information.
Properties:
| Property | Type | Description |
|---|---|---|
name | string | Display name |
symbol | string | Symbol ticker |
exchange | string? | Exchange |
price | number | Last price |
change | number | Price change |
changePercentage | number | Change percentage |
volume | number | Volume |
logo | string | Logo 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:
| Property | Type | Description |
|---|---|---|
symbol | boolean | Sync symbols |
interval | boolean | Sync intervals |
crosshair | boolean | Sync crosshair |
timeRange | boolean | Sync time range |
Alert Interfaces
Alert
Complete alert definition.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Unique alert ID |
symbol | string | Symbol ticker |
ticker | string | Ticker symbol |
resolution | string | Timeframe |
timeframe | string | Time period |
condition | AlertCondition | Alert condition |
options | AlertOptions | Trigger options |
actions | AlertActions | Notification actions |
state | AlertState | Alert state |
context | AlertContext | Chart context |
active | boolean | Is alert active |
name | string? | Alert name |
message | string? | Alert message |
expiration | string? | 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:
| Property | Type | Description |
|---|---|---|
leftOperand | string | What to compare (e.g., 'close', 'high') |
operator | AlertOperator | Comparison operator |
rightOperand | string | number | Value to compare against |
AlertActions
Notification actions when alert triggers.
Properties:
| Property | Type | Description |
|---|---|---|
popup | boolean | Show popup notification |
sound | boolean | Play sound |
webhook | string? | Webhook URL |
email | boolean | Send email |
AlertState
Alert tracking state.
Properties:
| Property | Type | Description |
|---|---|---|
lastValue | number | Last checked value |
triggered | boolean | Has been triggered |
lastTriggered | number? | Last trigger timestamp |
triggerCount | number? | Number of triggers |
AlertContext
Alert creation context.
Properties:
| Property | Type | Description |
|---|---|---|
chart_id | string | Chart ID |
pane_id | string | Pane ID |
created_at | string | Creation timestamp |
Crosshair Interfaces
CrosshairPosition
Basic crosshair position.
Properties:
| Property | Type | Description |
|---|---|---|
x | number | X coordinate (pixels) |
y | number | Y coordinate (pixels) |
CrosshairSnappedPosition
Crosshair snapped to a bar.
Properties:
| Property | Type | Description |
|---|---|---|
x | number | X position (pixels) |
y | number | Y position (pixels) |
barIndex | number | Snapped bar index |
time | number | Snapped 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:
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width |
mode | CrosshairMode? | Display mode |
lineStyle | string? | 'dotted', 'dashed', 'solid' |
Export Interfaces
ExportOptions
Screenshot and export configuration.
Properties:
| Property | Type | Description |
|---|---|---|
includeWatermark | boolean? | Include watermark |
includeLegend | boolean? | Include legend |
theme | string? | 'light' or 'dark' |
width | number? | Image width |
height | number? | Image height |
scope | ExportScope? | Export scope |
panelId | string? | Panel ID (for panel scope) |
pixelRatio | number? | Pixel ratio for retina |
filename | string? | 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:
| Property | Type | Description |
|---|---|---|
includeWatermark | boolean? | Include watermark |
includeLegend | boolean? | Include legend |
theme | string? | 'light' or 'dark' |
width | number? | Image width |
height | number? | Image height |
Layout Interfaces
Pane
Chart pane (panel) definition.
Properties:
| Property | Type | Description |
|---|---|---|
id | number | Pane ID |
isMain | boolean | Is main price pane |
order | number | Display order |
top | number | Top position (pixels) |
height | number | Height (pixels) |
width | number | Width (pixels) |
visible | boolean | Is visible |
series | string[] | Series IDs in pane |
indicators | PaneIndicator[] | Indicators in pane |
drawings | Drawing[] | Drawings in pane |
needsRedraw | boolean | Needs redraw |
dirtyState | object | What needs redraw |
options | PaneOptions | Pane options |
PaneIndicator
Indicator in a pane.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Indicator ID |
name | string | Indicator name |
series | IndicatorSeriesBinding | Series binding |
PaneOptions
Pane configuration.
Properties:
| Property | Type | Description |
|---|---|---|
backgroundColor | string | Background color |
showGrid | boolean | Show grid lines |
autoScale | boolean | Auto scale enabled |
scaleMargins | object | Top/bottom margins |
Example:
const paneOptions = {
backgroundColor: '#ffffff',
showGrid: true,
autoScale: true,
scaleMargins: { top: 0.1, bottom: 0.1 }
};
PanelDimensions
Panel size and position.
Properties:
| Property | Type | Description |
|---|---|---|
x | number | X position |
y | number | Y position |
width | number | Panel width |
height | number | Panel height |
top | number | Top offset |
bottom | number | Bottom offset |
ChartLayout
Complete chart layout.
Properties:
| Property | Type | Description |
|---|---|---|
mainChart | PanelDimensions | Main chart dimensions |
panels | Map<string, PanelDimensions> | All panels |
totalHeight | number | Total height |
reservedPanelSpace | number | Reserved space |
PaneInteractionState
Pane interaction tracking.
Properties:
| Property | Type | Description |
|---|---|---|
isPanning | boolean | Is panning |
isPriceScaleDragging | boolean | Is dragging price scale |
lastY | number | Last Y position |
interactionMode | string | Current mode |
cursor | string | Cursor type |
crosshair | any | Crosshair state |
ContainerDimensions
Container size.
Properties:
| Property | Type | Description |
|---|---|---|
width | number | Container width |
height | number | Container height |
Layout Adapter Interfaces
LayoutData
Complete layout data for save/load.
Properties:
| Property | Type | Description |
|---|---|---|
id | string? | Layout ID |
name | string? | Layout name |
layoutType | LayoutType | Layout type |
panelRatios | PanelRatio[]? | Panel size ratios |
panels | LayoutPanelData[] | Panel data |
theme | ITheme? | Theme |
linkGroups | array? | Sync groups |
activePanelId | string? | Active panel |
createdAt | number? | Creation time |
updatedAt | number? | Last update time |
version | string? | Version |
LayoutPanelData
Individual panel data.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Panel ID |
symbol | SymbolState | string | Symbol |
interval | string? | Timeframe |
chartType | SeriesType | string? | Chart type |
indicators | LayoutPanelIndicator[]? | Indicators |
drawings | IDrawing[]? | Drawings |
compareSymbols | CompareSeries[]? | Compare symbols |
timezone | string? | Timezone |
linkGroup | string? | Sync group ID |
LayoutPanelIndicator
Indicator in layout panel.
Properties:
| Property | Type | Description |
|---|---|---|
id | string? | Indicator ID |
name | string | Indicator name |
options | IndicatorOptions? | Options |
visible | boolean? | Visibility |
paneId | number? | Pane ID |
LayoutSummary
Layout summary for listing.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Layout ID |
name | string | Layout name |
layoutType | LayoutType? | Layout type |
updatedAt | number? | Last update |
LayoutAdapter
Interface for layout save/load operations.
Methods:
saveLayout(layoutData)- Save layoutloadLayout(layoutId)- Load layoutremoveLayout(layoutId)- Delete layoutgetLayouts()- Get all layoutsrenameLayout(layoutId, newName)- Rename layoutautosaveLayout(layoutId, layoutData)- Auto-save layout
ExternalSaveLoadAdapter
Extended adapter for all persistence operations.
Methods:
- All LayoutAdapter methods
saveChartTemplate(template)- Save chart templategetChartTemplates()- Get chart templatesloadChartTemplate(templateId)- Load chart templateremoveChartTemplate(templateId)- Delete chart templatesaveStudyTemplate(template)- Save study templategetStudyTemplates()- Get study templatesremoveStudyTemplate(templateId)- Delete study templateapplyStudyTemplate(templateId)- Apply study templatesaveDrawing(drawing)- Save drawingloadDrawings(symbol)- Load drawingsgetAllDrawings()- Get all drawingsupdateDrawing(drawing)- Update drawingremoveDrawing(drawingId)- Delete drawing
Market Profile Interfaces
MarketProfileConfig
Market profile (TPO) configuration.
Properties:
| Property | Type | Description |
|---|---|---|
profileType | MarketProfileType? | Profile type |
bracketMinutes | number? | 15, 30, or 60 |
valueAreaPercent | number? | Value area % |
rowSizeTicks | number? | Row size in ticks |
placement | MarketProfilePlacement? | 'left' or 'right' |
displayMode | MarketProfileDisplayMode? | 'letters', 'blocks', 'adaptive' |
showPOC | boolean? | Show Point of Control |
showVAHVAL | boolean? | Show VAH/VAL |
showIB | boolean? | Show Initial Balance |
showSinglePrints | boolean? | Show single prints |
showExcess | boolean? | Show excess tails |
rthEthMode | MarketProfileRthEthMode? | 'rth', 'eth', 'combined' |
periodicPeriod | MarketProfilePeriodicPeriod? | '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:
| Property | Type | Description |
|---|---|---|
poc | number | null | Point of Control |
vah | number | null | Value Area High |
val | number | null | Value Area Low |
ibHigh | number | null | Initial Balance High |
ibLow | number | null | Initial Balance Low |
singlePrints | array | Single print levels |
excessTails | array | Excess tail levels |
TpoRow
Single TPO price row.
Properties:
| Property | Type | Description |
|---|---|---|
price | number | Price level |
letters | string[] | TPO letters |
bracketIndices | number[] | Bracket indices |
count | number | TPO count |
isValueArea | boolean | In value area |
isPoc | boolean | Is POC |
isSinglePrint | boolean | Is single print |
MarketProfileResult
Complete market profile calculation result.
Properties:
| Property | Type | Description |
|---|---|---|
rows | TpoRow[] | All TPO rows |
levels | MarketProfileLevels | Key levels |
totalTpos | number | Total TPO count |
maxTposPerRow | number | Max TPOs in a row |
rowSize | number | Row size |
startTime | number | Start time |
endTime | number | End time |
brackets | array | Time brackets |
MarketProfile
Market profile instance.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Profile ID |
profileType | MarketProfileType | Profile type |
visible | boolean | Is visible |
config | MarketProfileConfig | Configuration |
Volume Profile Interfaces
VolumeProfileConfig
Volume profile configuration.
Properties:
| Property | Type | Description |
|---|---|---|
profileType | ProfileType? | Profile type |
valueAreaPercent | number? | Value area % |
bucketSizeMultiplier | number? | Bucket size |
profileWidthPercent | number? | Width % |
placement | VolumeProfilePlacement? | 'left', 'right', 'overlay' |
showPOC | boolean? | Show POC |
showVAHVAL | boolean? | Show VAH/VAL |
rollingBars | number? | Rolling window bars |
periodicPeriod | VolumeProfilePeriodicPeriod? | '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:
| Property | Type | Description |
|---|---|---|
price | number | Price level |
volume | number | Volume at price |
percent | number | Percentage of total |
isValueArea | boolean | In value area |
ProfileLevels
Volume profile levels.
Properties:
| Property | Type | Description |
|---|---|---|
poc | number | null | Point of Control |
vah | number | null | Value Area High |
val | number | null | Value Area Low |
developingPoc | number | null | Developing POC |
VolumeProfileResult
Volume profile calculation result.
Properties:
| Property | Type | Description |
|---|---|---|
bins | VolumeProfileBin[] | All volume bins |
levels | ProfileLevels | Key levels |
totalVolume | number | Total volume |
maxVolume | number | Max volume in a bin |
bucketSize | number | Bucket size |
rangeStartTime | number | Range start |
rangeEndTime | number | Range end |
VolumeProfile
Volume profile instance.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Profile ID |
profileType | ProfileType | Profile type |
visible | boolean | Is visible |
config | VolumeProfileConfig | Configuration |
Order Flow (Footprint) Interfaces
FootprintConfig
Footprint chart configuration.
Properties:
| Property | Type | Description |
|---|---|---|
type | FootprintType | Footprint type |
layout | FootprintLayout | Display layout |
rowSizeMode | FootprintRowSizeMode | Row size mode |
rowSizeTicks | number | Row size in ticks |
showImbalance | boolean | Show imbalances |
showDelta | boolean | Show delta |
showTotal | boolean | Show totals |
imbalanceRatio | number | Imbalance ratio |
fontSize | number | Font size |
rowHeightPx | number | Row 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:
| Property | Type | Description |
|---|---|---|
price | number | Price level |
buyValue | number | Buy volume |
sellValue | number | Sell volume |
totalValue | number | Total volume |
delta | number | Delta |
isPoc | boolean | Is POC |
isValueArea | boolean | In value area |
isBullishImbalance | boolean | Bullish imbalance |
isBearishImbalance | boolean | Bearish imbalance |
FootprintBarData
Complete footprint bar data.
Properties:
| Property | Type | Description |
|---|---|---|
barIndex | number | Bar index |
startTime | number | Start time |
endTime | number | End time |
isFinal | boolean | Is bar complete |
rows | FootprintRow[] | Price rows |
volume | number | Total volume |
barDelta | number | Bar delta |
pocPrice | number | POC price |
open | number | Open |
high | number | High |
low | number | Low |
close | number | Close |
Pattern Recognition Interfaces
DetectedPattern
A detected chart pattern.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Pattern ID |
patternId | string | Pattern type ID |
name | string | Pattern name |
startIndex | number | Start bar index |
endIndex | number | End bar index |
startTime | number | Start time |
startPrice | number | Start price |
points | PatternPoint[] | Pattern points |
confidence | number | Confidence (0-100) |
status | string | 'forming', 'confirmed', 'failed' |
style | PatternStyles | Visual style |
metadata | object? | 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:
| Property | Type | Description |
|---|---|---|
barIndex | number | Bar index |
time | number | Timestamp |
price | number | Price |
type | string? | Point type |
label | string? | Display label |
PatternInputs
Pattern detection inputs.
Properties:
| Property | Type | Description |
|---|---|---|
minConfidence | number | Minimum confidence (0-100) |
sensitivity | number | Sensitivity (0-1) |
lookbackPeriod | number | Bars to analyze |
volumeConfirmation | boolean | Require volume confirmation |
PatternStyles
Pattern visual styles.
Properties:
| Property | Type | Description |
|---|---|---|
color | string | Line color |
lineWidth | number | Line width (1-10) |
fillColor | string | Background fill |
labelBgColor | string? | Label background |
showLabels | boolean | Show labels |
PatternCategory
Pattern category.
Values:
'candlestick'- Candlestick patterns'chart'- Chart patterns'harmonic'- Harmonic patterns
PatternInputDefinition
Pattern input parameter definition.
Properties:
| Property | Type | Description |
|---|---|---|
name | string | Input name |
type | string | 'number', 'string', 'boolean', 'color' |
defaultValue | any | Default value |
options | string[]? | Options (for select) |
min | number? | Minimum value |
max | number? | Maximum value |
step | number? | Step value |
description | string? | Description |
IPatternDetector
Interface for pattern detectors.
Methods:
detect(dataSeries)- Detect patterns in datavalidate(pattern)- Validate a patterncalculateConfidence(pattern)- Calculate confidence score
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Detector ID |
name | string | Display name |
category | PatternCategory | Pattern category |
enabled | boolean | Is enabled |
sensitivity | number | Sensitivity (0-1) |
minConfidence | number | Min confidence |
ChartPattern
Pattern stored in state.
Properties:
Extends DetectedPattern with:
| Property | Type | Description |
|---|---|---|
paneId | string | Pane ID |
visible | boolean | Is visible |
type | string? | Pattern type |
symbol | string? | Symbol |
resolution | string? | Resolution |
Module Interfaces
KeyboardConfig
Keyboard shortcut configuration.
Properties:
All properties are string arrays for key combinations:
deleteKey- Delete drawingsundoKey- UndoredoKey- RedoselectAllKey- Select alldeselectAllKey- Deselect allcopyKey- CopypasteKey- PastedeactivateKey- Deactivate toolexitAllKey- Exit all toolsquickSearchKey- Quick searchindicatorsKey- Add indicatorspanLeftKey- Pan leftpanRightKey- Pan rightzoomInKey- Zoom inzoomOutKey- Zoom outresetScaleKey- Reset scalelogScaleKey- Toggle log scaletrendLineKey- Trend line toolhorizontalLineKey- Horizontal linedownloadImageKey- Download imagecopyImageKey- Copy imagedrawingToolKeys- Drawing tool shortcuts
PeriodInfo
Timeframe information.
Properties:
| Property | Type | Description |
|---|---|---|
code | string | Period code (e.g., '1D', '1H') |
seconds | number | Seconds in period |
displayName | string | Display name |
group | string | 'intra', 'daily', 'weekly', 'monthly', 'tick' |
label | string? | Custom label |
TimezoneInfo
Timezone information.
Properties:
| Property | Type | Description |
|---|---|---|
name | string | IANA timezone name |
offset | number | UTC offset in minutes |
label | string | Display label |
abbr | string | Abbreviation (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:
| Property | Type | Description |
|---|---|---|
sessionString | string | Session time string |
sessionMode | string | 'regular', 'extended', 'continuous' |
enabled | boolean | Is session filter enabled |
Model Interfaces
VirtualBar
Virtual bar for rendering.
Properties:
| Property | Type | Description |
|---|---|---|
index | number | Bar index |
time | number? | Timestamp |
isEmpty | boolean? | Is empty bar |
LogicalRange
Logical bar range.
Properties:
| Property | Type | Description |
|---|---|---|
from | number | Start index |
to | number | End index |
XTick
X-axis tick mark.
Properties:
| Property | Type | Description |
|---|---|---|
index | number? | Bar index |
x | number | X position |
time | number? | Timestamp |
label | string? | Display label |
isStrong | boolean? | Is strong tick |
VisibleRange
Visible bar range.
Properties:
| Property | Type | Description |
|---|---|---|
start | number | Start index |
end | number | End index |
PriceRange
Price range.
Properties:
| Property | Type | Description |
|---|---|---|
min | number | Minimum price |
max | number | Maximum price |
ChartDimensions
Chart size.
Properties:
| Property | Type | Description |
|---|---|---|
width | number | Width in pixels |
height | number | Height in pixels |
MousePosition
Mouse coordinates.
Properties:
| Property | Type | Description |
|---|---|---|
x | number | X coordinate |
y | number | Y coordinate |
Measurement Interfaces
MeasurementResult
Measurement tool result.
Properties:
| Property | Type | Description |
|---|---|---|
type | string | 'distance', 'price', 'time', 'risk_reward' |
value | number | Measured value |
unit | string | Unit of measurement |
label | string | Display label |
startPoint | DrawingPoint | Start point |
endPoint | DrawingPoint | End point |
metadata | object? | 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:
| Property | Type | Description |
|---|---|---|
id | string | Compare ID |
symbol | string | Symbol ticker |
symbolInfo | SymbolState | Symbol metadata |
data | PriceData[] | Price data |
color | string | Line color |
lineWidth | number? | Line width |
lineStyle | number? | 0: Solid, 1: Dotted, 2: Dashed |
visible | boolean | Is visible |
loading | boolean | Is loading |
error | string? | Error message |
paneId | string | Pane ID |
type | string | 'overlay' or 'new' |
dataSeriesId | string | Data series ID |
seriesId | string | null | Series ID |
UI State Interfaces
UIState
UI visibility state.
Properties:
| Property | Type | Description |
|---|---|---|
leftSidebarVisible | boolean | Left sidebar visible |
rightSidebarVisible | boolean | Right sidebar visible |
bottomToolbarVisible | boolean | Bottom toolbar visible |
activeTool | string | null | Currently active tool |
isFullscreen | boolean | Is fullscreen |
OverlayState
Overlay content state.
Properties:
| Property | Type | Description |
|---|---|---|
indicators | IStoreIndicator[] | Active indicators |
drawings | array | Active 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:
| Property | Type | Description |
|---|---|---|
canvas | HTMLCanvasElement | Canvas element |
context | CanvasRenderingContext2D | 2D 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:
| Property | Type | Description |
|---|---|---|
timeScale | TimeScaleState | Time scale configuration |
priceScale | PriceScaleState | Price scale configuration |
crosshair | CrosshairState | Crosshair state |
tooltip | TooltipState | Tooltip state |
overlays | OverlayState | Indicators and drawings |
ui | UIState | UI visibility state |
data | PriceData[] | Chart data |
chartType | SeriesType | Chart type |
visible_plots_set | string | 'ohlc', 'ohlcv', or 'c' |
series | Map<string, any> | Data series |
compareSymbols | CompareSeries[] | Compare symbols |
dataFeedConfig | DataFeedConfiguration | null | Datafeed config |
timezone | string | Chart timezone |
priceScalePosition | string | 'left' or 'right' |
interactionMode | string | Interaction mode |
cursorMode | string | Cursor mode |
interactionSubState | object | Detailed interaction state |
session | object | Session settings |
drawings | object | Drawing state |
alerts | Alert[] | Active alerts |
notifications | Notification[] | Notifications |
patterns | ChartPattern[] | Patterns |
visibility | object | Visibility settings |
replay | object | Replay state |
trade | object | Trade panel state |
panes | Pane[] | All panes |
activePaneId | number | null | Active pane ID |
dimensions | object | Dimensions |
timeContexts | object? | Time contexts |
zoomPan | object | Zoom/pan state |
watchlists | object | Watchlist state |
exchangeCalendars | Record<string, ExchangeCalendarData> | Calendars |
workspace | object? | Workspace state |
ChartAction
Chart state action types.
Actions:
SET_SYMBOL- Set symbolSET_INTERVAL- Set timeframeSET_TIME_SCALE- Set time scaleSET_PRICE_SCALE- Set price scaleUPDATE_PANE_SCALES- Update pane scalesUPDATE_CROSSHAIR- Update crosshairSET_CROSSHAIR_MODE- Set crosshair modeSET_CROSSHAIR_VISIBLE- Toggle crosshair visibilitySET_TOOLTIP_VISIBLE- Toggle tooltip visibilityADD_INDICATOR- Add indicatorREMOVE_INDICATOR- Remove indicatorSET_THEME- Set themeTOGGLE_LEFT_SIDEBAR- Toggle left sidebarTOGGLE_RIGHT_SIDEBAR- Toggle right sidebarTOGGLE_BOTTOM_TOOLBAR- Toggle bottom toolbarSET_ACTIVE_TOOL- Set active toolSET_FULLSCREEN- Toggle fullscreenSET_DATA- Set chart dataSET_CHART_TYPE- Set chart typeSET_TIMEZONE- Set timezoneSET_PRICE_SCALE_POSITION- Set price scale positionSET_INTERACTION_MODE- Set interaction modeSET_CURSOR_MODE- Set cursor modeSET_HOVER_STATE- Set hover stateSET_SELECTING_STATE- Set selection stateSET_ERROR_STATE- Set error stateCLEAR_ERROR_STATE- Clear error stateSET_SESSION- Set sessionSET_SESSION_MODE- Set session modeTOGGLE_SESSION- Toggle sessionADD_DRAWING- Add drawingREMOVE_DRAWING- Remove drawingUPDATE_DRAWING- Update drawingSELECT_DRAWING- Select drawingHOVER_DRAWING- Hover drawingSELECT_DRAWINGS- Select multiple drawingsADD_SELECTED_DRAWING- Add to selectionREMOVE_SELECTED_DRAWING- Remove from selectionCLEAR_SELECTED_DRAWINGS- Clear selectionsSET_ACTIVE_DRAWING_TOOL- Set drawing toolSET_DRAWING_STYLE- Set drawing styleSET_DRAWING_SNAP_CONFIG- Set snap configCLEAR_DRAWINGS- Clear all drawingsCLEAR_INDICATORS- Clear indicatorsSCALES_CHANGED- Scales changedADD_ALERT- Add alertREMOVE_ALERT- Remove alertUPDATE_ALERT- Update alertLOAD_ALERTS- Load alertsADD_NOTIFICATION- Add notificationREMOVE_NOTIFICATION- Remove notificationCLEAR_ALL_NOTIFICATIONS- Clear all notificationsADD_PANE- Add paneREMOVE_PANE- Remove paneUPDATE_PANE- Update paneRESET_STATE- Reset stateUPDATE_DIMENSIONS- Update dimensionsADD_SERIES- Add seriesREMOVE_SERIES- Remove seriesUPDATE_SERIES- Update seriesUPDATE_ZOOM_PAN_STATE- Update zoom/pan stateRESET_ZOOM_PAN_STATE- Reset zoom/pan stateADD_WATCHLIST- Add watchlistREMOVE_WATCHLIST- Remove watchlistUPDATE_WATCHLIST- Update watchlistSET_WATCHLISTS- Set watchlistsADD_SYMBOL_TO_WATCHLIST- Add symbol to watchlistREMOVE_SYMBOL_FROM_WATCHLIST- Remove symbol from watchlistUPDATE_WATCHLIST_SYMBOL_DETAILS- Update symbol detailsSET_ACTIVE_WATCHLIST_ID- Set active watchlistUPDATE_INDICATOR_VISIBILITY- Update indicator visibilityUPDATE_INDICATOR- Update indicatorUPDATE_VISIBILITY_SETTINGS- Update visibility settingsADD_PATTERN- Add patternREMOVE_PATTERN- Remove patternUPDATE_PATTERN- Update patternUPDATE_PATTERN_MATCHES- Update pattern matchesCLEAR_PATTERNS- Clear patternsSET_PATTERN_VISIBILITY- Set pattern visibilitySET_EXCHANGE_CALENDARS- Set exchange calendarsSET_DATAFEED_CONFIG- Set datafeed configSET_ENABLED_RESOLUTION- Set enabled resolutionsSET_WORKSPACE_ID- Set workspace IDSET_ACTIVE_PANEL- Set active panelSET_SYNC_MODE- Set sync modeSET_LAYOUT_TYPE- Set layout typeUPDATE_PANEL_RATIOS- Update panel ratios
Pattern Stubs Interfaces
ChartPattern
Pattern stub interface (API compatibility).
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Pattern ID |
type | PatternType | Pattern type |
name | string | Pattern name |
symbol | string | Symbol |
resolution | string | Resolution |
visible | boolean | Is visible |
showLabel | boolean? | Show label |
showConfidence | boolean? | Show confidence |
showTarget | boolean? | Show target |
matches | any[]? | Pattern matches |
style | any? | Style |
config | any? | Configuration |
PatternMatch
Pattern match result.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Match ID |
patternId | string | Pattern ID |
startIndex | number | Start bar index |
endIndex | number | End bar index |
startTime | number | Start timestamp |
endTime | number | End timestamp |
startPrice | number | Start price |
endPrice | number | End price |
confidence | number | Confidence score |
status | string | 'active', 'completed', 'failed', 'expired' |
targetPrice | number? | Target price |
PatternDefinition
Pattern definition.
Properties:
| Property | Type | Description |
|---|---|---|
type | PatternType | Pattern type |
name | string | Pattern name |
category | string | Category |
description | string? | Description |
PatternConfig
Pattern configuration.
Properties:
| Property | Type | Description |
|---|---|---|
minConfidence | number? | Minimum confidence |
minCompletion | number? | Minimum completion |
swingLookback | number? | Swing lookback |
priceTolerance | number? | Price tolerance |
timeTolerance | number? | Time tolerance |
| 2799→ | minDuration | number? |
| 2800→ | maxDuration | number? |
| 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:
| Property | Type | Description |
|---|---|---|
seriesType | SeriesType | Series type |
isUsedDerivedData | boolean | Whether derived data is used |
getIsUsedDerivedData() | function | Get derived data usage |
setIsUsedDerivedData() | function | Set derived data usage |
getVisibleBars() | function | Get visible bars |
getLogicalRange() | function | Get logical range |
getRealBar() | function | Get real bar |
getBar() | function | Get bar |
getBarSpacing() | function | Get bar spacing |
invalidateCache() | function | Invalidate cache |
handleDerivedData() | function | Handle derived data |
getDerivedBar() | function | Get derived bar |
getDerivedBars() | function | Get derived bars |
IStoreIndicator
Stored indicator interface.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Indicator ID |
name | string | Indicator name |
metaInfo | IndicatorMetadata | Metadata |
instance | any | Instance |
seriesBinding | IndicatorSeriesBinding | Series binding |
inputs | IndicatorInputDefinition[] | Inputs |
styles | IndicatorStyleDefinition[] | Styles |
options | IndicatorOptions | Options |
visible | boolean | Is visible |
OverlayState
Overlay state interface.
Properties:
| Property | Type | Description |
|---|---|---|
indicators | IStoreIndicator[] | Indicators |
drawings | object[] | Drawings array |
drawings[].id | string | Drawing ID |
drawings[].type | string | Drawing type |
drawings[].points | object[] | Points array |
drawings[].points[].x | number | X coordinate |
drawings[].points[].y | number | Y coordinate |
drawings[].options | Record<string, any> | Options |
CompareSeries
Compare series interface.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Series ID |
symbol | string | Symbol |
symbolInfo | SymbolState | Symbol info |
data | PriceData[] | Data |
color | string | Color |
lineWidth | number? | Line width |
lineStyle | number? | Line style (0=solid, 1=dotted, 2=dashed) |
visible | boolean | Is visible |
loading | boolean | Is loading |
error | string? | Error message |
paneId | string | Pane ID |
type | string | 'overlay' or 'new' |
dataSeriesId | string | Data series ID |
seriesId | string | null | Series ID |
ThemeState
Theme state interface.
Description: Extends ITheme interface.
UIState
UI state interface.
Properties:
| Property | Type | Description |
|---|---|---|
leftSidebarVisible | boolean | Left sidebar visibility |
rightSidebarVisible | boolean | Right sidebar visibility |
bottomToolbarVisible | boolean | Bottom toolbar visibility |
activeTool | string | null | Active tool |
isFullscreen | boolean | Fullscreen state |
UILayerState
UI layer state interface.
Properties:
| Property | Type | Description |
|---|---|---|
crosshair | CrosshairState | Crosshair state |
tooltip | TooltipState | Tooltip state |
SymbolState
Symbol state interface.
Properties:
| Property | Type | Description |
|---|---|---|
symbol_name | string | Symbol name |
token | string | Token |
exchange | string | Exchange |
description | string | Description |
ticksize | number | Tick size |
lotsize | number | Lot size |
ticker | string | Ticker |
precision | number | Precision |
img | string | HTMLElement | Image |
is_tradable | boolean | Is tradable |
type | string? | Type |
session | string? | Session |
timezone | string? | Timezone |
supported_resolutions | string[]? | Supported resolutions |
TimeScaleState
Time scale state interface.
Properties:
| Property | Type | Description |
|---|---|---|
start | number | Start time |
end | number | End time |
from | number? | From time |
to | number? | To time |
barSpacing | number? | Bar spacing |
scrollOffset | number? | Scroll offset |
PriceScaleState
Price scale state interface.
Properties:
| Property | Type | Description |
|---|---|---|
min | number | Minimum price |
max | number | Maximum price |
autoScale | boolean | Auto scale |
logScale | boolean | Log scale |
percentageScale | boolean | Percentage scale |
inverted | boolean | Inverted |
CrosshairState
Crosshair state interface.
Properties:
| Property | Type | Description |
|---|---|---|
x | number | X position |
y | number | Y position |
visible | boolean | Is visible |
mode | string | 'normal', 'x-only', 'y-only', 'hidden' |
isInBoundary | boolean | Is in boundary |
barIndex | number? | Bar index |
time | number? | Timestamp |
price | number? | Price |
paneId | string? | Pane ID |
TooltipState
Tooltip state interface.
Properties:
| Property | Type | Description |
|---|---|---|
visible | boolean | Is visible |
x | number? | X position |
y | number? | 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 initializeresolveSymbol(symbolName, onResolve, onError)- Resolve symbol to metadatasearchSymbols(userInput, exchange, symbolType, onResult)- Search for symbolsgetBars(symbolInfo, resolution, from, to, onResult, onError)- Fetch historical barssubscribeBars(symbolInfo, resolution, onRealtimeCallback, subscriberUID, onResetCacheNeededCallback)- Subscribe to real-time updatesunsubscribeBars(subscriberUID)- Unsubscribe from real-time updatessubscribeDepth(symbolInfo, onDataCallback, subscriberUID)- Subscribe to depth dataunsubscribeDepth(subscriberUID)- Unsubscribe from depth dataonTrade(action_type, price, quantity, symbol_info)- Handle trade eventscreateWatchlist(name, symbols, callback)- Create new watchlistdeleteWatchlist(id, callback)- Delete watchlistaddSymbolToWatchlist(watchlistId, symbol, callback)- Add symbol to watchlistdeleteSymbolFromWatchlist(watchlistId, symbolId, callback)- Remove symbol from watchlistgetWatchlists(callback)- Get all watchlistsgetSymbolDetails(symbols, callback)- Get symbol detailssubscribeSymbolDetails(symbols, callback, subscriberUID)- Subscribe to symbol detailsunsubscribeSymbolDetails(subscriberUID)- Unsubscribe from symbol detailscreateAlert(alert, callback)- Create alertgetAlerts(callback)- Get alertsupdateAlert(alertId, alert, callback)- Update alertdeleteAlert(alertId, callback)- Delete alertloadExchangeCalendars()- Load exchange calendar data
DataFeedConfiguration
Data feed configuration returned by onReady.
Properties:
| Property | Type | Description |
|---|---|---|
supports_search | boolean? | Supports search functionality |
supports_group_request | boolean? | Supports group requests |
supports_marks | boolean? | Supports marks/annotations |
supports_timescale_marks | boolean? | Supports timescale marks |
supports_time | boolean? | Supports time-based queries |
exchanges | object[]? | Available exchanges |
symbols_types | object[]? | Available symbol types |
supported_resolutions | string[] | Supported timeframes |
SymbolInfo
Symbol metadata interface.
Properties:
| Property | Type | Description |
|---|---|---|
name | string | Symbol name |
full_name | string? | Full name |
ticker | string? | Ticker |
description | string? | Description |
type | string? | Type (stock, crypto, forex) |
session | string? | Trading session |
exchange | string? | Exchange |
minmov | number? | Minimum movement |
pricescale | number? | Price scale |
has_intraday | boolean? | Has intraday data |
supported_resolutions | string[]? | Supported resolutions |
Bar
Historical bar interface.
Properties:
| Property | Type | Description |
|---|---|---|
time | number | Timestamp in milliseconds |
open | number | Open price |
high | number | High price |
low | number | Low price |
close | number | Close price |
volume | number? | Volume |
openInterest | number? | Open interest |
totalValue | number? | Total value (footprint) |
delta | number? | Delta (footprint) |
pocPrice | number? | Point of control price |
levels | object? | Level data |
DepthLevel
Depth level interface.
Properties:
| Property | Type | Description |
|---|---|---|
price | number | Price level |
orders | number | Number of orders |
quantity | number | Quantity at price |
DepthData
Depth data interface.
Properties:
| Property | Type | Description |
|---|---|---|
bids | DepthLevel[] | Bid levels |
asks | DepthLevel[] | Ask levels |
open | number? | Open price |
high | number? | High price |
low | number? | Low price |
close | number? | Close price |
volume | number? | Volume |
open_interest | number? | Open interest |
percentage_change | number? | Percentage change |
'52_week_high' | number? | 52-week high |
'52_week_low' | number? | 52-week low |
avg_price | number? | Average price |
lower_circuit | number? | Lower circuit |
upper_circuit | number? | Upper circuit |
ltt | number? | Last trade time |
total_bids_quantity | number? | Total bids quantity |
total_asks_quantity | number? | Total asks quantity |
Mark
Mark/annotation interface.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Mark ID |
time | number | Timestamp |
color | string? | Color |
text | string? | Text |
TimeMark
Time mark interface.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Mark ID |
time | number | Timestamp |
color | string? | Color |
label | string? | Label |
QuoteData
Quote data interface.
Properties:
| Property | Type | Description |
|---|---|---|
symbol | string | Symbol |
bid | number? | Bid price |
ask | number? | Ask price |
last | number? | Last price |
volume | number? | Volume |
HistoryMetadata
History metadata interface.
Properties:
| Property | Type | Description |
|---|---|---|
noData | boolean? | No data available |
nextTime | number? | Next timestamp |
IWatchlistSymbol
Watchlist symbol interface.
Properties:
| Property | Type | Description |
|---|---|---|
symbol | string | Symbol |
exchange | string? | Exchange |
token | string? | Token |
IWatchlist
Watchlist interface.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Watchlist ID |
name | string | Watchlist name |
symbols | IWatchlistSymbol[] | Symbols in watchlist |
ISymbolDetails
Symbol details interface.
Properties:
| Property | Type | Description |
|---|---|---|
name | string | Display name (Apple Inc.) |
symbol | string | AAPL |
exchange | string? | NASDAQ |
token | string? | Internal/broker token |
price | number | Last traded price |
change | number | Absolute change |
changePercentage | number | % change |
volume | number | Volume |
logo | string | URL or asset key |
Core Interfaces
PriceData
Price data interface for chart data points.
Properties:
| Property | Type | Description |
|---|---|---|
time | number | Timestamp in milliseconds |
open | number | Open price |
high | number | High price |
low | number | Low price |
close | number | Close price |
volume | number | Volume |
isCompleted | boolean? | Is bar completed |
change | number? | Change |
changePercent | number? | Change percentage |
openInterest | number? | Open interest |
totalValue | number? | Total value (footprint) |
delta | number? | Delta (footprint) |
buyValue | number? | Buy value |
sellValue | number? | Sell value |
pocPrice | number? | Point of control price |
levels | object? | Level data |
ChartData
Chart data interface.
Properties:
| Property | Type | Description |
|---|---|---|
data | PriceData[] | Chart data |
width | number | Chart width |
height | number | Chart height |
visibleRange | VisibleRange | Visible range |
priceRange | PriceRange | Price range |
CanvasLayers
Canvas layers interface.
Properties:
| Property | Type | Description |
|---|---|---|
grid | HTMLCanvasElement | Grid layer |
candles | HTMLCanvasElement | Candlestick layer |
indicators | HTMLCanvasElement | Indicator layer |
patterns | HTMLCanvasElement | Pattern recognition layer |
subpanels | HTMLCanvasElement | Subpanels layer |
drawing | HTMLCanvasElement | Drawing layer |
ui | HTMLCanvasElement | UI layer |
priceLabels | HTMLCanvasElement | Price labels layer |
timeLabels | HTMLCanvasElement | Time labels layer |
IndicatorBase
Base indicator interface.
Methods:
calculate(prices, period)- Calculate indicator valuesrender(context, chartData, options)- Render indicatorupdateParameters(newPeriod)- Update parameterssetStyle(styleOptions)- Set stylesetScaleMapper(scaleMapper)- Set scale mappersetZoomPan(zoomPan)- Set zoom/pansetTheme(theme)- Set theme
Indicator
Indicator interface.
Properties:
| Property | Type | Description |
|---|---|---|
id | number | Indicator ID |
type | string | Indicator type |
instance | IndicatorBase | Indicator instance |
options | Record<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:
| Property | Type | Description |
|---|---|---|
default | CursorType | Default cursor |
defaultHover | CursorType | Default hover cursor |
drawing | CursorType | Drawing mode cursor |
drawingActive | CursorType | Active drawing cursor |
hover | CursorType | Hover cursor |
grab | CursorType | Grab cursor |
grabbing | CursorType | Grabbing cursor |
resizing | CursorType | Resizing cursor |
anchorDefault | CursorType | Anchor default cursor |
anchorHover | CursorType | Anchor hover cursor |
anchorDrag | CursorType | Anchor drag cursor |
invalid | CursorType | Invalid state cursor |
CursorThemeColors
Cursor theme colors interface.
Properties:
| Property | Type | Description |
|---|---|---|
dot.border | string | Dot border color |
dot.fill | string | Dot fill color |
demonstration.fill | string | Demonstration fill color |
demonstration.stroke | string | Demonstration stroke color |
magic.starFill | string | Magic star fill color |
magic.starStroke | string | Magic star stroke color |
magic.particleFill | string | Magic particle fill color |
magic.handleFill | string | Magic handle fill color |
magic.handleStroke | string | Magic handle stroke color |
eraser.border | string | Eraser border color |
eraser.fill | string | Eraser fill color |
InteractionState
Interaction state interface.
Properties:
| Property | Type | Description |
|---|---|---|
isHovering | boolean | Is hovering |
isDrawing | boolean | Is drawing |
isDragging | boolean | Is dragging |
isResizing | boolean | Is resizing |
isInvalid | boolean | Is invalid |
partType | string? | Part type |
anchorPosition | string? | Anchor position |
TouchConfig
Touch configuration interface.
Properties:
| Property | Type | Description |
|---|---|---|
longPressDuration | number | Long press duration (ms) |
doubleTapTimeout | number | Double tap timeout (ms) |
tapThreshold | number | Tap threshold (pixels) |
pinchThreshold | number | Pinch threshold (pixels) |
TouchState
Touch state interface.
Properties:
| Property | Type | Description |
|---|---|---|
touches | Touch[] | Touch points |
startTime | number | Start time |
isLongPressed | boolean | Is long pressed |
lastTapTime | number | Last tap time |
lastTapPoint | object? | Last tap point |
isPinching | boolean | Is pinching |
pinchStartDistance | number | Pinch start distance |
MouseEventParam
Mouse event parameter interface.
Properties:
| Property | Type | Description |
|---|---|---|
time | number | Timestamp |
price | number | Price |
x | number | X coordinate |
y | number | Y coordinate |
paneId | string | Pane ID |
button | number? | Mouse button |
WheelEventParam
Wheel event parameter interface (extends MouseEventParam).
Properties:
| Property | Type | Description |
|---|---|---|
deltaX | number | X delta |
deltaY | number | Y delta |
deltaMode | number | Delta mode |
TouchEventParam
Touch event parameter interface.
Properties:
| Property | Type | Description |
|---|---|---|
touches | object[] | Touch points |
touches[].time | number | Timestamp |
touches[].price | number | Price |
touches[].x | number | X coordinate |
touches[].y | number | Y coordinate |
paneId | string | Pane ID |
Template Interfaces
GradientSettings
Gradient settings interface.
Properties:
| Property | Type | Description |
|---|---|---|
startColor | string | Start color |
endColor | string | End color |
direction | string | 'vertical' or 'horizontal' |
PriceLabelsStyle
Price labels style interface.
Properties:
| Property | Type | Description |
|---|---|---|
font | string | Font |
color | string | Color |
fontSize | number | Font size |
fontFamily | string | Font family |
padding | number | Padding |
backgroundColor | string | Background color |
backgroundType | string? | 'solid' or 'gradient' |
gradient | GradientSettings? | Gradient settings |
PriceOverlayStyle
Price overlay style interface.
Properties:
| Property | Type | Description |
|---|---|---|
font | string | Font |
color | string | Color |
fontSize | number | Font size |
fontFamily | string | Font family |
backgroundColor | string | Background color |
textColor | string | Text color |
padding | number | Padding |
TimeLabelsStyle
Time labels style interface.
Properties:
| Property | Type | Description |
|---|---|---|
font | string | Font |
color | string | Color |
fontSize | number | Font size |
fontFamily | string | Font family |
padding | number | Padding |
backgroundColor | string | Background color |
backgroundType | string? | 'solid' or 'gradient' |
gradient | GradientSettings? | Gradient settings |
TimeOverlayStyle
Time overlay style interface.
Properties:
| Property | Type | Description |
|---|---|---|
font | string | Font |
color | string | Color |
fontSize | number | Font size |
fontFamily | string | Font family |
backgroundColor | string | Background color |
textColor | string | Text color |
padding | number | Padding |
StatusLineSettings
Status line settings interface.
Properties:
| Property | Type | Description |
|---|---|---|
showIcon | boolean | Show icon |
showSymbol | boolean | Show symbol |
showInterval | boolean | Show interval |
showExchange | boolean | Show exchange |
showOHLCValues | boolean | Show OHLC values |
showChangeValues | boolean | Show change values |
GridStyleSettings
Grid style settings interface.
Properties:
| Property | Type | Description |
|---|---|---|
vertLineColor | string? | Vertical line color |
horzLineColor | string? | Horizontal line color |
mode | string? | 'normal' or 'logarithmic' |
lineWidth | number? | Line width |
lineStyle | string? | 'solid', 'dashed', or 'dotted' |
PriceScaleLabelSettings
Price scale label settings interface.
Properties:
| Property | Type | Description |
|---|---|---|
showSymbolName | boolean? | Show symbol name |
showLastPrice | boolean? | Show last price |
showIndicatorsName | boolean? | Show indicators name |
showIndicatorsValue | boolean? | Show indicators value |
showLastPricePercentage | boolean? | Show last price percentage |
noOverlappingLabels | boolean? | Prevent overlapping labels |
TimeScaleFormatSettings
Time scale format settings interface.
Properties:
| Property | Type | Description |
|---|---|---|
dateFormat | string? | Date format |
timeFormat | string? | Time format |
CrosshairStyleSettings
Crosshair style settings interface.
Properties:
| Property | Type | Description |
|---|---|---|
color | string? | Color |
mode | string? | 'normal', 'x-only', 'y-only', or 'hidden' |
lineWidth | number? | Line width |
lineStyle | string? | 'solid', 'dashed', or 'dotted' |
CanvasBackgroundSettings
Canvas background settings interface.
Properties:
| Property | Type | Description |
|---|---|---|
type | string? | 'solid' or 'gradient' |
color | string? | Color |
gradient.startColor | string? | Gradient start color |
gradient.endColor | string? | Gradient end color |
gradient.direction | string? | 'vertical' or 'horizontal' |
EventsSettings
Events settings interface.
Properties:
| Property | Type | Description |
|---|---|---|
showDividends | boolean? | Show dividends |
showSplits | boolean? | Show splits |
showEarnings | boolean? | Show earnings |
showNews | boolean? | Show news |
TemplateEventData
Template event data interface.
Properties:
| Property | Type | Description |
|---|---|---|
statusLine | StatusLineSettings? | Status line settings |
grid | GridStyleSettings? | Grid settings |
priceScaleLabels | PriceScaleLabelSettings? | Price scale labels |
timeScaleFormat | TimeScaleFormatSettings? | Time scale format |
crosshair | CrosshairStyleSettings? | Crosshair settings |
canvasBackground | CanvasBackgroundSettings? | Canvas background |
events | EventsSettings? | 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:
| Property | Type | Description |
|---|---|---|
profileType | ProfileType? | Profile type |
valueAreaPercent | number? | Value area percentage |
bucketSizeMultiplier | number? | Bucket size multiplier |
profileWidthPercent | number? | Profile width percentage |
profileWidthPx | number? | Profile width in pixels (deprecated) |
fixedStartIndex | number? | Fixed start index |
fixedEndIndex | number? | Fixed end index |
anchorIndex | number? | Anchor index |
fixedStartTimeMs | number? | Fixed start time (deprecated) |
fixedEndTimeMs | number? | Fixed end time (deprecated) |
anchorTimeMs | number? | Anchor time (deprecated) |
placement | VolumeProfilePlacement? | Placement |
opacity | number? | Opacity |
showPOC | boolean? | Show point of control |
showVAHVAL | boolean? | Show value area high/low |
showDevelopingPOC | boolean? | Show developing POC |
rollingBars | number? | Rolling bars count |
periodicPeriod | VolumeProfilePeriodicPeriod? | Periodic period |
historyCount | number? | History count |
histogramColor | string? | Histogram color |
valueAreaColor | string? | Value area color |
pocColor | string? | Point of control color |
vahValColor | string? | Value area high/low color |
developingPocColor | string? | Developing POC color |
VolumeProfileBin
Volume profile bin interface.
Properties:
| Property | Type | Description |
|---|---|---|
price | number | Price level |
volume | number | Volume at price |
percent | number | Percentage of total volume |
isValueArea | boolean | Is in value area |
ProfileLevels
Profile levels interface.
Properties:
| Property | Type | Description |
|---|---|---|
poc | number | null | Point of control |
vah | number | null | Value area high |
val | number | null | Value area low |
developingPoc | number | null | Developing point of control |
VolumeProfileResult
Volume profile result interface.
Properties:
| Property | Type | Description |
|---|---|---|
bins | VolumeProfileBin[] | Volume bins |
levels | ProfileLevels | Profile levels |
totalVolume | number | Total volume |
maxVolume | number | Maximum volume |
bucketSize | number | Bucket size |
rangeStartTime | number | Range start time |
rangeEndTime | number | Range end time |
VolumeProfile
Volume profile interface.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Profile ID |
profileType | ProfileType | Profile type |
visible | boolean | Is visible |
config | VolumeProfileConfig | Configuration |
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:
| Property | Type | Description |
|---|---|---|
profileType | MarketProfileType? | Profile type |
bracketMinutes | number? | Bracket minutes (15, 30, or 60) |
valueAreaPercent | number? | Value area percentage |
rowSizeTicks | number? | Row size in ticks |
placement | MarketProfilePlacement? | Placement |
displayMode | MarketProfileDisplayMode? | Display mode |
showPOC | boolean? | Show point of control |
showVAHVAL | boolean? | Show value area high/low |
showIB | boolean? | Show initial balance |
showSinglePrints | boolean? | Show single prints |
showExcess | boolean? | Show excess tails |
rthEthMode | MarketProfileRthEthMode? | RTH/ETH mode |
fixedStartIndex | number? | Fixed start index |
fixedEndIndex | number? | Fixed end index |
periodicPeriod | MarketProfilePeriodicPeriod? | Periodic period |
compositeSessionCount | number? | Composite session count |
opacity | number? | Opacity |
tpoTextColor | string? | TPO text color |
tpoBlockColor | string? | TPO block color |
valueAreaColor | string? | Value area color |
pocColor | string? | Point of control color |
vahValColor | string? | Value area high/low color |
ibRangeColor | string? | Initial balance range color |
singlePrintColor | string? | Single print color |
excessColor | string? | Excess color |
TpoRow
TPO row interface.
Properties:
| Property | Type | Description |
|---|---|---|
price | number | Price level |
letters | string[] | Bracket letters that touched this price |
bracketIndices | number[] | Original bracket indices for each letter |
count | number | Count of TPOs |
isValueArea | boolean | Is in value area |
isPoc | boolean | Is point of control |
isSinglePrint | boolean | Is single print |
MarketProfileLevels
Market profile levels interface.
Properties:
| Property | Type | Description |
|---|---|---|
poc | number | null | Point of control |
vah | number | null | Value area high |
val | number | null | Value area low |
ibHigh | number | null | Initial balance high |
ibLow | number | null | Initial balance low |
singlePrints | object[] | Single print ranges |
excessTails | object[] | Excess tail ranges |
MarketProfileResult
Market profile result interface.
Properties:
| Property | Type | Description |
|---|---|---|
rows | TpoRow[] | TPO rows |
levels | MarketProfileLevels | Profile levels |
totalTpos | number | Total TPOs |
maxTposPerRow | number | Maximum TPOs per row |
rowSize | number | Row size |
startTime | number | Start time |
endTime | number | End time |
brackets | object[] | Bracket information |
MarketProfile
Market profile interface.
Properties:
| Property | Type | Description |
|---|---|---|
id | string | Profile ID |
profileType | MarketProfileType | Profile type |
visible | boolean | Is visible |
config | MarketProfileConfig | Configuration |
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:
| Property | Type | Description |
|---|---|---|
type | FootprintType | Chart type |
aggregation | string | 'per_candle' only |
layout | FootprintLayout | Layout |
rowSizeMode | FootprintRowSizeMode | Row size mode |
rowSizeTicks | number | Row size in ticks |
showImbalance | boolean | Show imbalance |
showDelta | boolean | Show delta |
showTotal | boolean | Show total |
valueAreaHighlight | boolean | Highlight value area |
imbalanceRatio | number | Imbalance ratio |
fontSize | number | Font size |
rowHeightPx | number | Row height in pixels |
highlightMaxVolumeRow | boolean | Highlight max volume row |
buyColor | string | Buy color |
sellColor | string | Sell color |
neutralColor | string | Neutral color |
imbalanceBuyColor | string | Imbalance buy color |
imbalanceSellColor | string | Imbalance sell color |
pocColor | string | Point of control color |
vaColor | string | Value area color |
FootprintLevel
Footprint level interface.
Properties:
| Property | Type | Description |
|---|---|---|
price | number | Price level |
buyValue | number | Buy value |
sellValue | number | Sell value |
FootprintRow
Footprint row interface.
Properties:
| Property | Type | Description |
|---|---|---|
price | number | Price level |
buyValue | number | Buy value |
sellValue | number | Sell value |
totalValue | number | Total value |
delta | number | Delta |
isPoc | boolean | Is point of control |
isValueArea | boolean | Is in value area |
isBullishImbalance | boolean | Is bullish imbalance |
isBearishImbalance | boolean | Is bearish imbalance |
isStackedImbalance | boolean? | Is stacked imbalance |
FootprintBarData
Footprint bar data interface.
Properties:
| Property | Type | Description |
|---|---|---|
barIndex | number | Bar index |
startTime | number | Start time |
endTime | number | End time |
isFinal | boolean | Is final bar |
rows | FootprintRow[] | Rows |
volume | number | Total volume |
totalValue | number | Total value |
barDelta | number | Bar delta |
buyValue | number | Buy value |
sellValue | number | Sell value |
pocPrice | number | Point of control price |
open | number | Open price |
high | number | High price |
low | number | Low price |
close | number | Close price |
Quick Reference
Most Commonly Used Interfaces
- IBasicDataFeed - Implement this for your data source
- Bar - Historical price data
- SymbolState - Symbol information
- DrawingOptions - Drawing styles
- CustomIndicatorDefinition - Create custom indicators
- MouseEventParam - Event handler parameters
- 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
- Learn about Chart API
- Explore Custom Indicators
- Check DataFeed Implementation