Home Article MACD indicator histograme MACD indicator histograme Software Technique Web Technique All Computer Language and Computer Language Practice Computer Educa September 10, 2026 0 Comments Share: Facebook Twitter Google+ Pinterest Whatsapp TREDING //@version=6 indicator("MACD Histogram Advanced", shorttitle="MACD HISTO", overlay=false) // ───── Settings ───── fastLength = input.int(12, "Fast Length", minval=1) slowLength = input.int(26, "Slow Length", minval=1) signalLength = input.int(9, "Signal Length", minval=1) // ───── MACD Calculation ───── fastEMA = ta.ema(close, fastLength) slowEMA = ta.ema(close, slowLength) macdLine = fastEMA - slowEMA signalLine = ta.ema(macdLine, signalLength) histogram = macdLine - signalLine // ───── Histogram Colors ───── // Blue = bullish momentum increasing // Light blue = bullish momentum decreasing // Orange = bearish momentum increasing // Light orange = bearish momentum decreasing histColor = histogram >= 0 ? (histogram > histogram[1] ? color.blue : color.new(color.blue, 55)) : (histogram < histogram[1] ? color.orange : color.new(color.orange, 55)) // ───── Histogram ───── plot( histogram, title="Histogram", style=plot.style_columns, color=histColor, linewidth=3 ) // ───── MACD Line ───── plot( macdLine, title="MACD Line", color=color.blue, linewidth=2 ) // ───── Signal Line ───── plot( signalLine, title="Signal Line", color=color.orange, linewidth=2 ) // ───── Zero Line ───── hline( 0, title="Zero Line", color=color.gray, linestyle=hline.style_solid ) Copy Copied Text:
No comments