Skip to content

MACDFIX

Summary

MACD with the fast/slow EMAs fixed to the classic 12/26 periods, exposing only the signal period. Thin wrapper that delegates to MACD with fast=slow=0. Signal-line crossovers and histogram sign flag momentum shifts.

Formula

MACD = EMA_12 - EMA_26 (fixed k: 0.15 for 12, 0.075 for 26) Signal = EMA(MACD, signalPeriod), k = 2/(signalPeriod+1) Hist = MACD - Signal

Notes

  • A signal period of 1 disables signal-line smoothing: the signal equals the MACD line and the histogram is zero. Before 0.6.5 this parameter value produced misaligned output (issues #48/#59).

Inputs

  • inReal — Source series (typically close)

Outputs

  • outMACD — Fixed EMA12 minus EMA26
  • outMACDSignal — EMA of the MACD line
  • outMACDHist — MACD minus signal

Parameters

  • optInSignalPeriod — Smoothing period for the signal line

Implementation

TA-Lib Definition: macdfix.c · macdfix.yaml

Native File
C ta_MACDFIX.c
Rust macdfix.rs
Java Core.java

TA-Lib is also available for Python, R and more using a wrapper.

Aliases

Moving Average Convergence/Divergence Fix

See Also

MACD · MACDEXT · EMA · APO