OPEN-SOURCE SCRIPT
Telah dikemas kini 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.
Nota Keluaran
# 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.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.