Join waitlist
Strategies / Trend / Reversal Pattern With Linear Regression Band

Reversal Pattern With Linear Regression Band

The system buys when a 20-period stochastic-based close reversal agrees with price closing more than 1% above a 14-period linear regression line, and sells short on the mirror condition. Positions close when the states no longer agree.

TrendLong & shortIntradayGold10 min
n/aProfit factor
1,448Net profit EUR
36.87%Win rate
998Trades
-632Max drawdown
1.45Avg trade

Best run of 7. Gold, 10 min, spread 0.6, from run sweeps:2026-10-12-GOLD-10m-opt.tsv:23.

Entry rules, long

  1. The close is above the prior close, and the prior close was below the close 2 bars earlier.
  2. The Stochastic %K (20 periods) is below its 3-period SMA and above 50 on the same bar.
  3. When both states are bullish and no long is open, the system buys 1 contract at market.

Entry rules, short

  1. The close is below the prior close, and the prior close was above the close 2 bars earlier.
  2. The Stochastic %K (20 periods) is above its 3-period SMA and below 50 on the same bar.
  3. When both states are bearish and no short is open, the system sells 1 contract short at market.

Exit rules

  1. When they no longer agree, an open short is bought back at market.

Test conditions

PeriodUp to 2026-10-12
InstrumentGold, 10 minutes
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-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
GoldBest run10 minn/a 99836.871,448 EUR-632
Silver4 hoursn/a 77238.4738,530 USD-14,927
Brent CrudeDailyn/a 26737.8312,623 EUR-9,957
Dow Jones5 minn/a 93936.537,137 EUR-5,254
Dow Jones3 minn/a 95838.004,221 EUR-3,593
GoldDailyn/a 44237.331,574 EUR-1,052
Gold1 hourn/a 83239.541,353 EUR-953

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Reversal Pattern With Linear Regression Band
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: 10 minutes
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE posrev = 0
ONCE sincebad = 1000
ONCE poscog = 0

ll = lowest[20](low)
hh = highest[20](high)

51 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

StochasticSMALinear Regression
Read this firstKnown weaknesses2 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.

Questions

About this strategy

Can I run Reversal Pattern With Linear Regression Band 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 7 market and timeframe combinations. The best run by trade count was Gold, 10 minutes, with 998 trades.

How large was the drawdown?

The best run had a maximum drawdown of 632 EUR at the tested position size, against a net result of 1,448 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

ADX Filtered EMA Cross

Also a trend strategy.

1.15 PF · 607 trades

Put your name on the ProRealAlgos waitlist to trade a tested portfolio instead of single strategies.

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