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:
drive.google.co...XV1dW1FQWs/edit?usp=sharin...

List of my other indicators:
- Chart: - GDoc: docs.google.com...ByMEvm5MLo/edit?usp=sharin...

List of my free indicators: bit.ly/1LQaPK8
List of my indicators at Appstore: blog.tradingview.com/?p=970
Skrypt open-source

Zgodnie z prawdziwym duchem TradingView, autor tego skryptu opublikował go jako open-source, aby traderzy mogli go zrozumieć i zweryfikować. Brawo dla autora! Możesz używać go za darmo, ale ponowne wykorzystanie tego kodu w publikacji jest regulowane przez Dobre Praktyki. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.

Chcesz użyć tego skryptu na wykresie?
//
// @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)