Skip to content
All library documents

Higher-Timeframe and Current-Timeframe Moving Average Trend Signals

Article Strategy library · Author: ChaoZhang

Summary

This strategy uses two moving averages on different timeframes to set a long or short direction. The source calculates a short simple moving average on the current chart and another on a configurable higher timeframe, defaulting to daily. When the current average is above the higher-timeframe average, it enters long; when below, it enters short. Long and short trading can be enabled separately, and the example sizes positions as a proportion of strategy equity.

The accompanying discussion presents the method as a simple trend-following example and notes that moving-average signals lag and can be repeatedly crossed in ranging markets. It suggests testing parameter combinations and considering added filters, stops, and position controls. The published test uses BTC/USDT futures over about one month, but no performance results are supplied. Despite the title and description referring to exponential averages and crossovers, the source actually calculates simple moving averages and checks their relative values, so the implementation should be understood on those terms.

Key ideas

  • The strategy compares a current-timeframe simple moving average with one calculated on a higher timeframe.
  • It enters long when the current average is above the higher-timeframe average and short when it is below.
  • The code allows long and short directions to be enabled separately and sizes orders relative to equity.
  • Ranging markets can produce whipsaws, while lagging averages may delay entries.
  • The source uses simple moving averages and relative-value checks despite the EMA crossover title.

Tags

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