## Reversing MACD

The Reversing MACD (RMACD) was authored by Johnny Dough in the Stocks And Commodities Magazine, January 2012. The MACD itself, the difference of 2 Exponential Moving Averages (EMAs), is a momentum Oscillator authored by Gerald Appel. The RMACD is a reverse engineering of the popular MACD Oscillator. That is, it calculates the price that will cause the MACD to be at a certain value. Three paths, MACD=0, MACD=previous MACD and an signal line (EMA of plot 2) are given. The MACD Indicator is also plotted on a seperate graph. The user may change the input (close), method for Moving Average (EMA) and period lengths. This indicator’s definition is further expressed in the condensed code given in the calculation below. ### How To Trade Using the Reversing MACD

The Reversing MACD may be used in conjuction with other indicators. No trading signals are calculated with this indicator.

### How To Access in MotiveWave

Go to the top menu, choose Study>Custom>Reversing MACD

or go to the top menu, choose Add Study, start typing in this study name until you see it appear in the list, click on the study name, click OK.

Important Disclaimer: The information provided on this page is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security. Please see our Risk Disclosure and Performance Disclaimer Statement.

### Calculation

//input = price, user defined, default is close
//method = moving average, user defined, default is EMA
//period1 = user defined, default is 12
//period2 = user defined, default is 26
//signalPeriod = user defined, default is 9
//index = current bar number

```alphaX = 2.0 / (1 + period1);
alphaY = 2.0 / (1 + period2);
ema1 = ma(method, index, period1, input);
ema2 = ma(method, index, period2, input);
Plot1:macd = ema1 - ema2;
Plot2:macdSignal=ma(method, index, sigPeriod, MACD);
Plot3:hist = macd - macdSignal;
prevEma1 = ema1[index-1];
prevEma2 = ema2[index-1];
prevMacd = macd[index-1];
//substitute 0 for macd
macdValue = 0;
PlotPriceGraph1: pMacdLevel = (macdValue + ((1-alphaY) * prevEma2) - ((1-alphaX) * prevEma1)) / (alphaX - alphaY);
//substitute previous macd for macd
macdValue = prevMacd;
PlotPriceGraph2: pMacdEq = (macdValue + ((1-alphaY) * prevEma2) - ((1-alphaX) * prevEma1)) / (alphaX - alphaY);
PlotPriceGraph3: signal = ma(method, index, sigPeriod, PMACDEQ);```
{"ft_lang_label":"__label__en","ft_lang_prob":0.7584248,"math_prob":0.8663636,"size":2409,"snap":"2020-45-2020-50","text_gpt3_token_len":676,"char_repetition_ratio":0.10810811,"word_repetition_ratio":0.07651715,"special_character_ratio":0.2573682,"punctuation_ratio":0.15525115,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96176744,"pos_list":[0,1,2],"im_url_duplicate_count":[null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-10-29T04:25:48Z\",\"WARC-Record-ID\":\"<urn:uuid:4f4ec07d-007a-4947-9c9a-d944f724e556>\",\"Content-Length\":\"18765\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:4bdf282d-3471-4a79-97b0-e9e62f9b33aa>\",\"WARC-Concurrent-To\":\"<urn:uuid:75bd6086-cd11-4f43-a698-d48c5d27adbe>\",\"WARC-IP-Address\":\"216.239.32.21\",\"WARC-Target-URI\":\"http://motivewave.com/studies/reversing_macd.htm\",\"WARC-Payload-Digest\":\"sha1:JFUXNPFU2B2NL7IKVUPERTCU3VASOBXB\",\"WARC-Block-Digest\":\"sha1:O7LQE5O7UUILYE6QFAVYNXRKVC22F3JR\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-45/CC-MAIN-2020-45_segments_1603107902745.75_warc_CC-MAIN-20201029040021-20201029070021-00524.warc.gz\"}"}