RedKTrader

RedK_xMACD: Extending the classic MACD with a simple filter

This is a simple concept that attempts to squeeze more price action insights from the classic MACD
we add a 3rd (longer length, slower) Moving Average line that acts as a trend filter - so whenever we are ("we" = the price and the 2 other MAs) are above that filter line, we consider ourselves to be in the up-trend territory, and vica versa .. so the MACD calculation here - that is represented by the main (reg/green) line in the plot - will represent the distance between the slow MA and the filter MA - when that MACD line crosses the zero axis up or down, that represents the trand reversing from one direction to the other.

A signal line (a smoothed version of that MACD line) is still added for 2 reasons
1 - the signal line makes it easy to see if an eminent trend reversal is to be expected
2 - to stay visually-consistent with the classic MACD :)

the distance (or delta) between the other 2 MAs continues to reflect an indication of the short-term momentum and is what the histogram represents.
we still have the benefit of the convergence/diversion between the price itself and the histogram similar to the classic MACD
this MACD version will also clearly show how price and momentum action will lead the trend -- i know that's a big discussion topic :)

i added a classic MACD at the bottom panel, and used the same length settings (fast / slow) for side-by-side comparison

i coded this when i found that i use 3 moving averages all the time during my chart analysis, and while i'm a big fan of the classic MACD, i wanted to find a simple way to get my MACD to reflect what the 3 MAs on the price chart show. turned out to be insightful - i hope other fellow traders may find this useful

the code is simple and i started it from the built-in MACD in TradingView. Other annotations are added to the chart here as i believe this will better explain how the eXtended MACD works
- there are 4 reversals that occur in that chart, and i chose to show one in step-by-step fashion.

if more explanation is needed to how this can be used, pls let me know in the comments.



Mã nguồn mở

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

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

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

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