MACD
The MACD filter measures the difference between a fast and a slow exponential moving average.
What this is
The macd rule evaluates the MACD line. A positive value means the fast EMA is above the slow EMA; a negative value means it is below. This rule is different from macd_signal_cross , which evaluates the MACD line against its signal line.
When to use it
Use MACD above or below zero as a persistent directional-momentum condition. Use a nonzero threshold when the setup requires a larger separation between the two averages.
Before you start
- Defaults are fast: 12 , slow: 26 , and signal: 9 .
- Available operators are above and below .
- Default value is 0 .
- MACD is expressed in price units, so the same numeric threshold is not portable across instruments.
Step by step
Step 1: Choose the timeframe
Use the timeframe on which directional momentum should be measured. Shorter timeframes change sign more frequently.
Step 2: Set the periods
Keep the fast period below the slow period. Smaller periods react faster; larger periods smooth more movement.
Step 3: Set the threshold
Use above 0 for a positive MACD line and below 0 for a negative line. Use the dedicated signal-cross filter if the event relative to the signal line matters.
What you should see
The condition remains true while the MACD line stays on the selected side of the threshold. It is not limited to one crossing candle.
Common mistakes
- confusing the MACD zero line with the signal line
- copying a fixed MACD threshold between differently priced symbols
- expecting MACD to lead price
- combining MACD with multiple moving-average rules that repeat the same information
Related articles
- Filters Reference
- MACD Signal Cross
- EMA Crossover