The code simulates a renko chart with 20 pip boxes on top of normal candles. A buy comes when the renko close crosses above its 20 period average, and a short on the cross below. After the first trade it always holds a position.
Best run of 20. EUR/USD, 2 min, spread 1, from run pf:2026-09-24-EURUSD-2m.tsv:3.
| Period | Up to 2026-09-25 |
| Instrument | EUR/USD, 2 minutes |
| Spread | 1 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 Shares per trade | 1 |
| boxSizePips Renko box size in pips | 20 |
| reversalBoxes Boxes price must travel to print a new renko close | 2 |
| renkoPeriod Moving average of the renko closes | 20 |
| minOrderGap Minimum gap between orders, in HHMMSS time units | 300 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| EUR/USDBest run | 2 min | 3.34 | 144 | 45.83 | 606,680 USD | -109,627 |
| Silver | 5 min | 1.17 | 1,114 | 37.16 | 44,022 USD | -10,909 |
| USD/JPY | 30 min | n/a | 1,217 | 38.46 | 492,980 JPY | -219,180 |
| USD/JPY | 10 min | n/a | 721 | 38.00 | 388,320 JPY | -363,130 |
| USD/JPY | 1 min | n/a | 58 | 43.10 | 103,700 JPY | -55,110 |
| Silver | 30 min | n/a | 999 | 39.84 | 48,281 USD | -20,606 |
| Silver | 3 min | n/a | 1,231 | 37.77 | 34,326 USD | -25,070 |
| Silver | 2 min | n/a | 1,346 | 37.59 | 29,258 USD | -18,748 |
| Silver | 10 min | n/a | 992 | 36.59 | 27,606 USD | -20,387 |
| Dow Jones | Daily | n/a | 42 | 54.76 | 23,592 EUR | -10,778 |
| US Crude Oil | 4 hours | n/a | 983 | 38.45 | 19,457 EUR | -5,313 |
| Silver | 15 min | n/a | 955 | 36.34 | 16,128 USD | -14,595 |
| DAX 40 | 1 hour | n/a | 3,343 | 35.30 | 13,225 EUR | -5,314 |
| DAX 40 | 15 min | n/a | 3,466 | 36.04 | 9,340 EUR | -5,223 |
| DAX 40 | 4 hours | n/a | 1,346 | 35.59 | 8,481 EUR | -7,467 |
| US Crude Oil | 1 hour | n/a | 2,852 | 36.33 | 6,418 EUR | -6,045 |
| Gold | 30 min | n/a | 197 | 42.64 | 2,967 EUR | -1,025 |
| Gold | 2 min | n/a | 135 | 47.41 | 2,828 EUR | -903 |
| Gold | 4 hours | n/a | 104 | 49.04 | 2,577 EUR | -951 |
| Gold | 3 min | n/a | 159 | 40.25 | 1,310 EUR | -994 |
Charts
Above 1.0 made money, below 1.0 lost money.
Longer history
With 996,000 bars available on EUR/USD 2 minutes, net profit slipped to USD 584,588 from USD 606,680 in the standard run, as the older data alone lost USD 22,092.
| Bars available | 996,000 |
| Net, standard 200,000-bar run | 606,680.00 USD |
| Net, long run | 584,588.00 USD |
| Net on the older data alone | -22,092.00 USD |
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 MA Cross // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 2 minutes // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // shares per trade boxSizePips = 20 // renko box size in pips reversalBoxes = 2 // boxes price must travel to print a new renko close renkoPeriod = 20 // moving average of the renko closes minOrderGap = 300 // minimum gap between orders, in HHMMSS time units // --- Indicators --- ONCE renkoTop = close ONCE renkoBottom = close ONCE renkoClose = close ONCE renkoMA = 0 ONCE lastOrderTime = 0 boxSize = boxSizePips * PipSize // Emulate a renko series on normal candles. IF close > renkoTop + boxSize * reversalBoxes THEN renkoTop = close renkoBottom = renkoTop - boxSize * reversalBoxes renkoClose = renkoTop ELSIF close < renkoBottom - boxSize * reversalBoxes THEN renkoBottom = close renkoTop = renkoBottom + boxSize * reversalBoxes renkoClose = renkoBottom ENDIF renkoAverage = Average[renkoPeriod](renkoClose) // The average only updates when a new renko close prints. IF renkoClose = renkoClose[1] THEN renkoMA = renkoMA[1] ELSE renkoMA = renkoAverage ENDIF
19 more lines: the entry and exit rules.
Read this first
Questions
Yes. The renko bricks are simulated inside the code, so it runs on a normal candle chart in ProOrder.
All tested rows were positive. USD/JPY 30 minutes made 492,980 JPY, Silver was positive on every timeframe, and Gold made smaller gains such as 2,576.7 EUR on 4 hours.
On EUR/USD 2 minutes the worst drawdown was 109,627 USD at a size of 1. With no stop in the code, plan for losses beyond that.
Mostly. Over 996000 bars the result was 584,588 USD against 606,680 USD in the standard run.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.