Skip to content
All library documents

Double Moving Average Signals with Backtest Date Range Options

Article Strategy library · Author: ChaoZhang

Summary

The document presents a framework intended to compare a double moving average strategy across historical windows. It describes four choices for selecting a period: all available history, a recent number of days or weeks, or manually entered start and end dates. The trading example goes long when a fast simple moving average crosses above a slow one and closes the long when it crosses below. The stated defaults are 14 and 28 periods.

There is a key implementation caveat: although the description says the chosen dates filter bars, the supplied Pine Script defines its window condition as always true. The date inputs therefore do not constrain trades in the code shown. The document offers no comparative backtest results, and it warns that a basic moving average crossover can trade frequently and may need additional risk controls. Date-window comparisons are useful only if the window logic is implemented and validated.

Key ideas

  • The framework describes four ways to select a backtest period: all history, recent days, recent weeks, or manual dates.
  • The example enters long on a fast-over-slow moving average crossover and closes on the reverse crossover.
  • The published code makes its window condition always true, so the date inputs do not filter trades as described.
  • No comparative performance results are provided, and frequent trading is identified as a concern.

Tags

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