Renko bricks of 22 are calculated from closing prices, and a run of 2 bricks in one direction triggers a trade that way. An opposite run reverses the position, and a 120 point stop limits each trade.
Best run of 12. DAX 40, 1 hour, spread 3, from run sweeps:2026-09-24-DAX40-1h-opt.tsv:5.
| Period | Up to 2026-09-24 |
| Instrument | DAX 40, 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-25 |
| positionSize Contracts per trade | 1 |
| brickSize Renko brick height in price units | 22 |
| minBricks Bricks in a row that confirm a move | 2 |
| firstBar Bar on which the Renko grid starts | 1 |
| stopLossPoints Protective stop, points | 120 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| DAX 40Best run | 1 hour | n/a | 5,580 | 35.63 | 7,477 EUR | -7,397 |
| Silver | 10 min | n/a | 1,579 | 37.24 | 35,492 USD | -19,806 |
| DAX 40 | 4 hours | n/a | 3,349 | 36.10 | 15,129 EUR | -5,755 |
| US Crude Oil | 4 hours | n/a | 2,814 | 35.22 | 11,395 EUR | -8,142 |
| Nasdaq 100 | 10 min | n/a | 5,524 | 36.51 | 5,698 EUR | -4,779 |
| Gold | 4 hours | n/a | 249 | 39.36 | 2,216 EUR | -786 |
| Gold | 5 min | n/a | 254 | 37.40 | 2,112 EUR | -1,305 |
| Gold | 30 min | n/a | 322 | 37.89 | 2,009 EUR | -1,575 |
| Gold | 10 min | n/a | 270 | 37.04 | 1,866 EUR | -1,272 |
| Gold | 15 min | n/a | 277 | 36.82 | 1,799 EUR | -1,465 |
| Gold | 2 min | n/a | 222 | 33.78 | 1,749 EUR | -1,387 |
| Gold | 3 min | n/a | 241 | 36.51 | 1,582 EUR | -1,443 |
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.
// ============================================================ // Renko Brick Reversal // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 1 hour // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade brickSize = 22 // Renko brick height, in price units minBricks = 2 // bricks in a row that confirm a new move firstBar = 1 // bar on which the Renko grid starts stopLossPoints = 120 // protective stop, in points // Renko state carried from bar to bar. ONCE gridStarted = 0 ONCE bricksUpTotal = 0 ONCE bricksDownTotal = 0 // --- Indicators --- // Build Renko bricks from closes. round(x - 0.5) floors x to whole bricks. IF BarIndex >= firstBar THEN IF gridStarted = 0 THEN upBrick = close downBrick = close - brickSize gridStarted = 1 ENDIF longSignal = 0 shortSignal = 0 IF close >= upBrick + brickSize THEN newBricksUp = (round(((close - upBrick) / brickSize) - 0.5)) moveUp = newBricksUp * brickSize downBrick = downBrick + moveUp upBrick = upBrick + moveUp bricksUpTotal = bricksUpTotal + newBricksUp bricksDownTotal = 0 // Signal when the up run reaches minBricks for the first time. IF bricksUpTotal[1] < minBricks AND bricksUpTotal >= minBricks THEN longSignal = 1 ENDIF ELSIF close <= downBrick - brickSize THEN newBricksDown = (round(((downBrick - close) / brickSize) - 0.5)) moveDown = newBricksDown * brickSize upBrick = upBrick - moveDown downBrick = downBrick - moveDown bricksDownTotal = bricksDownTotal + newBricksDown bricksUpTotal = 0 IF bricksDownTotal[1] < minBricks AND bricksDownTotal >= minBricks THEN shortSignal = 1 ENDIF ENDIF ENDIF
12 more lines: the entry and exit rules.
Read this first
Questions
Yes, it trades 1 contract and flips between long and short on each opposite brick run. The code has not been compile checked since the rewrite.
All 11 other runs were profitable. Silver 10 minutes made USD 35,492.00 with a USD 19,805.50 drawdown, and DAX 40 4 hours made EUR 15,129.20.
On DAX 40 1 hour the maximum drawdown was EUR 7,397.00. Budget for that on top of your broker margin.
Bricks are built from closes, so the chart timeframe decides how often they update. On 1 hour bars the 22 point bricks form at a pace that matches DAX swings.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.