Modified MACD

We have been working on alterations to the MACD indicator to improve its function in a mean reversion capacity. The MACD is a popular indicator that measures the distance between two moving averages and then takes a moving average of the difference to create a signal line. It is traditionally plotted with the MACD line, signal line, and a histogram of the difference between the MACD line and the signal line. This indicator provides valuable insight into both trend strength and mean reversion. If you are unfamiliar with the MACD, we recommend reading Investopedia's explanation, linked below.

Alteration to MACD Formula

We are exploring a different formula to determine the MACD Line. Currently, it is calculated with the following formula: Fast MA – Slow MA. We will replace it with the formula: (Fast MA – Slow MA) / Slow MA. This alteration aims to put the difference between the MAs in relation to the slow, allowing us to compare more extended periods on an even footing. This formula will be utilized when selecting "Modified" for "MACD Calculation."

Possible Overbought (OB) Oversold(OS) Zones

  1. Utilizing the pivot function built into Pine Script, we identify pivot high points above zero and pivot low points below zero. Adding these values in their respective arrays of "Pivot High" and "Pivot Low," we take the averages of the arrays and plot them on the chart.
  2. Bollinger Bands give us two standard deviations above and below a MA. We can also apply a long-term Bollinger Band to the MACD Signal. This method would adjust wide volatility and narrow during quiet markets.
  3. The final possible zones we set up are the previous high/lows.
MACD Modified — Indicator by Ron_C
In an attempt to improve the MACD for trading, I have added an alternative way to calculate the MACD Line and Overbought/Oversold (OB/OS) lines to filter signals. The alternate calculation I named “Modified” and put the option to select it under “MACD Calculation” in the input menu. Traditionally…