Center of Gravity of the MACD

Center of Gravity of the MACD

1. Introduction

The “Center of Gravity of the MACD” is an advanced indicator that combines the popular MACD (Moving Average Convergence Divergence) with the concept of Center of Gravity, providing a more accurate tool for identifying trends and potential turning points. The MACD is one of the most widely used indicators in technical analysis, as it helps to evaluate the direction and strength of a trend, as well as the divergences between price and market momentum. The Center of Gravity of the MACD takes this tool a step further by applying an advanced smoothing method and adding standard deviation bands, which helps identify key overbought and oversold areas.

2. How the Indicator Works

The indicator is built using the classic components of the MACD along with a polynomial adjustment that calculates the center of gravity and bands based on standard deviation and Fibonacci levels. Here’s a breakdown of its main elements:

  • MACD and Signal Line: These are calculated in the traditional way, using two exponential moving averages of different periods. The difference between the fast moving average (default 12 periods) and the slow moving average (26 periods) forms the MACD, while a third moving average (default 9 periods) is used to smooth the Signal Line. This difference between the MACD and its Signal Line is used as the core of the indicator to identify trends.
  • Center of Gravity (COG): The Center of Gravity is the result of applying a polynomial adjustment to the MACD values, generating a median line that acts as a balance point. This provides a smoother view of the MACD’s movement over time and helps identify more clearly the inflection points where market trends may change.
  • Standard Deviation Bands: These are added to the COG to create a channel that delimits the areas where the MACD deviates significantly from its center of gravity. These bands are calculated using the standard deviation of the differences between the MACD and the COG and are multiplied by an adjustable factor (kstd) to determine their width.
  • Fibonacci Bands: The Fibonacci bands are added as another layer of information and are based on the multiplication of the standard deviation by a Fibonacci factor (fibband). These additional bands act as potential dynamic support and resistance levels.

3. Interpreting the Indicator

The “Center of Gravity of the MACD” provides detailed information about trend direction and strength, as well as potential reversal points:

  • MACD and COG: When the MACD is above the COG, it indicates an uptrend; when it is below, it suggests a downtrend. Crosses between the MACD and the COG can serve as early signals of a possible trend change.
  • MACD Histogram: The histogram, which reflects the difference between the MACD and its Signal Line, changes color to indicate the direction and momentum of the trend:
    • Dark Green: Indicates a strengthening bullish momentum.
    • Light Green: Suggests a weakening bullish momentum.
    • Dark Red: Shows a strengthening bearish momentum.
    • Light Red: Indicates a weakening bearish momentum.
  • Standard Deviation and Fibonacci Bands: The bands act as overbought and oversold zones. When the MACD approaches or crosses the upper band, the market might be overbought, and when it nears or crosses the lower band, it could be oversold. The Fibonacci bands provide additional levels that help identify possible reversal areas.

The “Center of Gravity of the MACD” is, therefore, a comprehensive tool that offers a clear view of trends and potential turning points in the market.

4. Configuring the Indicator in ProRealTime

The “Center of Gravity of the MACD” is a flexible and customizable indicator that can adapt to different trading styles thanks to its configurable parameters. Below are the main parameters that can be adjusted in ProRealTime:

  • fma (Fast Moving Average): Number of periods for the fast moving average used to calculate the MACD. The default value is 12.
  • sma (Slow Moving Average): Number of periods for the slow moving average used to calculate the MACD. The default value is 26.
  • sigma: Number of periods for the moving average that smooths the MACD Signal Line. The default value is 9.
  • m: Controls the degree of the polynomial used to calculate the Center of Gravity. A higher value makes the adjustment more sensitive to variations in the MACD.
  • p: Defines the number of historical bars used to calculate the Center of Gravity. A higher value generates a smoother center, less sensitive to recent fluctuations.
  • kstd: Multiplication factor applied to the standard deviation to calculate the upper and lower bands. A higher value will generate wider bands, reducing overbought or oversold signals.
  • fibband: Fibonacci-based factor used to calculate the additional bands. The default value is 0.618, representing the golden ratio.

These parameters can be adjusted according to the nature of the asset you are analyzing and your investment horizon. For example, in a more volatile market, you might want to increase the “kstd” value to get more precise signals.

5. Advantages and Limitations

Advantages:

  • Combination of Multiple Tools: The Center of Gravity of the MACD combines MACD analysis with smoothing concepts and standard deviation bands, making it a very complete indicator.
  • Identification of Trends and Extreme Zones: The bands provide an effective way to identify potential overbought and oversold zones, while the COG helps identify trend direction.
  • Flexibility: The adjustable parameters allow the indicator to adapt to different financial instruments and trading styles, from intraday trading to swing trading.

Limitations:

  • Complexity: The amount of information provided can be overwhelming for beginner traders, especially if they are not familiar with using the MACD and standard deviation concepts.
  • Parameter Dependence: As with many technical indicators, the results can vary significantly depending on the parameter values. This means users need to carefully adjust these values to obtain accurate signals.
  • Signal Lag: Like other moving average-based indicators, the COG and standard deviation bands can show a certain lag relative to price action.

6. Conclusion

The “Center of Gravity of the MACD” is a powerful and versatile indicator that combines the effectiveness of the MACD with a more advanced approach to smoothing and standard deviation bands. By adding the concept of center of gravity and Fibonacci bands, it provides traders with a clearer and more detailed view of market trends and momentum, as well as potential reversal areas.

This indicator is especially useful for traders looking for a comprehensive tool that not only helps them identify the trend direction but also offers precise entry and exit points based on overbought and oversold zones. However, as with any technical indicator, it is essential to understand its limitations and adjust the parameters according to market characteristics and the instrument being analyzed.

In summary, the Center of Gravity of the MACD is an excellent addition to any trading strategy, and its flexibility and customization make it a valuable tool for both beginner and experienced traders.

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. MaoRai54 • 164 days ago #

    dear Ivan, it seems to be very interesting but please clarify what are all the lines I see in the chart. In your description you mention only the colors red and green but i see lines with other colors and I can’t know what they are referred. Thanks !!

    • Iván • 163 days ago #

      Hi! you have the answer in the last line of code…

      MacdMiddle as “histo” style(histogram,1)coloured(r,g,b,100)
      $fx[p] as “Center of Gravity” coloured(“blue”) style(line,2)
      $sqh[p] as “Upper Band” coloured(“red”) style(line,2)
      $sql[p] as “Lower Band” coloured(“green”) style(line,2)
      $stdh[p] as “Upper Fibonacci Band” coloured(“orange”) style(dottedline,1)
      $stdl[p] as “Lower Fibonacci Band” coloured(“orange”) style(dottedline,1)
      myMacd coloured(“yellow”) style(line,2)
      0 as “zero”

  2. kats • 153 days ago #

    Le Top , a utiliser avec le nuage violet et alerte TN pour plus de précision.

avatar
Register or

Likes

avatar avatar avatar avatar avatar
Related users ' posts
Doddge Hola Iván, ¿sería posible crear un screener que indique cuándo las velas coloreadas del indi...
RTR Ivan thank you for the pro-screener. I a trying to understand how to write the signals from ...
Iván Hi, Lines 62 and 63. These lines define buy and sell conditions.
Iván Hi You should delete from the indicator code all drawing functions and all variables not us...
Iván I've created a screener to show [longcondition or shortcondition]
Chrisinobi Hallo Ivan, Danke das ist Perfekt !! Kannst du bitte in der Screener-Bibliothek die itf. hoc...
MaoRai54 Thanks, now it's OK. in your first code at line 15-16 it's missing.
Madrosat Hello Ivan Did you try a strategy with this indicator
Iván Hi. No I didn't. This is a code translation requested by an user a few days ago.
Fgats https://www.prorealcode.com/topic/indicateur-3-sigma-documentation/ lien pour la documentat...
DELBERT Bonjour , merci pour le partage et la traduction , je vais essayer d'assimiler ce nouvelle i...
Iván
1 year ago
cjr30 Simplemente modifica las lineas 19 y 21 por las siguientes: drawtext("▲",barindex,low-0.1*a...
groelandes Gracias!!
WhyAskOZ i copied the code into strategy and it gives error on line 21 and 23. it says " Line 1: ...
Iván
1 year ago
Madrosat Hello Ivan You have interesting topics on indicators , smart supertrend, optimised trend t...
Iván Hi! thanks. All of these codes are translations requested in the forum. I've on mind to back...
Raspete01 Buenos días Iván, estoy intentando llevar el código eliminando los colores y pasando un Back...
Iván
1 year ago
winnie37 Hi Ivan, if i want to use it, and call the oscillator value (in grey, green or red), how to...
Iván The oscillator is smoothtype. In inputs there is de lag to configure the output
ARLEQUIN49 Hello Ivan, Would it be possible to convert the code of this QQE MOD indicator which accomp...
ARLEQUIN49 here is the code: //@version=4 //By Glaz, Modified // study("QQE MOD") RSI_Period = i...
Iván Hi, Yes I can translate it but please, create a new topic for it.
Fgats quelques explications en Français ici : Some explanations in French here : https://www.p...
Nicolas Merci pour cette contribution, j'apprécie ! :)
Fgats Merci Nicolas pour ces encouragements et merci aussi pour le commentaire en Anglais accompa...
Bateson
1 year ago
MACD Reloaded
MACD Reloaded
2
Indicators
NEOMKEY Nada nuevo
Carlose I love your version of the MACD, if you use it you can get a lot of use out of it, for me ma...
Alai-n I really like it when you develop ideas around price movement! I am much less a fan of all t...
Matriciel Very nice job ! Is it possible to do the opposite because what interests me is to have the ...
YvesRobert Hi Matriciel, how can we do this, because stochastic is limited between 0 and 100 but price ...
Traderfox06 Dear zeiiermantrading, I really like your approach combining adaptive averages with MACD in...
jacquesgermain Hello IASD it's normal , when this occurs, uncheck RSI and MFI line and click then the MAC...
emiliobercial Thank you very much for sharing!
Carlose estoy de acuerdo con IASD Esta muy bien el MAD y el indicador en el precio no se ven bien...
elcortijoverde Muy buen trabajo.Intuitivo y claro.Gracias por tu dedicación y aportación.
Nicolas
2 years ago
B-Xtrender
B-Xtrender
8
Indicators
616248 Bonjour Nicolas, Peux tu nous expliquer le principe de fonctionnement ? Ou nous mettre un...
Nicolas Le lien vers l'article IFTA de l'auteur est dans le post déjà :)
P. Marlowe Very poweful indeed. It deserves close attention. I really appreciate very much IFTA backgro...
JS
2 years ago
Trendilo
Trendilo
1
Indicators
Coded1 very interesting indicator, thanks JS
Nicolas
2 years ago
Lucas0000 Hello, Congratulations on this programming, it seems incredible to me, I am new to this but ...
plbourse Hello, I am trying to use this singal (in fact I have converted it to an indicateur giving B...
manfeber Buenos dias,alguien me podria decir como se descargar el archivo o el indicador Q-Trend??,ya...
Gianluca Amazing, thank You for your contribution!
Alex Spioglou Thank you for featuring my work, and I hope you found it useful. Mind the paper was publ...

Top