Skip to content
All library documents

Fast and Slow Moving Average Crossovers for Directional Trading

Article Strategy library · Author: ChaoZhang

Summary

This strategy uses a fast and a slow simple moving average to generate directional signals. A cross of the fast average above the slow average opens a long position, while a cross below closes longs and can open shorts. Three operating modes are described: long only, short only, or switching between long and short. Inputs allow users to select price sources and periods; the published defaults are a 3-period fast average and a 9-period slow average.

Optional settings include an initial stop, a trailing stop, and trade alert messages. The accompanying code and published backtest configuration concern BTC/USDT futures, but the document gives no results or evaluation of that test. It warns that crossovers can whipsaw in sideways markets, respond slowly to abrupt events, and be sensitive to parameter choices and trading costs. It proposes adding filters or tuning parameters, but provides no evidence that these changes improve performance. The code’s date condition is set to true, so the configured start and finish dates do not appear to restrict trades.

Key ideas

  • A fast moving average crossing above a slow one triggers a long signal, and crossing below triggers a long exit.
  • The mode settings permit long-only, short-only, or reversing between directions.
  • Initial and trailing stop features are optional, and their point-based settings require market-specific interpretation.
  • Choppy conditions can produce repeated false signals, while trading costs and parameter choice affect outcomes.
  • The published BTC/USDT futures test settings are not accompanied by performance results.

Tags

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