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 StudyOverrides |
Parameters
Name | Type | Description |
---|---|---|
overrides | TOverrides | Property 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
Name | Type | Description |
---|---|---|
newPriceScale | EntityId | StudyPriceScale | Price 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
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
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
Name | Type | Description |
---|---|---|
values | StudyInputValueItem [] | Study input values to set. |
Returns
void
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. |
Returns
void
setVisible
▸ setVisible(visible
): void
Set the study visibility.
Parameters
Name | Type | Description |
---|---|---|
visible | boolean | true 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