# TrendContinuation and Pullback

Dual strategy for XAUUSD on M5 timeframe using EMA and ATR with fixed lot size and risk management.

Canonical: https://prismaticalgos.com/compendium/algo/11581-trendcontinuation-and-pullback
Record ID: 11581
Catalog rank: 794 (reading order, not performance)
Snapshot: 2026-10-31 15:46 UTC
Family: Unclassified (?)
Source: https://github.com/caoruihua/sanqing-ea
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

Build warnings: MT4_ONLY: the captured source is MQL4 / written for MetaTrader 4. It needs porting (order functions, indicator handles) before it runs on MT5.

## Recorded profile

- symbols: XAUUSD
- timeframes: M5
- sessions: Not specified
- market_regime: trending|volatile

## Indicators

- EMA: {"period": 9}; applied to: close
- EMA: {"period": 21}; applied to: close
- ATR: {"period": 14}; applied to: close

## Recorded long-entry rules

- EMA9 > EMA21
- Breakout of last two highs by ATR threshold
- Candle body reaches minimum ATR ratio

## Recorded short-entry rules

- EMA9 < EMA21
- Rebound to trend direction
- Shadow rejection of minimum ATR ratio

## Recorded exit rules

- Dynamic SL/TP with phase-based protection

## Recorded filters

- ATR/Spread ratio minimum threshold
- Daily profit limit of $50

## Risk controls

- Stop loss: Initial SL, then phase-based adjustment
- Take profit: Initial TP, then phase-based adjustment
- Position sizing: 0.01
