Home  ›  block algo flex  ›  Documentation  ›  MACD

MACD

MACD (Moving Average Convergence Divergence)

The MACD is one of the most popular technical indicators, combining trend-following and momentum analysis. It shows the relationship between two moving averages and helps identify trend direction, momentum shifts, and potential entry/exit points.

How it works: The MACD Line is the difference between a fast EMA and a slow EMA. The Signal Line is an EMA of the MACD Line. The histogram visualizes the distance between the MACD Line and Signal Line.

Resources: TradingView MACD docs

Settings in block algo flex

SettingDescriptionDefault
Use MACD?Enable/disable the indicatorOff
Fast LengthPeriods for the fast moving average12
Slow LengthPeriods for the slow moving average26
SourcePrice component for calculationclose
Signal SmoothingEMA period for the Signal Line9
Oscillator MA TypeMoving average type for the MACD LineEMA
Signal Line MA TypeMoving average type for the Signal LineEMA
TimeframeTimeframe for calculationChart
Buy Line ConditionMACD Line threshold (e.g., "Less Than 0")Less Than 0
Sell Line ConditionMACD Line threshold (e.g., "Greater Than 0")Greater Than 0
Buy ConditionCrossover event (MACD crosses above Signal)Crossover
Sell ConditionCrossunder event (MACD crosses below Signal)Crossunder

How to Interpret

  • MACD crosses above Signal Line — Bullish momentum, potential buy
  • MACD crosses below Signal Line — Bearish momentum, potential sell
  • MACD above zero — Bullish trend bias
  • MACD below zero — Bearish trend bias
  • Histogram expanding — Momentum is increasing
  • Histogram contracting — Momentum is fading

Pro Tip: Combining the line condition (above/below zero) with the crossover condition gives you a two-layer filter: you only take bullish crossovers when MACD is already below zero (buying into a reversal), or when above zero (trading with the trend). Experiment with both approaches.

This is a static view of a single section. For full search and interactivity visit the docs app. Open interactive docs →