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
| Name | Type |
|---|---|
TOverrides | extends Partial<SingleIndicatorOverrides> |
Parameters
| Name | Type | Description |
|---|---|---|
overrides | TOverrides | Property 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
| Name | Type | Description |
|---|---|---|
newPriceScale | EntityId | StudyPriceScale | Price 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
getInputsInfo
getInputsInfo(): StudyInputInformation[]
Get descriptions of the study inputs.
Returns
getStyleInfo
getStyleInfo(): StudyStyleInfo
Get descriptions of study styles.
Returns
getStyleValues
getStyleValues(): StudyStyleValues
Get current values of the study styles.
Returns
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.
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
);
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
| Name | Type | Description |
|---|---|---|
values | StudyInputValueItem[] | Study input values to set. |
setUserEditEnabled
setUserEditEnabled(enabled): void
Set if user editing is enabled for the study.
Parameters
| Name | Type | Description |
|---|---|---|
enabled | boolean | true if editing should be enabled, false otherwise. |
setVisible
setVisible(visible): void
Set the study visibility.
Parameters
| Name | Type | Description |
|---|---|---|
visible | boolean | true 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.