# 指标 API

## 指标API

### isUserEditEnabled()

如果用户能够`删除/更改/隐藏`指标，则返回`true`。

### setUserEditEnabled(enabled)

1. `enabled` - `true` or `false`

启用或禁用用户的`删除/更改/隐藏`指标。

### getInputsInfo()

返回所有输入的信息 - [StudyInputInfo](#studyinputinfo)对象的数组。

### getInputValues()

返回指标输入的值 - [StudyInputValueItem](#studyinputvalueitem)对象。

### setInputValues(inputs)

1. `inputs` 应该是[StudyInputValueItem](#studyinputvalueitem)对象数组。

设置指标的输入值，它可以只包含您希望更改的输入。

### mergeUp()

指标向上合并（如果可能）

### mergeDown()

指标向下合并（如果可能）

### unmergeUp()

取消指标向上合并（如果可能）

### unmergeDown()

取消指标向下合并（如果可能）

### changePriceScale(priceScale)

1. `priceScale` 应该是一个具有下值之一的字符串:
   * `left` - 将指标附加到左边的价格刻度
   * `right` - 将指标附加到右边的价格刻度
   * `no-scale` - 不要将指标纳入任何价格刻度。该指标将以'No Scale'模式添加
   * `as-series` - 将指标附加到住系列的价格刻度（仅当指标和主系列位于同一窗格时才适用）

改变指标的价格刻度

### isVisible()

如果指标可见，将返回`true`

### setVisible(value)

1. `value` - `true` 或 `false`

显示/隐藏指标

### bringToFront()

将指标置于所有其他图表对象之上。

### sendToBack()

将指标放在所有其他图表对象后面。

### applyOverrides(overrides)

1. `overrides` - 指标的新[overrides](https://zlq4863947.gitbook.io/tradingview/fu-lu/studies-overrides)

将 `overrides` 应用于指标。

注意: `overrides` 对象key不需要以指标名称开头。key应用于特定的指标。 例如，您应该使用`style`而不是`Overlay.style`来覆盖Overlay指标的当前样式。

## Primitive types

### StudyInputInfo

具有以下key的对象：

* `id` - 指标的输入id
* `name` - 输入的名称
* `type` - 输入的类型
* `localizedName` - 翻译为当前语言的输入名称

### StudyInputValueItem

具有以下key的对象：

* `id` - 指标的输入id
* `value` - 输入的值


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zlq4863947.gitbook.io/tradingview/fu-lu/study-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
