Join waitlist
Strategies / Pattern / Bar Gap Imbalance Breakout

Bar Gap Imbalance Breakout

Goes long after a bar's low is above the prior bar's high, and short after a bar's high is below the prior bar's low. Each signal's close is averaged, and a long closes on a bear imbalance whose close is above that average.

PatternLong & shortIntradayDAX 402 min
n/aProfit factor
2,442Net profit EUR
65.25%Win rate
259Trades
-2,313Max drawdown
9.43Avg trade

Best run of 12. DAX 40, 2 min, spread 3, from run sweeps:2026-10-12-DAX40-2m-opt.tsv:3.

Entry rules, long

  1. If not short, a bull imbalance buys if flat and adds the close to a running average of bull-signal closes.
  2. Signals are only checked after bar 2.

Entry rules, short

  1. If not long, a bear imbalance sells short if flat and adds the close to a running average of bear-signal closes.

Exit rules

  1. A bull imbalance closes the short when its close is below the running average of bear-signal closes.
  2. No stop loss or target is set.

Test conditions

PeriodUp to 2026-10-12
InstrumentDAX 40, 2 minutes
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-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
DAX 40Best run2 minn/a 25965.252,442 EUR-2,313
USD/JPYDailyn/a 1190.911,415,670 USD-665,950
USD/JPY4 hoursn/a 1580.00960,860 USD-303,800
EUR/USDDailyn/a 1181.8256,198 USD-51,890
Silver1 minn/a 20872.1213,956 USD-8,328
Dow Jones2 minn/a 20374.8811,520 EUR-4,891
DAX 4030 minn/a 18973.5411,175 EUR-6,466
Dow Jones5 minn/a 12276.239,970 EUR-8,342
US Crude Oil10 minn/a 7569.337,946 EUR-5,072
DAX 403 minn/a 19269.797,818 EUR-4,437
FTSE 10015 minn/a 19573.335,928 EUR-3,108
US Crude Oil2 minn/a 20769.574,396 EUR-3,158

Charts

Results by run

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

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Bar Gap Imbalance Breakout
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Pattern
// Direction: Long & short
// Timeframe tested: 2 minutes
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE buyavg = 0
ONCE buycount = 0
ONCE sellavg = 0
ONCE sellcount = 0

42 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.
Read this firstKnown weaknesses2 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 2,313 EUR is large next to the net profit of 2,442 EUR.

Questions

About this strategy

Can I run Bar Gap Imbalance Breakout 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 12 market and timeframe combinations. The best run by trade count was DAX 40, 2 minutes, with 259 trades.

How large was the drawdown?

The best run had a maximum drawdown of 2,313 EUR at the tested position size, against a net result of 2,442 EUR.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Heikin Ashi Color Flip

Best run on the same market, DAX 40.

1.12 PF · 3,692 trades

Breakout Reversal

Also a pattern strategy.

n/a PF · 459 trades

Want strategies that are already part of a live portfolio? Join the ProRealAlgos waitlist.

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