Skip to content
All library documents

MACD Zero-Cross Signals with Percentage Stops and Targets

Article Strategy library · Author: Zer3192

Summary

This strategy labels potential tops and bottoms using MACD zero-line crossings combined with the prior bar’s close direction. A downward MACD cross with a lower close signals a short when the existing position is flat or long; an upward cross with a higher close signals a long when flat or short. For an open position, the script places separate full-quantity stop and limit exits at percentage distances from the average entry price. The default stop and target inputs are each one percent.

The document includes a backtest configuration for BTC/USDT futures using daily bars across approximately one year, but it provides no performance statistics or interpretation of results. Despite the title’s reference to divergence, the code does not compare successive price and MACD peaks or troughs; its signals are simple zero-cross and close-direction conditions. The included configuration also sets a stop input to 99, unlike the displayed default, so results would depend on which settings were actually applied. Treat the labels and backtest setup as a strategy sketch, not evidence of profitability.

Key ideas

  • The signal rules combine MACD zero-line crossings with the direction of the latest price close.
  • Signals can reverse an opposing position or enter when the strategy is flat.
  • Stop loss and take profit are placed at percentage offsets from average entry price.
  • The displayed default for both exit distances is one percent.
  • The backtest configuration differs from the default stop input and reports no performance results.

Tags

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