# Market Structure Algo

Detects market structure changes and provides entry and exit signals based on swing pivots and trend states.

Canonical: https://prismaticalgos.com/compendium/algo/1174-market-structure-algo
Record ID: 1174
Catalog rank: 10 (reading order, not performance)
Snapshot: 2026-10-31 15:46 UTC
Family: Price Action & Market Structure (E)
Source: https://www.prorealcode.com/prorealtime-indicators/market-structure-algo/
Evidence label (unverified): source_code

## 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

No automated warnings recorded; this is not validation.

## Recorded profile

- symbols: any
- timeframes: any
- sessions: any
- market_regime: trending|volatile

## Indicators

- Pivot High Detection: {"prdleftInt": 5}; applied to: high
- Pivot Low Detection: {"prdleftInt": 5}; applied to: low
- External Pivot High Detection: {"prdleftExt": 30}; applied to: high
- External Pivot Low Detection: {"prdleftExt": 30}; applied to: low
- ATR-based Value Zone: {"dist": 2.0}; applied to: close

## Recorded long-entry rules

- close > ph AND ms[1] < 0
- close > ph AND ms[1] > 0 AND NOT longsig1[1] AND NOT longsig[1]

## Recorded short-entry rules

- close < pl AND ms[1] > 0
- close < pl AND ms[1] < 0 AND NOT shortsig1[1] AND NOT shortsig[1]

## Recorded exit rules

- high > ph AND close < ph
- low < pl AND close > pl

## Recorded filters

- Not specified.

## Risk controls

- Stop loss: last pivot level (ph for shorts, pl for longs)
- Take profit: not explicitly stated
- Position sizing: not explicitly stated
