Try Keystone’s Custom Filters for this and 22 other strategies.
The MACD strategy is a classic “trend-following” tool. It stands for Moving Average Convergence Divergence and focuses on the relationship between two different moving averages to gauge changes in strength, direction, and momentum.
How Logic Works
This strategy calculates the difference between a “Fast” and “Slow” exponential moving average to create the MACD line, which is then compared against a “Signal” line.
- The Condition: The strategy monitors the “MACD Line” and the “Signal Line” (an average of the MACD itself).
- Long Entry: Triggered when the MACD crosses above the Signal Line.
- Short Entry: Triggered when the MACD crosses below the Signal Line.
- Execution: Orders are typically executed at the Open of the next bar once the crossover is confirmed on the Close.
Key Customizable Inputs
- FastLength (Default: 12): The period for the shorter-term average.
- SlowLength (Default: 26): The period for the longer-term average.
- MACDLength (Default: 9): The period used to calculate the Signal Line.
Strategic Considerations
- Lag Factor: As a moving average-based tool, MACD is a “lagging” indicator. It confirms a trend has already started rather than predicting one.
- Centering: Some traders also look at the “Zero Line.” Crossovers that happen far above or below the zero line are often considered more powerful than those happening right at the center.
- Divergence: While the KST L1 version automates crossovers, the MACD is also famous for “Divergence” (when price makes a new high but MACD does not), which can be a warning of an impending trend change.