TradeZoro
Notifications

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)
-2.76-0.930.892.714.53
Sample bars, not market data. MACD.

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.

Zscript is coming soon

The manual opens when Zscript launches.

Back to home