LazyBear

MACD Leader [LazyBear]

Smoothing methods have lag, and since MACD makes use of moving averages , it usually lags behind price. You cannot eliminate lag completely, but one way of working around this is by adding a component of the price/MA difference back to MA. This technique is called Zero-lag (well, almost). "MACD Leader" makes use of this to form a leading signal to MACD .

First proposed by Giorgos E. Siligardos, "Leader" leads normal MACD , especially when significant trend changes are about to take place. This has the following features:
- It is similar to MACD in smoothness.
- It can be plotted along with MACD in the same window using the same scaling.
- It has the ability to lead MACD at critical situations

For detailed discussion on the various divergence patterns, refer to the PDF I have linked in the "More Info" below.

I have provided an option to plot MACD and MACD signal on the same pane. You can enable/disable them via options page.

For Pinescript coders: Try enabling histo on this to compare with normal MACD histo :)

More info:
https://drive.google.com/file/d/0Bx48Du_2aPFnYWVlLXV1dW1FQWs/edit?usp=sharing

List of my other indicators:
- Chart:
Master Index: List of all my indicators

- GDoc: https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
Remove from Favorite Scripts Add to Favorite Scripts
//
// @author LazyBear 
// List of all my indicators: 
// https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
//
study("MACD Leader [LazyBear]", shorttitle="MACDL_LB")
src=close
shortLength = input(12, title="Fast Length")
longLength = input(26, title="Slow Length")
sigLength = input(9, title="Signal Length")
showMACD=input(false)
showMACDSignal=input(false)
ma(s,l) => ema(s,l)
sema = ma( src, shortLength )
lema = ma( src, longLength )
i1 = sema + ma( src - sema, shortLength )
i2 = lema + ma( src - lema, longLength )
macdl = i1 - i2
macd=sema-lema

hline(0)
plot( macdl, title="MACDLeader", color=maroon, linewidth=2)
plot(showMACD?macd:na, title="MACD", color=green)
plot(showMACDSignal?sma(macd, sigLength):na, title="Signal", color=red)
List of my free indicators: http://bit.ly/1LQaPK8
List of my indicators at Appstore: http://blog.tradingview.com/?p=970

SQZMACDL would be a perfect combo
Reply
LazyBear PRO QuantitativeExhaustion
2 years ago
SQZMACDL? Is the idea using the momo histo of this Leader in SQZMOM?
+1 Reply
QuantitativeExhaustion PRO LazyBear
2 years ago
Yes
Reply
QuantitativeExhaustion PRO LazyBear
2 years ago
Bollinger Bands and MSCDL merged together to give us a sign of divergence and volatility
+1 Reply
Much better than regular MACD indicator, you do notice the lead rather than the old lag.
Reply
moveon
2 years ago
I made a comparison. Your script gives almost the same signals as this other Zero-Lag MACD script which I found previously (but you have to change this other one from SMA to EMA yourself).

ZeroLag Macd


snapshot



Your version is missing the histogram :) My work-around is to use the classic MACD as histogram:

snapshot
Reply
LazyBear PRO moveon
2 years ago
As I explained in the description above, "Leader" uses ZeroLag technique. That is why it is comparable to ZL-MACD.

Here's a version of "Leader" on ZL-MACD. See how well it "leads" Zero-lag MACD :)

snapshot
+3 Reply
moveon LazyBear
2 years ago
Is the zero-lag MACD (ZL-MACD) the blue line? And is the "Leader" (using zero-lag) the black line?
Reply
LazyBear PRO moveon
2 years ago
yes.

Here's a chart comparing ZL MACD Leader against normal MACD Leader.

snapshot
+2 Reply
moveon LazyBear
2 years ago
Thank you for your comparison! The difference is huge.
Reply
ChartArt LazyBear
2 years ago
This is really interesting. Could you share your script which combines the ZeroLag MACD and ZL MACD Leader with us on Pastebin?
Reply
LazyBear PRO ChartArt
2 years ago
Sure, why not? :)

Here's the source: http://pastebin.com/psW5bfGk

This script can do MACD on both ZeroLag EMA and Kaufman AMA. Here's the chart showing various options:

snapshot
+2 Reply
ChartArt LazyBear
2 years ago
Awesome. This helped me to test my theory.

It looked like it would be possible to use the ZL MACD Leader together with the ZeroLag MACD as entry and exit signal (when they cross each other), but it works not often enough that it's reliable.
Reply
ChartArt ChartArt
2 years ago
Here is a crossing which worked as signal, but most don't:

snapshot
+1 Reply
snapshot


Overlay Indicator that will help with rolling stocks
BB 20 Length 3 Standard Deviation + signs would be great on top of COG Channel
+1 Reply
QuantitativeExhaustion PRO QuantitativeExhaustion
2 years ago
COG Channel lags in rolling up/down moves.

Have noticed BB 20/3 does much better at detecting Sqz or Volatile moves.
+1 Reply
QuantitativeExhaustion PRO QuantitativeExhaustion
2 years ago
snapshot


Another example
+1 Reply
sublimares2
2 years ago
Cool one- played with COG Channel and used MACD Leader on stoch indicator - a new breed :)great work as usual
snapshot
Reply
LazyBear PRO sublimares2
2 years ago
Looks really nice. +1
+1 Reply
So have you found other indicators that are working better than the MACDL for divergence readings?
+1 Reply
LazyBear PRO QuantitativeExhaustion
2 years ago
I dont use MACDL. @submilares2 (user above) may have more input on this.
+1 Reply
mika2k1ff
2 years ago
Can we do this as Volume Weighted MACD?
Reply
LazyBear PRO mika2k1ff
2 years ago
mika, thats a great idea. I got this kinda working, but not sure if its correct, will pass on the src to you.
Reply
duke-jr PRO
a year ago
Mr. Bear - Big fan of this. Seems to work very well when you lengthen the time periods out for longer term investing. I have one request. Can you add the option to make the leader line turn red when it crosses below the zero line and turn green when it crosses above. I actually turn off the other parts of the indicator and follow the leader line crossovers for ease. That would make these signals even more visual. Thanks for all the you do and add to the community !
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out