Join waitlist
Strategies / Pattern / Reversal Pattern With Center of Gravity

Reversal Pattern With Center of Gravity

Pairs a reversal state built from a smoothed stochastic with a Center of Gravity state based on a 5-bar linear regression. It buys when both states are up, sells short when both are down, and closes any position when they disagree.

PatternLong & shortSwingDAX 404 hours
1.24Profit factor
22,819Net profit EUR
40.90%Win rate
1,951Trades
-4,192Max drawdown
11.70Avg trade

Best run of 33. DAX 40, 4 hours, spread 3, from run pf:2026-10-05-DAX40-4h.tsv:3.

Entry rules, long

  1. The Center of Gravity state turns up when close is above the 5-bar linear regression value 14 bars back, plus 1% of close.
  2. A long is opened at market when both states are up and no long position is open.

Entry rules, short

  1. The Center of Gravity state turns down when close is below the same regression value minus 1% of close.
  2. A short is opened at market when both states are down and no short position is open.

Exit rules

  1. A position closes at market when the two states disagree.

Test conditions

PeriodUp to 2026-10-05
InstrumentDAX 40, 4 hours
Spread3 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-05

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
DAX 40Best run4 hours1.24 1,95140.9022,819 EUR-4,192
Nasdaq 1004 hours1.20 2,07939.3916,499 EUR-3,228
USD/JPY30 min1.17 1,43439.54641,800 USD-153,540
USD/JPY4 hoursn/a 1,55339.60566,720 USD-217,440
USD/JPY15 minn/a 54141.77400,250 USD-177,200
USD/JPY10 minn/a 38441.93328,960 USD-148,330
USD/JPY2 minn/a 2055.0068,640 USD-68,020
Nikkei 2252 minn/a 87639.9532,195 USD-12,435
Nikkei 22510 minn/a 2,79837.4930,811 USD-13,982
Nikkei 2255 minn/a 1,80539.0628,883 USD-10,962
Silver4 hoursn/a 2,46634.6324,362 USD-15,436
Dow JonesDailyn/a 1,18339.3122,821 EUR-10,296
Nikkei 2253 minn/a 1,26738.2021,069 USD-9,236
Nikkei 2254 hoursn/a 1,75239.3317,811 USD-14,569
Nikkei 2251 minn/a 45839.7415,390 USD-9,331
Dow Jones1 hourn/a 1,27237.1912,078 EUR-11,871
Dow Jones4 hoursn/a 62238.919,043 EUR-8,955
Nasdaq 1005 minn/a 1,15939.098,263 EUR-5,516
Dow Jones10 minn/a 1,38536.827,753 EUR-7,548
Nasdaq 10015 minn/a 3,66337.247,667 EUR-6,307
Nasdaq 10010 minn/a 2,60037.387,014 EUR-6,706
DAX 4030 minn/a 4,72336.526,411 EUR-5,506
Nasdaq 1003 minn/a 77539.875,978 EUR-3,521
DAX 40Dailyn/a 1,25037.125,811 EUR-5,120
DAX 405 minn/a 63540.004,565 EUR-3,199
Nasdaq 1002 minn/a 40036.754,287 EUR-4,009
Gold4 hoursn/a 1,97637.652,962 EUR-877
S&P 500Dailyn/a 1,21438.302,041 EUR-1,574
Gold10 minn/a 1,81639.761,813 EUR-850
GoldDailyn/a 1,15536.711,612 EUR-1,595
Gold5 minn/a 1,23938.421,419 EUR-659
Gold15 minn/a 2,41837.431,053 EUR-812
S&P 5001 minn/a 4250.00502 EUR-336

Charts

Results by run

Top 10 of 33 runs. The full list is in the table above.

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// Reversal Pattern With Center of Gravity
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Pattern
// Direction: Long & short
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

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

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

60 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

Linear RegressionSMAStochastic
Read this firstKnown weaknesses2 points
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run Reversal Pattern With Center of Gravity 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 33 market and timeframe combinations. The best run was DAX 40, 4 hours, with a profit factor of 1.24 over 1,951 trades.

How large was the drawdown?

The best run had a maximum drawdown of 4,192 EUR at the tested position size, against a net result of 22,819 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

Heikin Ashi Color Flip

Best run on the same market, DAX 40.

1.12 PF · 3,692 trades

Green Candle Reversal Long

Also a pattern strategy.

1.25 PF · 1,087 trades

Get the full rules, the complete code and the ProRealAlgos portfolio as a member.

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