PROTECTED SOURCE SCRIPT
D2MA

The script is called "D2MA" (Distance to Moving Average). It calculates the distance between the closing price and a user-selected type of moving average (MA). It also plots this distance on a chart, allowing users to see how far the price is from the chosen moving average. Users can choose to display this distance as either an absolute value or as a percentage.
Input Parameters
The script includes functions to calculate different types of moving averages:
The difference between the source price (e.g., closing price) and the calculated moving average. if Distance as Percentage, the distance expressed as a percentage of the moving average value.
Plotting the Data
Signal Line: The signal line changes colour (green or red) based on whether the distance is increasing or decreasing.
Visual Representation
How to Use
Input Parameters
- Length (len): The number of bars (or periods) used to calculate the moving average.
- Source (src): The price data used for calculations, typically the closing price.
- Percentage Distance (pc): A boolean option to display the distance as a percentage instead of an absolute value.
MA Type (maType): The type of moving average to use.
- Simple Moving Average (SMA)
- Exponential Moving Average (EMA)
- Hull Moving Average (HMA)
- Arnaud Legoux Moving Average (ALMA)
- Triple Exponential Moving Average (T3)
- Power Weighted Moving Average (PWMA)
The script includes functions to calculate different types of moving averages:
The difference between the source price (e.g., closing price) and the calculated moving average. if Distance as Percentage, the distance expressed as a percentage of the moving average value.
Plotting the Data
Signal Line: The signal line changes colour (green or red) based on whether the distance is increasing or decreasing.
Visual Representation
How to Use
- Identify Trends: By seeing how far the price is from a selected moving average, traders can gauge the strength of a trend.
- Spot Reversals: Significant deviations from the moving average can signal potential reversals.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 제한 없이 자유롭게 사용할 수 있습니다 — 여기에서 자세히 알아보기.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 제한 없이 자유롭게 사용할 수 있습니다 — 여기에서 자세히 알아보기.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.