SPL Quantitative Trading Practice Series: The MACD Trading Strategy
The MACD (Moving Average Convergence Divergence), derived from the Exponential Moving Average (EMA), is highly effective for capturing trending market conditions. Its top (bearish) and bottom (bullish) divergences serve as a proven method for “buying the dip and selling the peak”, making it a key consideration for many medium- to long-term investors in real-world trading. In this essay, we will implement the MACD divergence strategy using SPL (Structured Process Language) and conduct backtesting to evaluate its performance. Before offering the SPL code, we need to look at how to compute MACD: 1. Short-term EMA: The short-term exponential moving average. The
...