Join waitlist
Strategies / Mean reversion / ATR Scaled Dip Buying (long and short)

ATR Scaled Dip Buying (long and short)

Buys a dip in an uptrend and sells short a bounce in a downtrend, both measured as 3 times the 20-period ATR from the 40-bar high or low. Long trades exit above the prior 40-bar high, short trades below the prior 40-bar low.

Mean reversionLong & shortSwingGoldDaily
1.38Profit factor
17,580Net profit EUR
61.02%Win rate
236Trades
-5,845Max drawdown
74.49Avg trade

Best run of 1. Gold, Daily, spread 0.6, from run pf:2026-10-11-GOLD-D.tsv:22.

Entry rules, long

  1. The close is above the 200-period SMA

Entry rules, short

  1. The close is below the 200-period SMA

Exit rules

  1. The close falls below the lowest low of the previous 40 bars, closing a short

Test conditions

PeriodUp to 2026-10-11
InstrumentGold, Daily
Spread0.6 points
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-10-11

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
GoldBest runDaily1.38 23661.0217,580 EUR-5,845

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// ATR Scaled Dip Buying (long and short)
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false
ONCE capital = 10000

26 more lines: the entry and exit rules.

Setup

How to load it

  1. Copy the code with the copy button on the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Indicators used

ATRSMA
Read this firstKnown weaknesses2 points
  • It was only tested on Gold, so there is no evidence from other markets.
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.

Questions

About this strategy

Can I run ATR Scaled Dip Buying (long and short) in ProOrder?

Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.

Which markets was it tested on?

It was tested on one combination, Gold, Daily, with a profit factor of 1.38 over 236 trades.

How large was the drawdown?

The best run had a maximum drawdown of 5,845 EUR at the tested position size, against a net result of 17,580 EUR.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

CCI Breakout

Best run on the same market, Gold.

1.08 PF · 6,065 trades

ATR Envelope Pullback (long and short)

Also a mean reversion strategy.

1.39 PF · 255 trades

See how ProRealAlgos combines strategies like this into one automated portfolio.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs