Cookbook
MACD with colored histogram
Momentum from two averages.
//@zscript 1
indicator("MACD")
[macdLine, signal, hist] = ta.macd(close, 12, 26, 9)
plot(hist, "Histogram", style=plot.style_columns, color=hist >= 0 ? color.green : color.red)
plot(macdLine, "MACD", color=color.white)
plot(signal, "Signal", color=color.yellow)
How it works
The histogram is the gap between the MACD line and its signal line. Green above zero, red below.
Education only. Not financial advice. Examples are teaching samples, not trading results.
