1021 görüntülenme
//Charts EMA of Gold which seems to inversely follow SP 500 //Created by Trevor Love 2016 //////////////////////////////////////////////////////////// study(title="MACD Gold", shorttitle="MACD Gold") fastLength = input(8, minval=1) slowLength = input(26,minval=1) signalLength=input(11,minval=1) hline(0, color=purple, linestyle=dashed) fastMA = security("GLD", "D", ema(close, fastLength)) slowMA = security("GLD", "D", ema(close, slowLength)) macd = fastMA - slowMA signal = sma(macd, signalLength) series = security("GLD", "D", ema(close, 60)) sersig = series/105 macsig = (macd-signal)*4 maccolor = macsig > 0? falling(macsig, 1)? lime : blue : red pos = iff(signal < macd , 1, iff(signal > macd, -1, nz(pos[1], 0))) barcolor(pos == -1 ? red: pos == 1 ? green : blue) plot(macsig, color=maccolor, style=histogram, linewidth=3) //plot(sersig, color=black, title="GLDSMA") plot(signal, color=red, title="SIGNAL") plot(macd, color=blue, title="MACD")
Yorumlar