# MACD Histogram

> MACD Histogram is an indicator drawn in its own pane.

Source: https://algobarsx.com/docs/ex-15-macd-histogram/

```algobarsx
indicator "MACD Histogram"
    pane: new

input fast = 12
input slow = 26
input signal_length = 9

m = macd(close, fast, slow, signal_length)

plot m.histogram, style: histogram, color: if m.histogram >= 0 then green.fade(30) else red.fade(30)
plot m.macd, color: blue
plot m.signal, color: orange
hline 0, style: dotted, color: gray
mark circle, at: below, when: crosses_above(m.macd, m.signal), color: green
```
What this script says

MACD Histogram is an indicator drawn in its own pane.

You can change 3 inputs: `fast` (default 12), `slow` (default 26) and `signal_length` (default 9).

It calculates `m` as the MACD (source the close, fast `fast`, slow `slow`, signal `signal_length`).

On the chart, it plots `m.histogram`, `m.macd` and `m.signal`; it also draws a horizontal line at 0; it also marks circle below the bar when `m.macd` crosses above `m.signal`.
