Skip to content
All library documents

Moving Average Crossover Trend Strategy with Long Entries and Fixed Exits

Article Strategy library · Author: ChaoZhang

Summary

This strategy uses a fast and slow simple moving average to identify trend changes. A bullish crossover prompts a long entry, while the implementation also describes closing a long when price crosses the slow average. The accompanying explanation presents crossovers in both directions as long and short signals, but the supplied code enters long positions only. It calculates moving averages from daily opening prices and includes configurable profit-taking and stop levels based on the average entry price.

The document gives example periods in its explanation and separate parameter defaults in the implementation, alongside a short Bitcoin futures backtest configuration; it reports no backtest results. It identifies lag and repeated false signals in ranging markets as key limitations, and suggests testing filters, exit rules, trading costs, and asset-specific periods. The repaint setting affects how the daily source data is requested, so results should be interpreted with attention to that configuration and the brief test window.

Key ideas

  • A fast moving average crossing above a slow average is used to trigger a long entry.
  • The implementation derives both moving averages from daily opening prices.
  • Profit-taking and stop levels are set as percentages of the average entry price.
  • The prose describes short signals, but the provided code does not open short positions.
  • Lag, range-bound whipsaws, repaint configuration, and trading costs affect evaluation.

Tags

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