Skip to main content
Version: v25

SubscribeEventsMap

Interface

Properties

activeChartChanged

Active chart has changed Note: this event is only applicable to Trading Terminal.

Type

(chartIndex: number) => void

Type declaration

Active chart has changed Note: this event is only applicable to Trading Terminal.

Signature

(chartIndex: number) => void
Parameters
NameTypeDescription
chartIndexnumberindex of the active chart
Returns

void


add_compare

A compare instrument has been added

Type

EmptyCallback


chart_load_requested

New chart is about to be loaded

Type

(savedData: object) => void

Type declaration

New chart is about to be loaded

Signature

(savedData: object) => void
Parameters
NameTypeDescription
savedDataobjectchart data about to be loaded
Returns

void


chart_loaded

Chart has finished loading

Type

EmptyCallback


compare_add

A compare dialog has been shown

Type

EmptyCallback


drawing

A drawing has been added to a chart.

Type

(params: StudyOrDrawingAddedToChartEventParams) => void

Type declaration

A drawing has been added to a chart.

Signature

(params: StudyOrDrawingAddedToChartEventParams) => void
Parameters
NameTypeDescription
paramsStudyOrDrawingAddedToChartEventParamsThe arguments contain an object with the value field that corresponds with the name of the drawing.
Returns

void


drawing_event

Drawing was hidden, shown, moved, removed, clicked, or created

Type

(sourceId: EntityId, drawingEventType: DrawingEventType) => void

Type declaration

Drawing was hidden, shown, moved, removed, clicked, or created

Signature

(sourceId: EntityId, drawingEventType: DrawingEventType) => void
Parameters
NameTypeDescription
sourceIdEntityIddrawing ID
drawingEventTypeDrawingEventTypedrawing event type
Returns

void


edit_object_dialog

Chart / Study Properties dialog is shown

Type

(params: EditObjectDialogEventParams) => void

Type declaration

Chart / Study Properties dialog is shown

Signature

(params: EditObjectDialogEventParams) => void
Parameters
NameTypeDescription
paramsEditObjectDialogEventParamsmeta information about the dialog type and the title of the chart or study
Returns

void


indicators_dialog

Indicators dialog is shown

Type

EmptyCallback


layout_about_to_be_changed

Amount or placement of the charts is about to be changed. Note: this event is only applicable to Trading Terminal.

Type

(newLayoutType: LayoutType) => void

Type declaration

Amount or placement of the charts is about to be changed. Note: this event is only applicable to Trading Terminal.

Signature

(newLayoutType: LayoutType) => void
Parameters
NameTypeDescription
newLayoutTypeLayoutTypewhether the layout is single or multi-chart
Returns

void


layout_changed

Amount or placement of the charts is changed. Note: this event is only applicable to Trading Terminal.

Type

EmptyCallback


load_study_template

A study template has been loaded

Type

EmptyCallback


mouse_down

Mouse button has been pressed

Type

(params: MouseEventParams) => void

Type declaration

Mouse button has been pressed

Signature

(params: MouseEventParams) => void
Parameters
NameType
paramsMouseEventParams
Returns

void


mouse_up

Mouse button has been released

Type

(params: MouseEventParams) => void

Type declaration

Mouse button has been released

Signature

(params: MouseEventParams) => void
Parameters
NameType
paramsMouseEventParams
Returns

void


onAutoSaveNeeded

User has changed the chart. Chart change means any user action that can be undone. The callback function will not be called more than once every 5 seconds. See also auto_save_delay within the Widget constructor options (ChartingLibraryWidgetOptions.auto_save_delay).

Type

EmptyCallback


onMarkClick

User has clicked on a 'mark on a bar'.

Type

(markId: string | number) => void

Type declaration

User has clicked on a 'mark on a bar'.

Signature

(markId: string | number) => void
Parameters
NameTypeDescription
markIdstring | numberID of the clicked mark
Returns

void


onPlusClick

User clicked the "plus" button on the price scale.

Type

(params: PlusClickParams) => void

Type declaration

User clicked the "plus" button on the price scale.

Signature

(params: PlusClickParams) => void
Parameters
NameTypeDescription
paramsPlusClickParamscoordinates, price and symbol information
Returns

void


onScreenshotReady

A screenshot URL has been returned by the server

Type

(url: string) => void

Type declaration

A screenshot URL has been returned by the server

Signature

(url: string) => void
Parameters
NameTypeDescription
urlstringurl of the screenshot
Returns

void


onSelectedLineToolChanged

Selected drawing tool has changed

Type

EmptyCallback


onTick

Last bar has been updated

Type

(tick: Bar) => void

Type declaration

Last bar has been updated

Signature

(tick: Bar) => void
Parameters
NameTypeDescription
tickBardata for last bar
Returns

void


onTimescaleMarkClick

User clicked a 'timescale mark'.

Type

(markId: string | number) => void

Type declaration

User clicked a 'timescale mark'.

Signature

(markId: string | number) => void
Parameters
NameTypeDescription
markIdstring | numberID of the clicked timescale mark
Returns

void


panes_height_changed

Panes' size has changed.

Type

() => void

Type declaration

Panes' size has changed.

Signature

() => void
Returns

void


panes_order_changed

Panes' order has changed.

Type

() => void

Type declaration

Panes' order has changed.

Signature

() => void
Returns

void


redo

Redo action occurred

Type

EmptyCallback


reset_scales

Reset scales button has been clicked

Type

EmptyCallback


series_event

An event related to the series has occurred.

Type

(seriesEventType: "price_scale_changed") => void

Type declaration

An event related to the series has occurred.

Signature

(seriesEventType: "price_scale_changed") => void
Parameters
NameTypeDescription
seriesEventType"price_scale_changed"series event type
Returns

void


series_properties_changed

Main series properties have changed.

Type

(id: EntityId) => void

Type declaration

Main series properties have changed.

Signature

(id: EntityId) => void
Parameters
NameTypeDescription
idEntityIdentity ID
Returns

void


study

An indicator has been added to a chart.

Type

(params: StudyOrDrawingAddedToChartEventParams) => void

Type declaration

An indicator has been added to a chart.

Signature

(params: StudyOrDrawingAddedToChartEventParams) => void
Parameters
NameTypeDescription
paramsStudyOrDrawingAddedToChartEventParamsThe arguments contain an object with the value field that corresponds with the name of the indicator.
Returns

void


study_event

An event related to the study has occurred.

Type

(entityId: EntityId, studyEventType: StudyEventType) => void

Type declaration

An event related to the study has occurred.

Signature

(entityId: EntityId, studyEventType: StudyEventType) => void
Parameters
NameTypeDescription
entityIdEntityIdstudy ID
studyEventTypeStudyEventTypestudy event type
Returns

void


study_properties_changed

Study properties have changed.

Type

(id: EntityId) => void

Type declaration

Study properties have changed.

Signature

(id: EntityId) => void
Parameters
NameTypeDescription
idEntityIdentity ID
Returns

void


toggle_header

Chart header is shown/hidden

Type

(isHidden: boolean) => void

Type declaration

Chart header is shown/hidden

Signature

(isHidden: boolean) => void
Parameters
NameTypeDescription
isHiddenbooleanis the chart header currently hidden
Returns

void


toggle_sidebar

Drawing toolbar is shown/hidden

Type

(isHidden: boolean) => void

Type declaration

Drawing toolbar is shown/hidden

Signature

(isHidden: boolean) => void
Parameters
NameTypeDescription
isHiddenbooleanis the drawing toolbar currently hidden
Returns

void


undo

Undo action occurred

Type

EmptyCallback


undo_redo_state_changed

The Undo / Redo state has been changed.

Type

(state: UndoRedoState) => void

Type declaration

The Undo / Redo state has been changed.

Signature

(state: UndoRedoState) => void
Parameters
NameTypeDescription
stateUndoRedoStatestate of the Undo/Redo stack
Returns

void