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.
Best run of 8. Nikkei 225, Daily, spread 10, from run pf:2026-09-24-NIKKEI-D.tsv:6.
| Period | Up to 2026-09-25 |
| Instrument | Nikkei 225, Daily |
| Spread | 10 points |
| Contracts | 1 |
| Starting capital | 1,000,000 |
| Costs | Spread only. Commissions and overnight financing are not included. |
| Bars | Up to 200,000 bars, fewer where the instrument has less history |
| Last tested | 2026-09-25 |
| 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
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Nikkei 225Best run | Daily | 1.42 | 610 | 65.74 | 34,292 USD | -7,680 |
| Nikkei 225 | 4 hours | n/a | 628 | 65.92 | 18,284 USD | -11,759 |
| Dow Jones | 4 hours | n/a | 293 | 70.31 | 10,284 EUR | -7,303 |
| US Crude Oil | Daily | n/a | 388 | 64.95 | 8,225 EUR | -3,863 |
| Nasdaq 100 | 5 min | n/a | 2,415 | 46.58 | 6,848 EUR | -4,746 |
| Brent Crude | Daily | n/a | 217 | 63.59 | 4,076 EUR | -2,701 |
| Nasdaq 100 | 3 min | n/a | 2,161 | 46.27 | 3,509 EUR | -3,413 |
| FTSE 100 | Daily | n/a | 609 | 67.16 | 3,296 EUR | -2,138 |
Charts
The code
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
Questions
Yes. Entries, both exits and the ATR stop are all coded, trading 1 contract per signal.
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.
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.
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
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.