Loading…

Rolling Chow Break Strip

Each rolling window of closes is split at its own midpoint. A single straight line is fitted through the whole window (the "no break" hypothesis), and two separate straight lines are fitted through the two halves (the "break at the midpoint" hypothesis). Chow's F-statistic compares how much better the two-line fit explains the data than the one-line fit, scaled by the residual variance: F = ((RSS_pooled - RSS_split) / k) / (RSS_split / (n - 2k)) with k=2 (intercept and slope) and n the window length. A large F means the two-line fit is doing real work - the trend's direction or slope changed somewhere inside the window - not just soaking up ordinary noise around one trend. This catalogue already has a rolling CUSUM strip and a Bayesian change-point tool. Chow's test is a third, structurally different method: CUSUM accumulates a running sum and flags when it drifts too far from zero, a Bayesian change-point tool reports a posterior probability over WHERE a break occurred, and Chow's test is a classical hypothesis test against one FIXED candidate break point (the window midpoint) re-run at every bar as the window slides forward. Because it tests a specific, always- central split rather than searching for the best split or accumulating drift, it responds differently to a market that changes its trend gradually (weak Chow response, since no single midpoint captures a gradual change well) versus one that snaps into a new trend partway through the window (strong Chow response, especially when the snap lands near the window's centre). Running it alongside the other two tools, rather than instead of them, gives three independent readings on "did something change" that tend to agree on the obvious cases and disagree usefully on the ambiguous ones. No exact F-distribution critical value is computed or looked up - see the notes below for why, and what to do instead. Notes and limitations MQL4 has no F-distribution inverse-CDF function, and computing one from scratch accurately is a project of its own rather than a one-line addition. Rather than approximate a p-value badly and imply false precision, this indicator plots the raw F-statistic and a single fixed reference line described honestly as a rule of thumb. A trader who wants a formal significance threshold for a specific window length and alpha should look up F(2, InpWindow-4) in a standard F-table and use that value instead of the default reference line. The break point tested is always the window's exact midpoint - a genuine break that sits noticeably off-centre inside the window (say, one-third of the way through) produces a weaker signal than the same break sitting at the centre, because the test is comparing against a two-line fit that is forced to split exactly in half. This is the classical Chow test's known shape, not a bug in this implementation. Like any rolling-window statistic, a real regime change only fully shows up in the strip once the window has slid past the break point - expect the spike to appear and persist for roughly InpWindow bars rather than fire once and vanish. The indicator does not repaint; each bar's value is fixed once the window behind it is fixed history.

Indicator · MT5 · v1.0 · Free

About Rolling Chow Break Strip

Rolling Chow Break Strip is an indicator for MetaTrader 5. It has 2 settings, such as Window and F reference level. MQL source code included.

Files in the download: RollingChowBreakStrip.ex5, RollingChowBreakStrip.mq5, RollingChowBreakStrip.txt.

Settings

SettingDefaultWhat it does
Window40Rolling window, in bars (must be even, minimum 8)
F reference level3.0Rule-of-thumb reference line, NOT a looked-up critical value (see .txt)

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Trend · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria