MACD Histogram
MACD Histogram is an indicator drawn in its own pane.
core language
indicator "MACD Histogram"pane: newinput fast = 12input slow = 26input signal_length = 9m = 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: blueplot m.signal, color: orangehline 0, style: dotted, color: graymark circle, at: below, when: crosses_above(m.macd, m.signal), color: greenSample data. Not a result. The real AlgoBarsX engine ran this exact script on made-up bars, and this replays what it drew and did. It shows no profit or loss, and it says nothing about how the script would do in a real market.
Replay of this script on 150 sample bars: 3 lines drawn.
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.