OPEN-SOURCE SCRIPT

ka66: Enhanced MACD

已更新
This is a more configurable MACD:

  • Allows various moving averages (EMA, SMA, Hull, WMA) instead of just EMA.
  • Better color coding for MACD line, rising vs. falling
  • Optional Normalised Scale; my pet peeve with standard MACD, that we can't really easily compare it across instruments. Taking a page from the ATR Percent indicator, we allow for normalising the MACD and Signal lines relative to Close: MACD / Close x 100. Ditto for the Signal line. This is really useful for reversal type scenarios, and to avoid ranging markets.
  • Threshold horizontal line markers to further support the use of the Normalised Scale. Simply configure this via the Style Settings.

發布通知
Now allow differing moving average types for each component of the MACD: Fast, Slow, Signal. The use case is where we want to gauge the momentum by different moving averages, e.g. a faster one using EMA, and a slower one using a plain SMA.

The chart shows 22-EMA vs. 110 SMA, for example, and its corresponding MACD, with a 16-period SMA signal line.

Visual enhancement: Use gradation of colours in the MACD histogram, for better visual cues on changes, this cue is there in the stock TV MACD, it feels like I can't call this "enhanced" if I take away a useful feature, hey!
發布通知
New Feature(s):

Allow standard deviation bands around the Signal line. Provided in the example chart is one possible use case of these bands, as an earlier detection of reversals (which, let's face it, default MACD is terrible at, and I really like MACD!). When the MACD line is extended from the Signal line, as it enters back into the extended bands, we may see a drop/reversal. Without having to wait for a very laggy crossover!

I have experimented with Keltner Bands in many different contexts, and my initial thought was of using ATR around the Signal Bands, but, for one, ATR requires OHLC data, where as I'm pretty much just comparing the band with its historical self, so while I am not the biggest fan of the over-responsiveness of standard deviation bands (though, I'm getting a better feel for them), in this case it works out.

I also allow differing colors for the Signal line, rising vs. falling vs. neutral (no change). In a trend following context, the Signal line often gives us a stable view of the trend. And fluctuations in the MACD provide pullback points, so having a clear color-coding of the Signal line can be helpful for visual scans of charts.

Removed Feature(s):

There was an option to show the Rate of Change of the MACD line (instead of the MACD itself). I haven't, thus far, found value in it. Though I had an idea that sudden flicks in the ROC could act as early warnings. But I hope the same intent is now covered via the use of bands around the Signal line and touches of those bands by the MACD line.

Happy and Profitable Trading, everyone.

CyclesMoving AveragesTrend Analysis

開源腳本

在真正的TradingView精神中,這個腳本的作者以開源的方式發佈,這樣交易員可以理解和驗證它。請向作者致敬!您可以免費使用它,但在出版物中再次使用這段程式碼將受到網站規則的約束。 您可以收藏它以在圖表上使用。

想在圖表上使用此腳本?

免責聲明