OPEN-SOURCE SCRIPT

Deviation Adjusted MA

Kazo_의
업데이트됨
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.
릴리즈 노트
Added watermark to code
Moving AveragesStandard DeviationTrend Analysis

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항