LazyBear

MAC-Z VWAP Indicator [LazyBear]

This a modified MAC-Z using Z-VWAP. Since this uses VWAP, the signals are derived indirectly from both volume and price action.

I have also included a way to smooth MACZ-VWAP, you can enable it via options page.

Note that this will not work on any FX pair, as volume is not available.

Referenced indicators:
Z-distance from VWAP: MAC-Z Indicator: Z-Score:
Complete list of my indicators:
GDoc: docs.google.com...ByMEvm5MLo/edit?usp=sharin...
Chart:

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

Ganz im Spirit von TradingView hat der Autor dieses Skripts es als Open-Source veröffentlicht, damit Trader es besser verstehen und überprüfen können. Herzlichen Glückwunsch an den Autor! Sie können es kostenlos verwenden, aber die Wiederverwendung dieses Codes in einer Veröffentlichung unterliegt den Hausregeln. Sie können es als Favoriten auswählen, um es in einem Chart zu verwenden.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.

Möchten Sie dieses Skript auf einem Chart verwenden?
//
// @author LazyBear 
// List of all my indicators: https://www.tradingview.com/v/4IneGo8h/
//
study("MAC-Z VWAP Indicator [LazyBear]", shorttitle="MACZVWAP_LB")
fastLength = input(12, minval=1, title="MACD Fast MA Length"), slowLength=input(25,minval=1, title="MACD Slow MA Length")
signalLength=input(9, title="MACD Signal Length")
lengthz = input(20, title="Z-VWAP Length")
lengthStdev=input(25, title="Stdev Length")
A=input(1.0, minval=-2.0, maxval=2.0, title="MACZ constant A")
B=input(1.0, minval=-2.0, maxval=2.0, title="MACZ constant B")
useLag=input(false, type=bool, title="Apply Laguerre Smoothing")
gamma = input(0.02, title="Laguerre Gamma")
source = close

calc_laguerre(s,g) =>
    l0 = (1 - g)*s+g*nz(l0[1])
    l1 = -g*l0+nz(l0[1])+g*nz(l1[1])
    l2 = -g*l1+nz(l1[1])+g*nz(l2[1])
    l3 = -g*l2+nz(l2[1])+g*nz(l3[1])
    (l0 + 2*l1 + 2*l2 + l3)/6


calc_zvwap(pds) =>
	mean = sum(volume*close,pds)/sum(volume,pds)
	vwapsd = sqrt(sma(pow(close-mean, 2), pds) )
	(close-mean)/vwapsd

zscore = calc_zvwap(lengthz)
fastMA = sma(source, fastLength)
slowMA = sma(source, slowLength)
macd = fastMA - slowMA
macz_t=zscore*A+ macd/stdev(source, lengthStdev)*B
macz=useLag ? calc_laguerre(macz_t,gamma) : macz_t
signal=sma(macz, signalLength)
hist=macz-signal

plot(hist, color=red, style=area, title="Histogram", transp=85)
plot(macz, color=green, title="MAC-Z", linewidth=2)
plot(signal, color=orange, title="Signal", linewidth=2)