Skip to content
All library documents

Rolling Z-Score Thresholds for Buy and Sell Signals

Article Strategy library · Author: tradedots

Summary

This strategy standardizes the closing price against its rolling mean and standard deviation to identify unusually large deviations. With the documented default rolling window of 80 bars and threshold of 2.8, it signals a sell when the Z-score exceeds the positive threshold and a buy when it falls below the negative threshold. It also uses a five-bar signal cooldown, closes the opposing position, and opens a position in the indicated direction when backtesting is enabled. The script specifies a 30% of equity default order size, 0.03% commission, and extensive pyramiding capacity.

The material explains the calculation and includes executable strategy logic, but the supplied excerpt gives no backtest results or evidence that threshold extremes predict reversals. A rolling Z-score assumes the recent mean and standard deviation are useful references; changing volatility or a persistent trend can keep values extreme and produce adverse entries. The cooldown limits repeated same-side signals, but does not establish risk limits or validate performance across assets and market conditions.

Key ideas

  • The Z-score measures the close's distance from its rolling mean in units of rolling standard deviation.
  • The strategy sells above a positive threshold and buys below the corresponding negative threshold.
  • A cooldown counter restricts how often same-direction signals can be generated.
  • The script closes the opposite position before opening a new position when backtesting is enabled.
  • The excerpt provides no performance evidence, and extreme readings may persist during trends.

Tags

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