Three closes in a row that stay inside the previous bar range signal a coiled market. When the close then breaks above the highest high of the previous four bars, the system buys. Exits use a 2 x ATR(14) stop and a 2.5 x ATR(14) target, reset every bar.
Best run of 6. Dow Jones, 1 hour, spread 3, from run sweeps:2026-09-22-DOW30-1h-opt.tsv:2.
| Period | Up to 2026-09-22 |
| Instrument | Dow Jones, 1 hour |
| Spread | 3 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-22 |
| positionSize Contracts per trade | 1 |
| skipDayA No entries on bars opening on Monday | 1 |
| skipDayB No entries on bars opening on Sunday | 0 |
| atrPeriod ATR length for stop and target | 14 |
| stopAtrMultiplier Stop distance in ATRs | 2 |
| targetAtrMultiplier Target distance in ATRs | 2.5 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Dow JonesBest run | 1 hour | n/a | 463 | 46.22 | 4,854 EUR | -2,531 |
| USD/JPY | Daily | n/a | 118 | 50.00 | 4,550 JPY | -1,640 |
| US Crude Oil | Daily | n/a | 119 | 48.74 | 3,120 EUR | -1,815 |
| DAX 40 | 4 hours | n/a | 376 | 48.14 | 2,855 EUR | -2,694 |
| S&P 500 | Daily | n/a | 155 | 41.94 | 946 EUR | -393 |
| S&P 500 | 4 hours | n/a | 378 | 46.56 | 707 EUR | -580 |
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.
// ============================================================ // Tight Range Breakout // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long only // Timeframe tested: 1 hour // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade skipDayA = 1 // no entries on bars opening on Monday skipDayB = 0 // no entries on bars opening on Sunday atrPeriod = 14 // ATR length for stop and target stopAtrMultiplier = 2 // stop distance in ATRs targetAtrMultiplier = 2.5 // target distance in ATRs // --- Indicators --- blockedDay = (OpenDayOfWeek = skipDayA) OR (OpenDayOfWeek = skipDayB) // Each of the last three closes stayed inside the range of the bar before it tightRange = close[3] <= high[4] AND close[3] >= low[4] AND close[2] <= high[3] AND close[2] >= low[3] AND close[1] <= high[2] AND close[1] >= low[2] // Highest high of the four bars before this one recentHigh = max(max(high[4], high[3]), max(high[2], high[1])) atrValue = AverageTrueRange[atrPeriod](close)
11 more lines: the entry and exit rules.
Read this first
Questions
Yes, long only at 1 contract, with the ATR stop and target coded in.
Dow Jones 1 hour made EUR 4,854.30 over 463 trades. USD/JPY, US Crude Oil, DAX 40 and S&P 500 runs were all profitable too.
On Dow Jones 1 hour the max drawdown was EUR 2,531.20 at 1 contract.
Inside-bar squeezes form often on hourly Dow Jones bars, giving 463 trades, while daily runs traded between 118 and 155 times.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.