TradingView
LazyBear
Apr 29, 2015 4:35 AM

Impulse MACD [LazyBear] 

U.S. Dollar/Japanese YenFXCM

Description

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
Comments
USMCPatriot71
Great indicator. Recommended settings for a 1 minute scalp on futures.
xstreamSTL
After watching a Youtube video about this indicator, I am not seeing two lines that indicate action (buy or sell) when they cross, like the video shows. Am I missing something?
RogerinhoRamos
@xstreamSTL, também estou tentando alterar para estratégia com níveis de sobre compra e sobre venda no impulso, mas não encontro o que é a smma...
xstreamSTL
@RogerinhoRamos, OK I am looking forward to that new upgrade, nice job so far.
xstreamSTL
@RogerinhoRamos, I would do a search on Indicators for "SMMA".
Arun72783986
@xstreamSTL, You have to change the settings of Colour 0 in the settings, change "histogram" to "line"
EmanuelAlho
@xstreamSTL, version 5 with alert lines!

//
// @Author LazyBear
//
// List of my public indicators: bit.ly/1LQaPK8
// List of my app-store indicators: blog.tradingview.com/?p=970
//
//@version=5
indicator("Impulse MACD [LazyBear]", shorttitle="IMACD_LB", overlay=false)
lengthMA = input(34)
lengthSignal = input(9)
ebc = input(false, title='Enable bar colors')
alert_lines = input(false, title='Enable control lines')

calc_smma(src, len) =>
smma = 0.0
sma_1 = ta.sma(src, len)
smma := na(smma[1]) ? sma_1 : (smma[1] * (len - 1) + src) / len
smma

calc_zlema(src, length) =>
ema1 = ta.ema(src, length)
ema2 = ta.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 = ta.sma(md, lengthSignal)
sh = md - sb
mdc = src > mi ? src > hi ? color.lime : color.green : src < lo ? color.red : color.orange
plot(0, color=color.new(color.gray, 0), linewidth=1, title='MidLine')
plot(md, color=mdc, linewidth=2, title='ImpulseMACD', style=plot.style_line)
plot(sh, color=color.new(color.blue, 0), linewidth=2, title='ImpulseHisto', style=plot.style_histogram)
plot(sb, color=color.new(color.maroon, 0), linewidth=2, title='ImpulseMACDCDSignal')

alert_line1 = hline(alert_lines ? 0.0550 : na, color=color.new(color.white, 20), title="AlertL1", linestyle=hline.style_dotted, linewidth=1, editable=false)
alert_line2 = hline(alert_lines ? -0.0550 : na, color=color.new(color.white, 20), title="AlertL2", linestyle=hline.style_dotted, linewidth=1, editable=false)
// ebc = input(false, title='Enable bar colors')
barcolor(ebc ? mdc : na)
xstreamSTL
@EmanuelAlho, I'm going to try this out, thanks!
TAZ44MONEY
@EmanuelAlho, doesnt work
Kolmanares
@EmanuelAlho,  Mismatched input 'smma' expecting 'end of line without line continuation'
More