Skip to main content

Interface: IStudyApi

Charting Library.IStudyApi

API object for interacting with a study.

You can retrieve this interface by using the IChartWidgetApi.getStudyById method

Methods

applyOverrides

applyOverrides<TOverrides>(overrides): void

Override one or more of the indicator's properties. Refer to Indicator Overrides for more information. Overrides for built-in indicators are listed in SingleIndicatorOverrides.

Type parameters

NameType
TOverridesextends Partial<SingleIndicatorOverrides>

Parameters

NameTypeDescription
overridesTOverridesProperty values to override.

Returns

void


applyToEntireLayout

applyToEntireLayout(): void

Copies the study to all charts in the layout. Only applicable to multi-chart layouts (Trading Platform).

Returns

void


bringToFront

bringToFront(): void

Move the study visually in front of all other chart objects.

Returns

void


changePriceScale

changePriceScale(newPriceScale): void

Change the price scale that the study is attached to.

Parameters

NameTypeDescription
newPriceScaleEntityId | StudyPriceScalePrice scale identifier, or the ID of another study whose price scale the study should be moved to.

Returns

void


getInputValues

getInputValues(): StudyInputValueItem[]

Get current values of the study inputs.

Returns

StudyInputValueItem[]


getInputsInfo

getInputsInfo(): StudyInputInformation[]

Get descriptions of the study inputs.

Returns

StudyInputInformation[]


getStyleInfo

getStyleInfo(): StudyStyleInfo

Get descriptions of study styles.

Returns

StudyStyleInfo


getStyleValues

getStyleValues(): StudyStyleValues

Get current values of the study styles.

Returns

StudyStyleValues


isUserEditEnabled

isUserEditEnabled(): boolean

Get if user editing is enabled for the study.

Returns

boolean

true if editing is enabled, false otherwise.


isVisible

isVisible(): boolean

Get if the study is visible.

Returns

boolean

true if visible, false otherwise.


mergeDown

mergeDown(): void

Merge the study into the pane below, if possible.

Returns

void


mergeUp

mergeUp(): void

Merge the study into the pane above, if possible.

Returns

void


onDataLoaded

onDataLoaded(): ISubscription<() => void>

Get a subscription that can be used to subscribe a callback when the study data has loaded.

Returns

ISubscription<() => void>

A subscription.

Example:

studyApi.onDataLoaded().subscribe(
null,
() => console.log('Study data is loaded'),
true
);

onStudyError

onStudyError(): ISubscription<() => void>

Get a subscription that can be used to subscribe a callback when the study has an error.

Returns

ISubscription<() => void>

A subscription.

Example:

studyApi.studyApi.onStudyError().subscribe(
null,
() => console.log('Study error'),
true
);

sendToBack

sendToBack(): void

Move the study visually behind of all other chart objects.

Returns

void


setInputValues

setInputValues(values): void

Set the value of one or more study inputs.

Parameters

NameTypeDescription
valuesStudyInputValueItem[]Study input values to set.

Returns

void


setUserEditEnabled

setUserEditEnabled(enabled): void

Set if user editing is enabled for the study.

Parameters

NameTypeDescription
enabledbooleantrue if editing should be enabled, false otherwise.

Returns

void


setVisible

setVisible(visible): void

Set the study visibility.

Parameters

NameTypeDescription
visiblebooleantrue if the study should be visible, false otherwise.

Returns

void


unmergeDown

unmergeDown(): void

Unmerge the study into the pane below, if possible.

Returns

void


unmergeUp

unmergeUp(): void

Unmerge the study into the pane above, if possible.

Returns

void