Skip to content
All library documents

Simple Moving Average Crossover as a Trend-Following Trading Rule

Article Strategy library · Author: ChaoZhang

Summary

This document describes a basic trend-following rule built from short- and long-period simple moving averages. With defaults of 9 and 21 periods, it signals a long entry when the shorter average crosses above the longer one and a short entry when it crosses below. The accompanying TradingView implementation plots the averages and signals, sends alerts, and submits strategy entries. Although the article frames the crossover as simulating machine-learning decisions, the described logic is a fixed technical rule rather than a trained machine-learning model.

No performance results are provided. The published backtest settings identify BTC-USDT futures and a period from June 2023 to June 2024, but the document gives no metrics with which to assess performance. It notes that moving averages lag, can whipsaw in sideways markets, and may incur costs through frequent trading. The strategy has no stop-loss, and results may depend on parameter choices and market conditions; the suggested additions, such as filters and risk controls, are proposals rather than tested improvements.

Key ideas

  • A short SMA crossing above a longer SMA triggers a long entry, while a downward cross triggers a short entry.
  • The default SMA periods are 9 and 21.
  • The implementation includes chart markers and signal alerts alongside strategy entries.
  • The rule is a fixed moving-average crossover, despite its machine-learning framing.
  • Lag, sideways-market whipsaws, trading costs, and the lack of a stop-loss are stated limitations.

Tags

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