Skip to main content
Version: latest

SubscribeEventsMap

Interface

Properties

activeChartChanged

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

Type

(chartIndex: number) => void

Type declaration

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

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

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

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

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 Platform.

Type

(newLayoutType: LayoutType) => void

Type declaration

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 Platform.

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

Signature

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

void


mouse_up

Mouse button has been released

Type

(params: MouseEventParams) => void

Type declaration

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

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

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

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

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

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

Signature

() => void
Returns

void


panes_order_changed

Panes' order has changed.

Type

() => void

Type declaration

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

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

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

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

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

Signature

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

void


toggle_header

Chart header is shown/hidden

Type

(isHidden: boolean) => void

Type declaration

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

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

Signature

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

void


widgetbar_visibility_changed

Chart's widget bar is shown/hidden.

Type

(isVisible: boolean) => void

Type declaration

Signature

(isVisible: boolean) => void
Parameters
NameTypeDescription
isVisiblebooleanif the widget bar is currently hidden
Returns

void