Skip to main content
Version: v27

IStudyApi

Interface

API object for interacting with a study.

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

Methods

applyOverrides

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.

Signature

applyOverrides<TOverrides>(overrides: TOverrides) => void

Type parameters

NameType
TOverridesextends Partial<SingleIndicatorOverrides>

Parameters

NameTypeDescription
overridesTOverridesProperty values to override.

Returns

void


applyToEntireLayout

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

Signature

applyToEntireLayout() => void

Returns

void


bringToFront

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

Signature

bringToFront() => void

Returns

void


changePriceScale

Change the price scale that the study is attached to.

Signature

changePriceScale(newPriceScale: EntityId | StudyPriceScale) => void

Parameters

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

Returns

void


getInputValues

Get current values of the study inputs.

Signature

getInputValues() => StudyInputValueItem[]

Returns

StudyInputValueItem[]


getInputsInfo

Get descriptions of the study inputs.

Signature

getInputsInfo() => StudyInputInformation[]

Returns

StudyInputInformation[]


getStyleInfo

Get descriptions of study styles.

Signature

getStyleInfo() => StudyStyleInfo

Returns

StudyStyleInfo


getStyleValues

Get current values of the study styles.

Signature

getStyleValues() => StudyStyleValues

Returns

StudyStyleValues


isUserEditEnabled

Get if user editing is enabled for the study.

Signature

isUserEditEnabled() => boolean

Returns

true if editing is enabled, false otherwise.

boolean


isVisible

Get if the study is visible.

Signature

isVisible() => boolean

Returns

true if visible, false otherwise.

boolean


mergeDown

Merge the study into the pane below, if possible.

Signature

mergeDown() => void

Returns

void


mergeUp

Merge the study into the pane above, if possible.

Signature

mergeUp() => void

Returns

void


onDataLoaded

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

Signature

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

Returns

A subscription.

Example:

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

ISubscription<() => void>


onStudyError

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

Signature

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

Returns

A subscription.

Example:

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

ISubscription<() => void>


sendToBack

Move the study visually behind of all other chart objects.

Signature

sendToBack() => void

Returns

void


setInputValues

Set the value of one or more study inputs.

Signature

setInputValues(values: StudyInputValueItem[]) => void

Parameters

NameTypeDescription
valuesStudyInputValueItem[]Study input values to set.

Returns

void


setUserEditEnabled

Set if user editing is enabled for the study.

Signature

setUserEditEnabled(enabled: boolean) => void

Parameters

NameTypeDescription
enabledbooleantrue if editing should be enabled, false otherwise.

Returns

void


setVisible

Set the study visibility.

Signature

setVisible(visible: boolean) => void

Parameters

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

Returns

void


unmergeDown

Unmerge the study into the pane below, if possible.

Signature

unmergeDown() => void

Returns

void


unmergeUp

Unmerge the study into the pane above, if possible.

Signature

unmergeUp() => void

Returns

void