Discussing the article: "Detecting Structural Breakpoints in Price Series Using CUSUM in MQL5 (Part 2): Implementing the Detector as a Native MQL5 Indicator"

 

Check out the new article: Detecting Structural Breakpoints in Price Series Using CUSUM in MQL5 (Part 2): Implementing the Detector as a Native MQL5 Indicator.

This article benchmarks CUSUM_Breakpoint.mq5 against the Siegmund ARL₀ prediction on live‑like data. The empirical false‑alarm rate is about five times higher than theory for all tested symbols and timeframes, and confirmations show sensitivity to variance changes over mean changes. Practitioners should calibrate h and k on the target instrument's history and apply the signal to manage volatility regimes, not to infer directional shifts.

The Siegmund average run length (ARL) formula is widely used to calibrate CUSUM-based change-point detectors. It provides a closed-form prediction of the number of bars between false alarms under stationary returns. Practitioners use it to set the detection threshold h and to gauge how conservative the configuration is. This article tests whether that prediction holds on real financial data, and the answer is that it does not — not marginally, but by a factor of roughly five across six different instruments and three timeframes.

The indicator under test is CUSUM_Breakpoint.mq5, a two-sided CUSUM detector. It monitors standardized log-returns using two independent accumulators (upward and downward) and declares a breakpoint when either crosses the configurable threshold h. The complete source code is attached to the article and can be compiled and run directly in MetaTrader 5 with no modifications. Part 1 covers the theory behind the indicator: the recurrence equations, the standardization pipeline, the allowance parameter k, and the derivation of the Siegmund formula. This article takes that indicator as a given and asks a single, testable question: does its real-world false-alarm rate match what the textbook formula predicts, and if not, what does it actually detect?

Detecting Structural Breakpoints in Price Series Using CUSUM in MQL5 (Part 2): Implementing the Detector as a Native MQL5 Indicator

Author: Ushana Kevin Iorkumbul