Discontinued signal line – MACD

v10.3
Discontinued signal line – MACD

A lot of indicators are using signal lines in order to determine the trend (or some desired state of the indicator) easier. The idea of the signal line is easy : comparing the value to it’s smoothed (slightly lagging) state, the idea of current momentum/state is made

Discontinued signal line is inheriting that simple simple idea and it is extending it : instead of having one signal line, more lines depending on the current value of the indicator. “Signal” line is calculated the following way :

  • When some level is crossed in the desired direction, ema of that value is calculated for the desired signal line
  • When that levels is crossed in the opposite direction, previous “signal” line value is simple “inherited” and it becomes a kind of a level

This way it becomes a combination of signal lines and levels trying to combine the good from both methods

(description from its original author: mladen).

This is the original MACD (difference from 2 exponential moving average) with the “dsl” (discontinued signal line) acting as the signal line to trigger buy/sell orders.

When the oscillator is above the upper signal line, the line is coloured in green (bullish signal), and when it is below the lower signal line, it is coloured in orange (bearish signal).

Code translated from MT4 version.

 

 

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

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Bard Did anyone get an error with lines 25 and 26?
Nicolas
9 years ago
ZeroLag MACD
ZeroLag MACD
13
Indicators
sam00075 Hi Nicolas, can you please upload a version with TEMA, so those who don't know how to code c...
Nicolas Use the MACD code here: https://www.prorealcode.com/topic/standard-prt-code-for-macd/#post-1...
Alai-n Afin d'avoir l'Histogramme Macd il faut rajouter ligne18 : HistogrammeMacd = ZeroLagMACD - S...
Nicolas
9 years ago
Nicolas Just replace the last line with this : RETURN dm as "Volume Weighted MACD", masignal as "Si...
thomas2004ch I happen to read this article. I would say the formel 'd = maslow - mafast' could be inverse...
Nicolas You are right! but still the picture is looking good. The formula is inverted! dunno why :) ...
Nicolas
9 years ago

Top