Discussing the article: "Detecting Structural Breakpoints in Price Series Using CUSUM in MQL5 (Part 1): From Statistical Theory to a Working MQL5 Indicator"
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Detecting Structural Breakpoints in Price Series Using CUSUM in MQL5 (Part 1): From Statistical Theory to a Working MQL5 Indicator.
This article builds a sequential CUSUM breakpoint detector for MetaTrader 5, starting from the statistical construction and ending with a working indicator. It explains standardized log-returns, dual accumulators, the role of k and h, and the ARL₀ baseline from Siegmund. The code walkthrough covers buffer persistence, recalculation handling, idempotent chart objects, and a three-pass engine, so you can compile, attach, and use the detector to flag structural regime shifts earlier than fixed-window smoothers.
Trading systems often degrade when market regimes shift. Fixed-window indicators such as moving averages or ATR react only after a structural change has already affected prices, because they summarize the recent past rather than test for an active change.
This article presents a sequential alternative based on the Cumulative Sum (CUSUM) control chart. The method processes returns bar by bar, accumulates evidence of a distributional shift, and declares a breakpoint as soon as a statistical threshold is crossed.
The first half explains the statistical construction of the detector: return standardization, dual accumulators, threshold selection, and reset logic. The second half translates the method into a MetaTrader 5 indicator, CUSUM_Breakpoint.mq5, with attention to buffer persistence, recalculation handling, and chart-object management. A second article follows with a full empirical validation across six instruments, three timeframes, and two macroeconomic periods.
CUSUM watches two running totals built from standardized returns. The moment either one crosses a threshold, a break is declared:
τ=inf{t≥1:S_t^+>h or S_t^-<-h}
Everything in this article explains how S_t^+, S_t^-, and h are built, and exactly what statistical guarantee this single rule provides.
Author: Ushana Kevin Iorkumbul