OPEN-SOURCE SCRIPT

PDMA + MA_Dist (%diff of 2 MA's + MA price distance)

Cập nhật
The PDMA + MA_Dist indicator is a powerful tool designed to analyze the relationship between two customizable moving averages (MAs) and the distance of a slow moving average from the price. It provides valuable insights into market trends and potential buying or selling opportunities.

This indicator calculates the percentage difference between the closing price and the fast moving average (MA). It also calculates the percentage difference between the closing price and the slow MA. Additionally, it calculates the percentage difference between the fast MA and the slow MA. These three metrics are then combined to form the final value of the indicator.

By plotting the PDMA + MA_Dist indicator on a chart, users can visualize the dynamics between the MAs and the price. The indicator helps identify periods of bullish or bearish sentiment in the market based on the position of the closing price relative to the MAs. It also highlights potential buying or selling signals when the final value crosses predefined buy or sell levels.

The PDMA + MA_Dist indicator offers a comprehensive perspective on market trends and price movements, assisting traders and investors in making informed decisions.
Phát hành các Ghi chú
Updated to allow switch between SMA & EMA
Phát hành các Ghi chú
Updated interfaces, titles, & TF customization for each MA.
Phát hành các Ghi chú
Added ability to just plot the final value (MA to MA distance + MA_Dist, MA to MA distance, and MA to Price distance)
Phát hành các Ghi chú
Added functionality: choose between, Slow, Fast, or Both MA's to calculate the MA_Dist and Final Value.
Phát hành các Ghi chú
The original code calculates an indicator based on two key factors: the difference between the price and the Moving Average (MA), and the difference between a fast and slow MA. The final value provided by this code is a combination of these two measurements.

The new code introduces a weight parameter which allows you to control the balance between these two measurements. This weight can range from -1 to 1:

When the weight is -1, the final value only considers the difference between the price and the MA, disregarding the difference between the fast and slow MAs.
When the weight is 1, the final value only takes into account the difference between the fast and slow MAs, ignoring the difference between the price and the MA.
When the weight is 0, the final value is a balanced average of both measures, behaving just like the original code.
Importantly, the weight doesn't have to be just -1, 0, or 1. Any value in between is valid, allowing for a gradual bias towards one measure or the other. For example, a weight of 0.3 would calculate a final value that leans towards the difference between fast and slow MAs, but still considers the difference between the price and the MA. This provides more flexibility for fine-tuning the balance based on your analysis needs.
Moving Averages

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