Mirrored MACD [LazyBear]

This is a famous indicator I have seen used by many Forex traders in MT4 platform. This indicator uses the difference between EMA of "close" and EMA of "open" to form the oscillator lines (not just a convergence/divergence calculation between EMA of "close")

Current market state is determined by which histogram is above zero line. For more confirmation, wait for it to cross above Signal line too. Crossing down the signal or zeroline should be the exit condition. Also, look for divergences.

Use plot labels BullHisto/BearHisto/BearLine/BullLine/ZeroLine/Signal for setting up alerts.

Complete list of my indicators:

List of my free indicators:
List of my indicators at Appstore:

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。



// @author lazybear 
// list of all my indicators: 
study("Mirrored MACD [LazyBear]", shorttitle="MIRRMACD_LB")
length=input(20), siglength=input(9)
colorBars=input(false, title="Color bars?")
ma(s,l) => ema(s,l)
mao=ma(open, length), mac =ma(close, length)
mc=mac-mao, mo=mao-mac, signal=sma(mc, siglength)
plot(0, title="ZeroLine", color=gray)

plot(mc, color=green, linewidth=2, style=histogram,title="BullHisto")
plot(mo, color=red, linewidth=2, style=histogram,title="BearHisto")
plot(mo, color=red, linewidth=2,title="BearLine")
plot(mc, color=green, linewidth=2,title="BullLine")
plot(signal, color=blue, linewidth=2,title="Signal")

us=max(mc,mo), bc=us>=signal?(us==mc?lime:maroon):na