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.

applyToEntireLayout​

applyToEntireLayout(): Promise<void>

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


bringToFront​

bringToFront(): void

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


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.

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

Moves the indicator to the pane below. Note that this method works only if the pane exists.


mergeUp​

mergeUp(): void

Moves the indicator to the pane above. Note that this method works only if the pane exists.


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.

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.

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

paneIndex​

paneIndex(): number

Get the index of the pane that the study is attached to.

Returns​

number — The pane index.


sendToBack​

sendToBack(): void

Move the study visually behind of all other chart objects.


setInputValues​

setInputValues(values): void

Set the value of one or more study inputs.

Parameters​

NameTypeDescription
valuesStudyInputValueItem[]Study input values to set.

setUserEditEnabled​

setUserEditEnabled(enabled): void

Set if user editing is enabled for the study.

Parameters​

NameTypeDescription
enabledbooleantrue if editing should be enabled, false otherwise.

setVisible​

setVisible(visible): void

Set the study visibility.

Parameters​

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

unmergeDown​

unmergeDown(): void

Moves the indicator to a new pane below. Note that this method does not work if the indicator is the only series on the current pane.


unmergeUp​

unmergeUp(): void

Moves the indicator to a new pane above. Note that this method does not work if the indicator is the only series on the current pane.