Skip to content
All library documents

MACD Crossovers with Histogram-Based Position Exits

Article Strategy library · Author: ChaoZhang

Summary

This document presents a two-direction trading method built around MACD. It calculates fast and slow moving averages and a signal line, then describes taking long positions on upward crosses and short positions on downward crosses. The written overview also describes filtering signals when the histogram lies outside a stated band and closing a position after successive histogram bars change direction. The listed indicator settings include fast, slow, and signal lengths, and allow the calculation to use the chart interval or another interval.

The source and narrative are not fully aligned: the code enters on histogram zero crosses, while the stated band filter is not applied to those entries; the exits use directional histogram conditions. A backtest market and date range are supplied, but no returns, drawdowns, or other results are reported. The document notes that MACD can lag and generate frequent signals, and that histogram-based exits may miss moves. It suggests confirming signals with other indicators and adding explicit loss and profit controls, but does not provide evidence that these changes improve results.

Key ideas

  • The described method uses MACD crossovers to take long and short positions.
  • The narrative proposes a histogram threshold filter and direction-based exits.
  • The supplied code enters on histogram zero crosses, and the stated threshold filter is not applied to those entries.
  • MACD lag and frequent signals can make the strategy vulnerable to whipsaws and delayed reactions.
  • The provided backtest settings contain no reported performance results.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.