Skip to content
All library documents

Trend Following with a Smoothed Short- and Long-Term Cost Deviation

Article Strategy library · Author: ChaoZhang

Summary

This strategy estimates short-term cost as the midpoint between the highest high and lowest low over a recent window, then compares it with a long-term simple moving average of closing prices. A simple moving average smooths that deviation. Values above a positive threshold indicate an upward trend; values below its negative indicate a downward trend. The script enters in the indicated direction and closes a position when the opposite signal appears. Its listed defaults are a short-term window of five bars, a long-term window of twenty, a smoothing window of five, and a zero threshold.

The document presents the method as a way to react to emerging moves while smoothing noisy signals, and suggests testing alternate cost measures, smoothing methods, thresholds, and entry filters. It includes a one-month BTC/USDT futures backtest configuration at hourly resolution, but reports no trades, returns, or other results. The claimed reduction in consolidation losses is therefore not demonstrated. Threshold choice, repeated reversals in sideways markets, and sensitivity to parameter selection remain important limitations; robust testing across regimes and markets is needed.

Key ideas

  • Short-term cost is the midpoint of the recent high-low range.
  • Long-term cost is calculated as a simple moving average of closes.
  • A smoothed deviation from long-term cost generates directional trend signals around a threshold.
  • The example enters in the signal direction and closes when the opposite direction appears.
  • The published backtest settings do not include performance results, so the strategy's effectiveness is unverified.

Tags

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