OPEN-SOURCE SCRIPT

Deviation Adjusted MA

Cập nhật
Overview

The Deviation Adjusted MA is a custom indicator that enhances traditional moving average techniques by introducing a volatility-based adjustment. This adjustment is implemented by incorporating the standard deviation of price data, making the moving average more adaptive to market conditions. The key feature is the combination of a customizable moving average (MA) type and the application of deviation percentage to modify its responsiveness. Additionally, a smoothing layer is applied to reduce noise, improving signal clarity.

Key Components

Customizable Moving Averages
The script allows the user to select from four different types of moving averages:

Simple Moving Average (SMA): A basic average of the closing prices over a specified period.

Exponential Moving Average (EMA): Gives more weight to recent prices, making it more responsive to recent price changes.

Weighted Moving Average (WMA): Weights prices differently, favoring more recent ones but in a linear progression.

Volume-Weighted Moving Average (VWMA): Adjusts the average by trading volume, placing more weight on high-volume periods.

Standard Deviation Calculation
The script calculates the standard deviation of the closing prices over the selected maLength period.
Standard deviation measures the dispersion or volatility of price movements, giving a sense of market volatility.

Deviation Percentage and Adjustment

Deviation Percentage is calculated by dividing the standard deviation by the base moving average and multiplying by 100 to express it as a percentage.
The base moving average is adjusted by this deviation percentage, making the indicator responsive to changes in volatility. The result is a more dynamic moving average that adapts to market conditions.
The parameter devMultiplier is available to scale this adjustment, allowing further fine-tuning of sensitivity.

Smoothing the Adjusted Moving Average

After adjusting the moving average based on deviation, the script applies an additional Exponential Moving Average (EMA) with a length defined by the smoothingLength input.
This EMA serves as a smoothing filter to reduce the noise that could arise from the raw adjustments of the moving average. The smoothing makes trend recognition more consistent and removes short-term fluctuations that could otherwise distort the signal.

Use cases

The Deviation Adjusted MA indicator serves as a dynamic alternative to traditional moving averages by adjusting its sensitivity based on volatility. The script offers extensive customization options through the selection of moving average type and the parameters controlling smoothing and deviation adjustments.

By applying these adjustments and smoothing, the script enables users to better track trends and price movements, while providing a visual cue for changes in market sentiment.
Phát hành các Ghi chú
Added watermark to code
Moving AveragesStandard DeviationTrend Analysis

Mã nguồn mở

Theo tinh thần TradingView thực sự, tác giả của tập lệnh này đã xuất bản dưới dạng nguồn mở để các nhà giao dịch có thể hiểu và xác minh. Chúc mừng tác giả! Bạn có thể sử dụng miễn phí. Tuy nhiên, bạn cần sử dụng lại mã này theo Quy tắc nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?


Ngoài ra, trên:

Thông báo miễn trừ trách nhiệm