# Sideways Martingale

Expert Advisor for trading sideways markets using a martingale recovery strategy and AI-based trend detection.

Canonical: https://prismaticalgos.com/compendium/algo/703-sideways-martingale
Record ID: 703
Catalog rank: 983 (reading order, not performance)
Snapshot: 2026-10-31 15:46 UTC
Family: Grid, Martingale & Averaging (C)
Source: https://www.mql5.com/en/code/68537
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

Claim warnings: RECOVERY SIZING: position size increases after losses (martingale/grid/averaging). Equity curves look smooth until the run that does not recover - judge it on worst-case exposure, not win rate.
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: EURUSD, GBPUSD
- timeframes: M5
- sessions: Not specified
- market_regime: ranging

## Indicators

- EMA: {"period": 200}; applied to: close
- ATR: {"period": null}; applied to: close
- Envelopes: {"period": null}; applied to: close

## Recorded long-entry rules

- Price touches or breaks the lower envelope
- AI confirms a sideways market

## Recorded short-entry rules

- Price touches or breaks the upper envelope
- AI confirms a sideways market

## Recorded exit rules

- Total floating profit across all positions >= TakeProfitTargetUSD
- Equity drawdown exceeds a defined percentage

## Recorded filters

- AI Safety Filter for Martingale

## Risk controls

- Stop loss: Margin-based emergency stop
- Take profit: Basket TP (fast exit after mean reversion)
- Position sizing: Lot size increases using a multiplier (LotMultiplier)
