Join today
Strategies / Mean reversion / IBS Trend Pullback

IBS Trend Pullback Strategy

The Internal Bar Strength (IBS) shows where a bar closed within its range. The system buys a close near the low when price is above the 100 SMA and a 20-period weighted average is rising, and mirrors this for shorts. Trades exit on a close beyond the previous day high or low, with an 8 x ATR(14) stop behind them.

Mean reversionLong & shortSwingNikkei 225Daily
1.42Profit factor
34,292Net profit USD
65.74%Win rate
610Trades
-7,680Max drawdown
56.22Avg trade

Best run of 8. Nikkei 225, Daily, spread 10, from run pf:2026-09-24-NIKKEI-D.tsv:6.

Entry rules, long

  1. Members only
  2. Close is below the previous day high
  3. Close is above the 100 SMA
  4. The 20-period weighted average is rising
  5. No long position is open

Entry rules, short

  1. Members only
  2. Close is above the previous day low
  3. Close is below the 100 SMA
  4. The 20-period weighted average is falling
  5. No short position is open

Exit rules

  1. Sell when the close is above the previous day high
  2. Cover when the close is below the previous day low
  3. Members only

Test conditions

PeriodUp to 2026-09-25
InstrumentNikkei 225, Daily
Spread10 points
Contracts1
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-09-25

Parameters

positionSize
Contracts per trade
1
ibsLongLevel
Buy when IBS is below this (close near the low)
9
ibsShortLevel
Sell short when IBS is above this (close near the high)
91
trendPeriod
Trend filter moving average
100
slopePeriod
Moving average whose slope must agree with the trade
20
maType
Average type for the slope MA (2 = weighted)
2
atrPeriod
ATR length for the stop
14
atrMultiplier
Stop distance in ATRs
8

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Nikkei 225Best runDaily1.42 61065.7434,292 USD-7,680
Nikkei 2254 hoursn/a 62865.9218,284 USD-11,759
Dow Jones4 hoursn/a 29370.3110,284 EUR-7,303
US Crude OilDailyn/a 38864.958,225 EUR-3,863
Nasdaq 1005 minn/a 2,41546.586,848 EUR-4,746
Brent CrudeDailyn/a 21763.594,076 EUR-2,701
Nasdaq 1003 minn/a 2,16146.273,509 EUR-3,413
FTSE 100Dailyn/a 60967.163,296 EUR-2,138

Charts

Results by run

Net profit against max drawdown

Net profitMax drawdown
0-20K-10K25K50KNikkei 225 · DailyNikkei 225 · 4 hoursDow Jones · 4 hoursUS Crude Oil · DailyNasdaq 100 · 5 minBrent Crude · DailyNasdaq 100 · 3 minFTSE 100 · Daily

The code

ProBuilder, rewritten to house standard

Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.

// ============================================================
// IBS Trend Pullback
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Mean reversion
// Direction: Long & short
// Timeframe tested: Daily
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = false

// --- Parameters ---
positionSize = 1          // contracts per trade
ibsLongLevel = 9          // buy when IBS is below this (close near the low)
ibsShortLevel = 91        // sell short when IBS is above this (close near the high)
trendPeriod = 100         // trend filter moving average
slopePeriod = 20          // moving average whose slope must agree with the trade
maType = 2                // average type for the slope MA (2 = weighted)
atrPeriod = 14            // ATR length for the stop
atrMultiplier = 8         // stop distance in ATRs

// --- Indicators ---
// A flat bar has no range, so it counts as a neutral IBS of 50.
IF high > low THEN
  ibsValue = (close - low) / (high - low) * 100
ELSE
  ibsValue = 50
ENDIF

trendMA = Average[trendPeriod](close)
slopeMA = Average[slopePeriod, maType](CustomClose)
maSlope = slopeMA - slopeMA[1]
stopDistance = (AverageTrueRange[atrPeriod](close) * atrMultiplier) * PointSize

27 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • The ATR stop is very wide at 8 x ATR(14), so single losing trades can be large.
  • Max drawdown on the best run was USD 7,679.70 against USD 34,292.00 profit, and on Nikkei 225 4 hours it was USD 11,758.90 on USD 18,283.50.
  • On Nasdaq 100 fast charts the win rate fell to about 46% (46.58% on 5 minutes), well below the daily runs.

Indicators used

IBSSMAWMAATR

How to load it

  1. Copy the code with the copy button above 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.

Questions

About this strategy

Can it trade live through ProOrder?

Yes. Entries, both exits and the ATR stop are all coded, trading 1 contract per signal.

How did it perform across markets?

Nikkei 225 daily led with profit factor 1.42 and USD 34,292.00 over 610 trades. Every other run, from Dow Jones 4 hours to FTSE 100 daily, was also profitable.

What risk comes with 1 contract?

The Nikkei 225 daily run had a max drawdown of USD 7,679.70. Use that as the starting point for your capital, not a margin estimate.

Why daily bars?

The exits refer to the previous day high and low, which fit daily bars naturally. Intraday runs traded far more with lower win rates.

Related

Strategies like this one

Bollinger Squeeze

Uses the same indicator.

14.30 PF · 86 trades

Monday Dip Buy

Best run on the same market, Nikkei 225.

n/a PF · 146 trades

Three MA Trend

A similar profit factor.

1.43 PF · 689 trades

Want to see IBS trades next to other systems? 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