Skip to content
All library documents

Regression-Slope Reversals with EMA-Based Stops

Article Strategy library · Author: ChaoZhang

Summary

This strategy uses the change in direction of a linear regression applied to an exponential moving average as its signal. When the regression value turns upward, it records a long entry level at the bar's high and a stop level at its low; a downward turn records the corresponding short levels. A position is opened after price moves beyond the recorded entry level. The system can close an existing position when an opposite regression turn occurs.

After entry, the script uses a separate EMA to help move the stop level when price crosses that EMA, and closes a position when price crosses its stored stop. The document gives default lengths for the slope EMA, stop EMA, and regression calculation, plus backtest settings for BTC/USDT futures on Binance over a single month, but no performance metrics. Its prose describes channel breakouts, while the shown code instead detects regression-slope reversals and uses recorded bar highs or lows as entry levels. The stop and entry rules, parameter fit, and results therefore require independent scrutiny before use.

Key ideas

  • The entry signal is a change in direction of a linear regression applied to an EMA.
  • A turn upward records a long trigger at the signal bar's high, and a downward turn records a short trigger at its low.
  • A separate EMA cross can move the stored stop, which closes the position when breached.
  • An opposite regression turn closes the existing position and can establish the other direction.
  • The document's breakout-channel description does not match the regression-slope reversal logic in the supplied code, and no performance results are given.

Tags

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