Join waitlist
Strategies / Pattern / Kernel Band Divergence Pattern

Kernel Band Divergence Pattern

The strategy buys after a bullish momentum divergence and a growing candle body sequence while a smoothed kernel band state is bullish, and sells short on the mirror setup. Each trade has a stop at the 10-bar low or high from the signal.

PatternLong & shortSwingBrent Crude4 hours
2.02Profit factor
7,131Net profit EUR
37.61%Win rate
117Trades
-1,480Max drawdown
60.95Avg trade

Best run of 9. Brent Crude, 4 hours, spread 3, from run pf:2026-10-12-BRENT-4h.tsv:2.

Entry rules, long

  1. This bar is the first in a run of two growing smoothed candle bodies.
  2. A long position opens at market when these conditions hold and no position is open.

Entry rules, short

  1. This bar is the first in a run of two growing smoothed candle bodies.
  2. A short position opens at market when these conditions hold and no position is open.

Exit rules

  1. A short position closes at market on a bullish divergence or when the kernel state is +1.
  2. A long stop sits at the close minus the 10-bar lowest low, set on the signal bar and applied from the fill.
  3. A short stop sits at the 10-bar highest high minus the close, set on the signal bar and applied from the fill.

Test conditions

PeriodUp to 2026-10-12
InstrumentBrent Crude, 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-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Brent CrudeBest run4 hours2.02 11737.617,131 EUR-1,480
USD/JPYDailyn/a 1812.21292,710 USD-77,060
Silver1 hourn/a 85729.4022,903 USD-16,699
Nikkei 225Dailyn/a 8129.6316,496 USD-9,693
Silver4 hoursn/a 22332.7415,038 USD-7,371
Nasdaq 10030 minn/a 1,25827.035,722 EUR-2,794
US Crude Oil1 hourn/a 63431.703,567 EUR-2,867
US Crude Oil4 hoursn/a 14530.342,939 EUR-2,094
GoldDailyn/a 8332.53363 EUR-326

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Kernel Band Divergence Pattern
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Pattern
// Direction: Long & short
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE os = 0
ONCE phcount = 0
ONCE plcount = 0
ONCE phoscl = 0
ONCE phoscp = 0
ONCE phupl = 0
ONCE phupp = 0
ONCE ploscl = 0
ONCE ploscp = 0
ONCE pldnl = 0
ONCE pldnp = 0
ONCE bslec = -1
ONCE bssec = -1
ONCE bsoszero = -1
ONCE bsosone = -1
ONCE bsbear = -1
ONCE bsbull = -1
ONCE wsum = 5.8845334831

IF BarIndex = 0 THEN
    $myW[0] = 0.0
    $myW[1] = 0.1096089037
    $myW[2] = 0.202408452
    $myW[3] = 0.2824122755
    $myW[4] = 0.3505122675
    $myW[5] = 0.4070508345
    $myW[6] = 0.4522440654
    $myW[7] = 0.4863266642
    $myW[8] = 0.5096126401
    $myW[9] = 0.5225212734
    $myW[10] = 0.5255856933
    $myW[11] = 0.5194514583
    $myW[12] = 0.5048687929
    $myW[13] = 0.4826805456
    $myW[14] = 0.4538071801
    $myW[15] = 0.4192297342
    $myW[16] = 0.3799714748
    $myW[17] = 0.3370788537
    $myW[18] = 0.2916022919
    $myW[19] = 0.2445772626
    $myW[20] = 0.197006093
    $myW[21] = 0.1498408643
    $myW[22] = 0.1039677425
    $myW[23] = 0.0601930304
    $myW[24] = 0.0192311853
    $myW[25] = -0.0183050051
    $myW[26] = -0.0519119383
    $myW[27] = -0.0812003128
    $myW[28] = -0.1058977946
    $myW[29] = -0.1258492438
    $myW[30] = -0.1410145506
    $myW[31] = -0.1514641851
    $myW[32] = -0.1573726022
    $myW[33] = -0.1590096873
    $myW[34] = -0.1567304634
    $myW[35] = -0.1509633085
    $myW[36] = -0.1421969626
    $myW[37] = -0.130966618
    $myW[38] = -0.1178394034
    $myW[39] = -0.1033995793
    $myW[40] = -0.0882337608
    $myW[41] = -0.0729164804
    $myW[42] = -0.0579963918
    $myW[43] = -0.0439833967
    $myW[44] = -0.0313369555
    $myW[45] = -0.020455813
    $myW[46] = -0.0116693401
    $myW[47] = -0.0052306547
    $myW[48] = -0.0013116482
    $myW[49] = -0.0
ENDIF

sm = Average[7](Average[7](close))
osc = sm - sm[7]
up = highest[7](close)
dn = lowest[7](close)
chg = osc - osc[1]

117 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

SMA
Read this firstKnown weaknesses2 points
  • Results include the spread only. Commissions and overnight financing are not included.
  • The code is published as it was backtested and has not been compiled again since.

Questions

About this strategy

Can I run Kernel Band Divergence Pattern 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 9 market and timeframe combinations. The best run was Brent Crude, 4 hours, with a profit factor of 2.02 over 117 trades.

How large was the drawdown?

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

Hull Trend With ADX Filter

Best run on the same market, Brent Crude.

1.27 PF · 1,400 trades

Doji Sweep With RSI Divergence

Also a pattern strategy.

2.07 PF · 114 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