LazyBear

MAC-Z Indicator [LazyBear]

This indicator is a composite of MACD and Z-Score (requested by @ChartAt). The general idea is that counter-trend component of the Z-score is used to adjust/improve the trend component of the MACD . The advantage is that it is a more accurate and “assumption-free” and can more accurately describe how a market or stock actually works in a given time frame.

I have also added support to smooth out the MAC-Z using Laguerre filter (Thanks @TheLark for the excellent LMA). Note that smoothing removes the "noise" component additive of Z-Score, so you may miss some good signals. By default Laguerre smoothing is OFF, I suggest playing with the Gamma to see if you can find a proper trade-off value.

Theme credits --> @liw0

More info:
http://cssanalytics.wordpress.com/2010/0...
從常用腳本中移除 新增至常用腳本
//
// @author LazyBear 
// List of all my indicators: https://www.tradingview.com/v/4IneGo8h/
//
study("MAC-Z Indicator [LazyBear]", shorttitle="MACZ_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(25, title="ZScore 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_wima(src, length) => 
    MA_s=(src + nz(MA_s[1] * (length-1)))/length
    MA_s

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


zscore = ( source - calc_wima( source, lengthz ) ) / stdev( source, 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=histogram, title="Histogram")
plot(macz, color=green, title="MAC-Z")
plot(signal, color=orange, title="Signal")


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

評論

Anyway to set up buy/sell alerts on the cross?
+4 回覆
Is this a TOS script? I can't get it to work.
any help is appreciated.
L2H
+1 回覆
SO FAR THE BEST IN MY COLLECTION.. SUPER LEADING INDICATOR.. LAZY BEAR.. KING OF INDICATOR..HATS OFF...THANKS
回覆
If I may, since you offered the invitation, traders can experiment with the settings for Laguerre function with the following gamma ratios of 0.577215 (Euler's constant), 0.739085 (Dottie number), 0.618 (fib), 0.786129 (square root of 0.618), 0.809 (one half of 1.618), 0.886 (Spearman's critical value ALSO a critical value for Harmonic patterns). Everyone tends to have personal preference with figures and then of course each trading instrument has their own sine wave frequency. If those figures seem too "slow" or smooth for personal preference simply take a fraction of a particular figure. Example, for ratio 0.886 set the gamma to 0.0886. Hope this helps.

Love your work LB, keep posting!

sjc

回覆
LazyBear cooney_s
Thx for sharing this info. Defn worth checking out.
回覆
Does this work on Mt4?
回覆
LazyBear DJames
This is written in Pinescript (Tradingview's scripting language), so cannot be run directly on MT4.
回覆
Thank you very much! I'm excited to try this out.
回覆
LazyBear ChartArt
yw
回覆
Where is this metatrader 4 version you speak of?
回覆
首頁 股票篩選器 外匯篩選器 加密貨幣篩選器 全球財經日曆 如何運作 圖表功能 價格 推薦朋友 網站規則 幫助中心 網站 & 經紀商解決方案 小工具 圖表解決方案 輕量圖表庫 部落格 & 新聞 推特
概覽 個人資料設定 賬戶和賬單 推薦朋友 代幣 我的客服工單 幫助中心 發表的想法 粉絲 正在關注 私人訊息 在線聊天 登出