LazyBear

Impulse MACD [LazyBear]

Impulse MACD is a modified MACD, formed by filtering out the values in a MA range (region between MAs of high and low), thereby reducing whipsaw typical in a sideways market. This is usually plotted as histogram. This also plots the traditional histogram (MACD - Signal), to help in finding entries/exits.

Use this like a traditional MACD (Zero line crossing or Signal crossing).

Colors legend:
  • Impulse MACD: Possible colors => Lime / Green / Orange / Red, based on the ImpulseMACD position with respect to MidLine and Signal.
  • Impulse MACD Signal: Maroon line.
  • Blue histogram: (ImpulseMACD - Signal).

List of my public indicators: bit.ly/1LQaPK8
List of my app-store indicators: blog.tradingview.com/?p=970

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

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?
//
// @author LazyBear 
// 
// List of my public indicators: http://bit.ly/1LQaPK8 
// List of my app-store indicators: http://blog.tradingview.com/?p=970 
//
//
study("Impulse MACD [LazyBear]", shorttitle="IMACD_LB", overlay=false)
lengthMA = input(34)
lengthSignal = input(9)
calc_smma(src, len) =>
	smma=na(smma[1]) ? sma(src, len) : (smma[1] * (len - 1) + src) / len
	smma

calc_zlema(src, length) =>
	ema1=ema(src, length)
	ema2=ema(ema1, length)
	d=ema1-ema2
	ema1+d

src=hlc3
hi=calc_smma(high, lengthMA)
lo=calc_smma(low, lengthMA)
mi=calc_zlema(src, lengthMA) 

md=(mi>hi)? (mi-hi) : (mi<lo) ? (mi - lo) : 0
sb=sma(md, lengthSignal)
sh=md-sb
mdc=src>mi?src>hi?lime:green:src<lo?red:orange
plot(0, color=gray, linewidth=1, title="MidLine")
plot(md, color=mdc, linewidth=2, title="ImpulseMACD", style=histogram)
plot(sh, color=blue, linewidth=2, title="ImpulseHisto", style=histogram)
plot(sb, color=maroon, linewidth=2, title="ImpulseMACDCDSignal")

ebc=input(false, title="Enable bar colors")
barcolor(ebc?mdc:na)