Join today
Strategies / Trend / Renko MA Cross

Renko MA Cross Strategy

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.

TrendLong & shortIntradayEUR/USD2 min
3.34Profit factor
606,680Net profit USD
45.83%Win rate
144Trades
-109,627Max drawdown
4,213Avg trade

Best run of 20. EUR/USD, 2 min, spread 1, from run pf:2026-09-24-EURUSD-2m.tsv:3.

Entry rules, long

  1. A simulated renko series with 20-pip boxes is built on normal candles (a new renko close needs a 2-box move)
  2. Members only
  3. At least 300 time units (HHMMSS) since the last order

Entry rules, short

  1. Sell short when the renko close crosses below its 20-period average
  2. Members only

Exit rules

  1. Members only
  2. No stop loss or target

Test conditions

PeriodUp to 2026-09-25
InstrumentEUR/USD, 2 minutes
Spread1 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
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

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
EUR/USDBest run2 min3.34 14445.83606,680 USD-109,627
Silver5 min1.17 1,11437.1644,022 USD-10,909
USD/JPY30 minn/a 1,21738.46492,980 JPY-219,180
USD/JPY10 minn/a 72138.00388,320 JPY-363,130
USD/JPY1 minn/a 5843.10103,700 JPY-55,110
Silver30 minn/a 99939.8448,281 USD-20,606
Silver3 minn/a 1,23137.7734,326 USD-25,070
Silver2 minn/a 1,34637.5929,258 USD-18,748
Silver10 minn/a 99236.5927,606 USD-20,387
Dow JonesDailyn/a 4254.7623,592 EUR-10,778
US Crude Oil4 hoursn/a 98338.4519,457 EUR-5,313
Silver15 minn/a 95536.3416,128 USD-14,595
DAX 401 hourn/a 3,34335.3013,225 EUR-5,314
DAX 4015 minn/a 3,46636.049,340 EUR-5,223
DAX 404 hoursn/a 1,34635.598,481 EUR-7,467
US Crude Oil1 hourn/a 2,85236.336,418 EUR-6,045
Gold30 minn/a 19742.642,967 EUR-1,025
Gold2 minn/a 13547.412,828 EUR-903
Gold4 hoursn/a 10449.042,577 EUR-951
Gold3 minn/a 15940.251,310 EUR-994

Charts

Results by run

Profit factor by run

Above 1.0 made money, below 1.0 lost money.

0.01.32.53.85.01.0 = break-evenEUR/USD · 2 min3.34Silver · 5 min1.17

Net profit against max drawdown

Net profitMax drawdown
0-500K-250K500K1.0MEUR/USD · 2 minUSD/JPY · 30 minUSD/JPY · 10 minUSD/JPY · 1 minSilver · 30 minSilver · 5 minSilver · 3 minSilver · 2 minSilver · 10 minDow Jones · DailyUS Crude Oil · 4 hoursSilver · 15 minDAX 40 · 1 hourDAX 40 · 15 minDAX 40 · 4 hoursUS Crude Oil · 1 hour

Longer history

Re-run on up to 1,000,000 bars

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.

EUR/USD · 2 min

Bars available996,000
Net, standard 200,000-bar run606,680.00 USD
Net, long run584,588.00 USD
Net on the older data alone-22,092.00 USD

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.

// ============================================================
// 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

Known weaknesses

  • There is no stop loss or target. Only the opposite signal closes a trade, so a slow reversal can cost a lot.
  • The best run had only 144 trades, and the drawdown of 109,627 USD was large next to the average trade of 4,213.06 USD.
  • The 300 unit order gap compares clock times and does not handle the change of day, so overnight signals may behave differently than expected.
  • Only Silver 5 minutes besides the main run has a recorded profit factor, at 1.17.

Indicators used

SMA

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 I run it in ProOrder?

Yes. The renko bricks are simulated inside the code, so it runs on a normal candle chart in ProOrder.

How did other markets do?

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.

What risk is there at 1 unit?

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.

Does the longer history hold up?

Mostly. Over 996000 bars the result was 584,588 USD against 606,680 USD in the standard run.

Related

Strategies like this one

Bollinger Squeeze

Uses the same indicator.

14.30 PF · 86 trades

Slow MACD Slope

Best run on the same market, EUR/USD.

6.80 PF · 7,305 trades

Supertrend Counter Trend

A similar profit factor.

3.47 PF · 1,444 trades

Join the ProRealAlgos waitlist to see how we test systems like this before trading them.

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