# Machine Learning Z-Score

A mean-reversion strategy with automatic lookback selection and optional detrending, using z-scores and regime filters.

Canonical: https://prismaticalgos.com/compendium/algo/1114-machine-learning-z-score
Record ID: 1114
Catalog rank: 2776 (reading order, not performance)
Snapshot: 2026-10-31 15:46 UTC
Family: Statistical, Quantitative & Machine Learning (I)
Source: https://www.prorealcode.com/prorealtime-indicators/machine-learning-z-score/
Evidence label (unverified): backtest_shown

## Scope and limitations

These are machine-extracted research records, not verified trading systems. Catalog rank measures specification detail and claimed evidence, not profitability. The catalog extraction pipeline did not independently backtest these records. Its separate selected testing ledger does not validate the wider corpus. Rules, labels and parameters can be incomplete or wrong; consult the original source and its reuse terms.

No endorsement, ownership claim or source-code reuse permission is implied.

## Extraction warnings

Opacity warnings: PARTLY OPAQUE ENTRY: 2.0 of 4 entry conditions reference a value the source never published. The rest is specified.

## Recorded profile

- symbols: any
- timeframes: any
- sessions: any
- market_regime: ranging

## Indicators

- LinearRegression: {"period": 14}; applied to: close
- R2: {"period": 50}; applied to: close
- Average: {"period": 100}; applied to: src
- Std: {"period": 100}; applied to: src

## Recorded long-entry rules

- buyCross = (z[1] <= -zthreshold) AND (z > -zthreshold)
- allowLong = 1 AND z < 0 AND rrLong >= minRR AND barssincebuy >= cooldownBars

## Recorded short-entry rules

- sellCross = (z[1] >= zthreshold) AND (z < zthreshold)
- allowShort = 1 AND z > 0 AND rrShort >= minRR AND barssincesell >= cooldownBars

## Recorded exit rules

- IF inLong = 1 THEN
- IF low <= slLevelLong THEN
- inLong = 0
- ELSIF high >= tpLevelLong THEN
- inLong = 0
- ENDIF
- IF inShort = 1 THEN
- IF high >= slLevelShort THEN
- inShort = 0
- ELSIF low <= tpLevelShort THEN
- inShort = 0
- ENDIF

## Recorded filters

- regimeFilter
- useDetrend
- max spread 2.0 pips

## Risk controls

- Stop loss: slLong  = close - slMult * atr
- Take profit: tpRef = meanSrc
- Position sizing: Not specified
