OPEN-SOURCE SCRIPT
已更新 MA Deviation Indicator

# MA Deviation Indicator (MADI)
A TradingView indicator designed to visualize price deviation from moving averages and help identify optimal entry and exit points.
## Overview
This indicator measures how much the current price deviates from its moving average and provides the following features:
- Moving average line display
- Configurable deviation rate levels
- Signal display based on deviation rates
- Real-time deviation rate calculation
## Key Features
### 1. Moving Average Display
- Choose between **EMA (Exponential Moving Average)** or **SMA (Simple Moving Average)**
- Default period: 21
- Displayed as an aqua-colored line
### 2. Deviation Rate Levels
- **Level 1 (Default 0.7%)**: Light gray lines
- **Level 2 (Default 2.0%)**: Dark gray lines
- Displayed symmetrically above and below the moving average
### 3. Deviation Rate Signals
- **Red triangles**: Within 0.7% deviation (optimal range)
- **Orange triangles**: 0.7%-2.0% deviation (caution range)
- Displayed as small triangles at the top of the chart
## Configuration Parameters
### Moving Average Settings
| Parameter | Default Value | Description |
|-----------|---------------|-------------|
| Moving Average Period | 21 | Calculation period for moving average (1-200) |
| Moving Average Type | EMA | Type of moving average (EMA/SMA) |
### Deviation Rate Settings
| Parameter | Default Value | Description |
|-----------|---------------|-------------|
| Deviation Rate 1 (%) | 0.7 | First deviation rate level (0.1-10.0%) |
| Deviation Rate 2 (%) | 2.0 | Second deviation rate level (0.1-10.0%) |
### Display Settings
| Parameter | Default Value | Description |
|-----------|---------------|-------------|
| Show Moving Average Line | true | Show/hide moving average line |
| Show Deviation Rate Signals | false | Show/hide deviation rate signals |
| Show Deviation Rate Levels | true | Show/hide deviation rate level lines |
---
**Disclaimer**: This indicator is not investment advice. In actual trading, combine multiple indicators and implement proper risk management.
A TradingView indicator designed to visualize price deviation from moving averages and help identify optimal entry and exit points.
## Overview
This indicator measures how much the current price deviates from its moving average and provides the following features:
- Moving average line display
- Configurable deviation rate levels
- Signal display based on deviation rates
- Real-time deviation rate calculation
## Key Features
### 1. Moving Average Display
- Choose between **EMA (Exponential Moving Average)** or **SMA (Simple Moving Average)**
- Default period: 21
- Displayed as an aqua-colored line
### 2. Deviation Rate Levels
- **Level 1 (Default 0.7%)**: Light gray lines
- **Level 2 (Default 2.0%)**: Dark gray lines
- Displayed symmetrically above and below the moving average
### 3. Deviation Rate Signals
- **Red triangles**: Within 0.7% deviation (optimal range)
- **Orange triangles**: 0.7%-2.0% deviation (caution range)
- Displayed as small triangles at the top of the chart
## Configuration Parameters
### Moving Average Settings
| Parameter | Default Value | Description |
|-----------|---------------|-------------|
| Moving Average Period | 21 | Calculation period for moving average (1-200) |
| Moving Average Type | EMA | Type of moving average (EMA/SMA) |
### Deviation Rate Settings
| Parameter | Default Value | Description |
|-----------|---------------|-------------|
| Deviation Rate 1 (%) | 0.7 | First deviation rate level (0.1-10.0%) |
| Deviation Rate 2 (%) | 2.0 | Second deviation rate level (0.1-10.0%) |
### Display Settings
| Parameter | Default Value | Description |
|-----------|---------------|-------------|
| Show Moving Average Line | true | Show/hide moving average line |
| Show Deviation Rate Signals | false | Show/hide deviation rate signals |
| Show Deviation Rate Levels | true | Show/hide deviation rate level lines |
---
**Disclaimer**: This indicator is not investment advice. In actual trading, combine multiple indicators and implement proper risk management.
發行說明
# MA Deviation Indicator (MADI)A TradingView indicator designed to visualize price deviation from moving averages and help identify optimal entry and exit points.
## Overview
This indicator measures how much the current price deviates from its moving average and provides the following features:
- Moving average line display
- Configurable deviation rate levels
- Signal display based on deviation rates
- Real-time deviation rate calculation
## Key Features
### 1. Moving Average Display
- Choose between **EMA (Exponential Moving Average)** or **SMA (Simple Moving Average)**
- Default period: 21
- Displayed as an aqua-colored line
### 2. Deviation Rate Levels
- **Level 1 (Default 0.7%)**: Light gray lines
- **Level 2 (Default 2.0%)**: Dark gray lines
- Displayed symmetrically above and below the moving average
### 3. Deviation Rate Signals
- **Red triangles**: Within 0.7% deviation (optimal range)
- **Orange triangles**: 0.7%-2.0% deviation (caution range)
- Displayed as small triangles at the top of the chart
## Configuration Parameters
### Moving Average Settings
| Parameter | Default Value | Description |
|-----------|---------------|-------------|
| Moving Average Period | 21 | Calculation period for moving average (1-200) |
| Moving Average Type | EMA | Type of moving average (EMA/SMA) |
### Deviation Rate Settings
| Parameter | Default Value | Description |
|-----------|---------------|-------------|
| Deviation Rate 1 (%) | 0.7 | First deviation rate level (0.1-10.0%) |
| Deviation Rate 2 (%) | 2.0 | Second deviation rate level (0.1-10.0%) |
### Display Settings
| Parameter | Default Value | Description |
|-----------|---------------|-------------|
| Show Moving Average Line | true | Show/hide moving average line |
| Show Deviation Rate Signals | false | Show/hide deviation rate signals |
| Show Deviation Rate Levels | true | Show/hide deviation rate level lines |
---
**Disclaimer**: This indicator is not investment advice. In actual trading, combine multiple indicators and implement proper risk management.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。