Skip to content
All library documents

Sequential CUSUM Detection of Structural Breaks in Returns

Article MQL5 articles

Summary

The article develops a sequential detector for possible changes in return behavior and describes its implementation as a MetaTrader indicator. It converts prices to log returns, standardizes each observation using a strictly historical rolling window, and updates separate positive and negative cumulative sums. A noise allowance controls which deviations accumulate; crossing a decision threshold signals a breakpoint, after which both sums reset. The threshold trades detection speed against false alarms, and a theoretical average-run-length approximation is discussed for independent standard-normal inputs.

The implementation discussion addresses recalculation, persistent indicator state, and duplicate chart markers. The article emphasizes that the theoretical false-alarm guarantee may not carry over to financial returns, which are not generally independent or normally distributed. It proposes a follow-up empirical study across instruments, timeframes, and market periods, but this installment reports no such validation results. Detected breaks therefore indicate accumulated statistical evidence under the chosen settings; they do not by themselves identify the type of regime change or establish a profitable trading response.

Key ideas

  • CUSUM can flag a change when sequential evidence in standardized returns crosses a threshold.
  • Log returns are standardized against a historical window that excludes the current observation.
  • The allowance parameter filters small deviations, while the threshold controls the speed versus false-alarm trade-off.
  • Both directional accumulators reset after a detection so evidence from separate intervals is not combined.
  • Theoretical alarm-rate approximations rely on distributional assumptions that may not hold for market returns.

Tags

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