Skip to main content
Version: v24

SubscribeEventsMap

Interface

Properties

activeChartChanged

Type

(chartIndex: number) => void

Type declaration

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

Parameters
NameTypeDescription
chartIndexnumberindex of the active chart
Returns

void


add_compare

A compare instrument has been added

Type

EmptyCallback


chart_load_requested

Type

(savedData: object) => void

Type declaration

New chart is about to be loaded

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

Type

(params: StudyOrDrawingAddedToChartEventParams) => void

Type declaration

A drawing has been added to a chart.

Parameters
NameTypeDescription
paramsStudyOrDrawingAddedToChartEventParamsThe arguments contain an object with the value field that corresponds with the name of the drawing.
Returns

void


drawing_event

Type

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

Type declaration

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

Parameters
NameTypeDescription
sourceIdEntityIddrawing ID
drawingEventTypeDrawingEventTypedrawing event type
Returns

void


edit_object_dialog

Type

(params: EditObjectDialogEventParams) => void

Type declaration

Chart / Study Properties dialog is shown

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

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.

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

Type

(params: MouseEventParams) => void

Type declaration

Mouse button has been pressed

Parameters
NameType
paramsMouseEventParams
Returns

void


mouse_up

Type

(params: MouseEventParams) => void

Type declaration

Mouse button has been released

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 (auto_save_delay).

Type

EmptyCallback


onMarkClick

Type

(markId: string | number) => void

Type declaration

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

Parameters
NameTypeDescription
markIdstring | numberID of the clicked mark
Returns

void


onPlusClick

Type

(params: PlusClickParams) => void

Type declaration

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

Parameters
NameTypeDescription
paramsPlusClickParamscoordinates, price and symbol information
Returns

void


onScreenshotReady

Type

(url: string) => void

Type declaration

A screenshot URL has been returned by the server

Parameters
NameTypeDescription
urlstringurl of the screenshot
Returns

void


onSelectedLineToolChanged

Selected drawing tool has changed

Type

EmptyCallback


onTick

Type

(tick: Bar) => void

Type declaration

Last bar has been updated

Parameters
NameTypeDescription
tickBardata for last bar
Returns

void


onTimescaleMarkClick

Type

(markId: string | number) => void

Type declaration

User clicked a 'timescale mark'.

Parameters
NameTypeDescription
markIdstring | numberID of the clicked timescale mark
Returns

void


panes_height_changed

Type

() => void

Type declaration

Panes' size has changed.

Returns

void


panes_order_changed

Type

() => void

Type declaration

Panes' order has changed.

Returns

void


redo

Redo action occurred

Type

EmptyCallback


reset_scales

Reset scales button has been clicked

Type

EmptyCallback


series_event

Type

(seriesEventType: "price_scale_changed") => void

Type declaration

An event related to the series has occurred.

Parameters
NameTypeDescription
seriesEventType"price_scale_changed"series event type
Returns

void


series_properties_changed

Type

(id: EntityId) => void

Type declaration

Main series properties have changed.

Parameters
NameTypeDescription
idEntityIdentity ID
Returns

void


study

Type

(params: StudyOrDrawingAddedToChartEventParams) => void

Type declaration

An indicator has been added to a chart.

Parameters
NameTypeDescription
paramsStudyOrDrawingAddedToChartEventParamsThe arguments contain an object with the value field that corresponds with the name of the indicator.
Returns

void


study_event

Type

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

Type declaration

An event related to the study has occurred.

Parameters
NameTypeDescription
entityIdEntityIdstudy ID
studyEventTypeStudyEventTypestudy event type
Returns

void


study_properties_changed

Type

(id: EntityId) => void

Type declaration

Study properties have changed.

Parameters
NameTypeDescription
idEntityIdentity ID
Returns

void


toggle_header

Type

(isHidden: boolean) => void

Type declaration

Chart header is shown/hidden

Parameters
NameTypeDescription
isHiddenbooleanis the chart header currently hidden
Returns

void


toggle_sidebar

Type

(isHidden: boolean) => void

Type declaration

Drawing toolbar is shown/hidden

Parameters
NameTypeDescription
isHiddenbooleanis the drawing toolbar currently hidden
Returns

void


undo

Undo action occurred

Type

EmptyCallback


undo_redo_state_changed

Type

(state: UndoRedoState) => void

Type declaration

The Undo / Redo state has been changed.

Parameters
NameTypeDescription
stateUndoRedoStatestate of the Undo/Redo stack
Returns

void