Loading…

Regime Composite Score

Deciding whether a market is currently worth trending or fading is usually done by eye. This indicator blends two independent reads of that question into a single trend-quality score, and reports current volatility separately as context rather than folding it into the same number. Kaufman's efficiency ratio measures how much of a window's total price path actually contributed to net movement - a straight line scores close to 1, a market that wandered back over itself scores close to 0. Lag-1 autocorrelation of bar-to-bar returns measures a related but distinct thing: whether a move tends to be followed by another move in the same direction (positive) or a reversal (negative). Averaging the two into one trend axis reduces the chance that either measure's blind spot drives the reading alone - efficiency can be fooled by a slow grind, autocorrelation by short-lived noise. Volatility is tracked as a percentile rank of current short-window volatility against its own trailing history, and is used only to qualify the label - TRENDING/VOLATILE reads differently from a trading plan than TRENDING/QUIET, even though both share the same trend-axis score. House style does not permit the DRAW_COLOR_* line types that would normally paint a continuous coloured chart background for this kind of regime read, so the label lives in a corner panel instead of behind the candles. Notes and limitations - The volatility percentile loop compares the current short-volatility reading against InpVolLookback prior windows computed the same way; a very large InpVolLookback will noticeably slow the first calculation across a long chart history. - Efficiency ratio and autocorrelation are weighted equally with no further calibration - this is a transparent blend, not a fitted model, and the 50/50 split is a starting point worth adjusting per instrument. - The regime label is descriptive, not predictive: TRENDING describes how price has behaved over the lookback windows, not which direction it will continue in. - This does not size a position, place a stop, or account for spread and slippage.

Indicator · MT4 · v1.0 · Free

About Regime Composite Score

Regime Composite Score is an indicator for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 11 settings, such as Er period, Autocorr period and Vol short period. MQL source code included.

Files in the download: RegimeCompositeScore.ex4, RegimeCompositeScore.mq4, RegimeCompositeScore.txt.

Settings

SettingDefaultWhat it does
Er period10Kaufman efficiency-ratio period, bars
Autocorr period20Return pairs used for the lag-1 autocorrelation
Vol short period10Bars in the short volatility window
Vol lookback60Prior windows ranked to build the volatility percentile
Trend threshold65.0Score at or above this = trending
Choppy threshold35.0Score at or below this = choppy
CornerCORNER_LEFT_UPPERPanel corner
X distance10Panel horizontal offset, pixels
Y distance20Panel vertical offset, pixels
Font size10Panel font size
AlertstrueAlert once per closed bar on a regime change

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 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: Oscillator · Trend · Alerts · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria