Skip to content
AlertaChartAlertaScript / docs
AlertaScript / alerta.ta.macd
On this pageSignatureParametersReturnsExample

Momentum / Reference

alerta.ta.macd

TradingView-compatible spelling: ta.macd, runs without warnings

Returns MACD line, Signal line and Histogram.

alerta.ta.macd(source, fast, slow, signal) → [macdLine, signalLine, histogram]

Parameters

NameTypeRequiredDefaultDescription
sourceseriesYes—Series of values to process.
fastintYes—Fast EMA length.
slowintYes—Slow EMA length.
signalintNot specified9Signal line length.

Returns

[macdLine, signalLine, histogram]

Example

alerta.ta.macd
indicator("MACD Pro", overlay=false)[macdLine, signalLine, hist] = macd(close, 12, 26, 9)plot(macdLine, { title: "MACD Line", color: color.blue, pane: "oscillator" })plot(signalLine, { title: "Signal Line", color: color.orange, pane: "oscillator" })plot(hist, { title: "Histogram", style: "histogram", pane: "oscillator" })

Names and aliases

Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.

AlertaScript

No results found.

Search by name, alias, or keyword.