VALYNOXSTRATEGY RESEARCH TECHNOLOGY
AlphaPrimeAlphaPrime
ACADEMY / How AlphaPrime Computes

FlexRenko bars: what the offsets change and where the backtest leaks

FlexRenko is Renko with two extra settings: a trend offset that moves where a continuation brick starts, and a reversal offset that lets a reversal brick overlap the previous one so direction flips sooner. The overlap is where FlexRenko backtests leak: a reversal brick's open sits at a price that traded before the reversal was known. AlphaPrime confirms every brick at the close of the underlying bar, fills at the next real price with doubled slippage, and judges stops on the real high and low.

By · Published · updated · Editorial policy

Contents
  1. What is FlexRenko, and why do its backtests leak more than classic Renko?
  2. How are FlexRenko bricks built, and what do the two offsets actually change?
  3. Where does a FlexRenko backtest see the future?
  4. The reversal brick opens in the past
  5. The offsets are tuned on the result
  6. The inherited Renko leaks
  7. How does AlphaPrime backtest a FlexRenko strategy?
  8. How do you choose FlexRenko settings for a backtest?
  9. Which markets and strategies suit FlexRenko?
  10. Frequently asked questions

What is FlexRenko, and why do its backtests leak more than classic Renko?

FlexRenko is a Renko chart with two offsets: a trend offset that sets where a continuation brick starts inside the previous brick, and a reversal offset that lets a reversal brick overlap the previous brick. The overlap makes direction changes appear earlier, and it also places the reversal brick's open at a price that traded before anyone knew a reversal was coming.

Classic Renko builds each brick from the high or low of the previous brick, and a reversal needs two full brick sizes of movement. FlexRenko keeps the brick size but adds a trend offset and a reversal offset, both measured in price from the previous brick's edge and both smaller than the brick size. With both offsets at zero, FlexRenko is classic Renko. With a reversal offset of half the brick size, a reversal brick begins halfway inside the previous brick, so the chart flips direction after one and a half brick sizes instead of two. Traders use it to make Renko respond faster to turns without shrinking the brick. The page on Renko chart backtests covers the brick-building leaks that FlexRenko inherits; this page is about what the offsets add. The rules shared by every synthetic chart type are on the overview of why synthetic-bar backtests cheat.

How are FlexRenko bricks built, and what do the two offsets actually change?

A continuation brick starts at the previous brick's close shifted back by the trend offset and completes when price has moved one brick size from that start. A reversal brick starts inside the previous brick, at its edge shifted back by the reversal offset, and completes when price has moved one brick size from that point against the previous direction.

The trend offset makes continuation bricks overlap slightly, which smooths a trend further and slightly delays each continuation brick. The reversal offset is the setting that changes behaviour the most. With no offset, price must retrace one full brick to get back across the previous brick and one more to draw the reversal, so a reversal brick means price has moved two bar sizes against the trend. With a reversal offset close to the brick size, the reversal brick nearly coincides with the previous brick and a reversal is drawn after barely more than one brick size of retracement. The chart turns faster and whipsaws more, and every reversal brick's open sits at a level that was printed during the previous brick.

AlphaPrime (Valynox) builds FlexRenko bricks from the underlying time bars you choose and confirms every brick, continuation or reversal, at the close of the underlying bar that completed it. The brick's drawn open and close are levels for the strategy to read. They are not used as fills. The settings carry the names you will find on charting platforms, Box Size, Trend Offset and Reversal Offset, so you can copy them across; the panel also shows the resulting reversal distance (twice the brick size minus the reversal offset) so you can see what you have asked for. The Renko options for phantom bricks and wicks apply to FlexRenko unchanged, and so does the rule for the unknown order of high and low inside a minute: the engine takes the order that goes against the last brick first.

Hypothetical example

Brick size 10, reversal offset 5. An up brick runs from 100 to 110. Price falls. A classic Renko reversal would need 90; FlexRenko draws a down brick from 105 to 95 as soon as price reaches 95. A backtest that sells at the reversal brick's open is short from 105, a price that traded while the up brick was still forming. AlphaPrime confirms the reversal brick at the close of the underlying bar in which price reached 95 and fills at the next real price, around 95 or below, plus slippage. Ten points of the chart's reversal edge never existed.

Where does a FlexRenko backtest see the future?

Everywhere classic Renko does, plus one place of its own: the reversal brick's open.

The reversal brick opens in the past

Rule: a reversal brick exists only at the close of the underlying bar in which price completed it, and its fill is the next real price. Why: the brick's open is a level inside the previous brick, printed before the reversal was known; the reversal is known only when price reaches the new brick's close. What it avoids: fills at the overlap, which hand the backtest the entire offset as free edge on every direction change.

The offsets are tuned on the result

Rule: brick size and both offsets are fixed before the test and held across in-sample and out-of-sample periods. Why: three interacting parameters with a visible effect on whipsaw count are easy to tune until the equity curve looks right. What it avoids: a chart fitted to the test data under the name of a chart setting.

The inherited Renko leaks

Brick-price fills, no-wick stop checks and phantom bricks on gaps all apply to FlexRenko exactly as they do to classic Renko. The rules that close them are the same: confirmation at the underlying close, fills at the next real price, stops judged on the underlying bar's high and low with the stop taken first when one bar covers both.

FlexRenko featureBrick-price backtestAlphaPrime
Reversal brick with offsetFill at the brick's open, inside the previous brickConfirmed at the underlying close; fill at the next real price
Continuation brick with trend offsetFill at the brick's closeConfirmed at the underlying close; fill at the next real price plus doubled slippage
Stop and target checkBrick open and closeUnderlying bar high and low, stop first
Brick size and offsetsOften tuned on the backtestFixed before the test, held across all periods
The reversal brick opens inside the previous brick, at a price from before the reversal was known. The honest fill is after the brick completes.
The reversal brick opens inside the previous brick, at a price from before the reversal was known. The honest fill is after the brick completes. AlphaPrime generation settings · chart type panel

How does AlphaPrime backtest a FlexRenko strategy?

The strategy reads bricks, their direction and their count. Fills, stops and targets come from the underlying real bars. Rule by rule:

  • Every brick is confirmed at the close of the underlying bar that completed it. Why: before that close the brick can still fail to complete. Avoids: trading bricks that were drawn and then erased.
  • A market order is filled at the open of the underlying bar that follows the signal, with slippage added. Why: first available price after the signal exists. Avoids: fills at brick opens and closes, including the overlapping reversal open.
  • Stops and targets are judged on the underlying bar's high and low, stop first. Why: bricks carry no wicks and the overlap hides even more of the real path. Avoids: stop-outs the chart cannot show.
  • Bricks implied by a gap appear together; no fill inside the gap. Why: nothing traded there. Avoids: entries at prices that did not exist.
  • Slippage starts at twice the time-bar figure. Why: bricks complete when the market is moving fastest. Avoids: pricing a burst at an average spread.

With these rules, a FlexRenko strategy keeps whatever its rule earns and loses the offset it was being paid at each reversal. Strategies that relied on fast reversals for their edge usually lose most of it. Strategies that used the offset to exit a trend earlier, and took the exit at a real price, often keep a smaller edge that is worth having. How to weigh the extra cost against the average trade is covered on the page about commission, slippage and the average trade.

How do you choose FlexRenko settings for a backtest?

Choose the brick size first, by the same rule as classic Renko: several times your slippage assumption and large enough that the underlying bars can resolve it. Then set the offsets from the behaviour you want, not from the equity curve.

  1. Brick size: a brick that takes several underlying bars to form on an ordinary day. Test half the size as a control; if the result collapses, the edge was the smoothing.
  2. Reversal offset: zero gives classic Renko; half the brick size is a common middle ground; close to the brick size turns the chart into a one-brick reversal chart that whipsaws constantly. Pick one, fix it, and accept the whipsaw rate that comes with it.
  3. Trend offset: usually small or zero. It smooths continuation and adds a little delay; large values make trends look cleaner than they were.

Two variants deserve a mention. Bricks sized by average true range adapt to volatility, and the ATR must be computed from completed bars and frozen when each brick starts, or the brick size knows the future. Bricks with wicks show the real path inside the brick, which is useful on the chart; AlphaPrime does not need them for the backtest, because stops are judged on the underlying bars that already contain that path. If you want a bar whose size, not just its offsets, follows volatility, see Kase bars.

Which markets and strategies suit FlexRenko?

FlexRenko suits the same markets as classic Renko, liquid index futures, major currency pairs and large-cap crypto in active hours, and it suits traders who want the trend-following cleanliness of Renko with earlier exits. It is a poor fit for ranging sessions, where the reversal offset produces a pair of fills on every wobble, and for thin markets, where a single print can draw a reversal.

Before trusting a FlexRenko result, run the same rule with the reversal offset at zero. If the FlexRenko version is much better, the difference is the offset, and most of that difference is the fill at the overlap. If the two versions are close, the rule has something and the offset is a matter of taste. Then run the half-brick control and, if it still holds, walk-forward analysis.

What this means if you use AlphaPrime: choose FlexRenko as the chart type in strategy generation, set the brick size, trend offset, reversal offset and underlying resolution, and run the search. Every candidate is tested with bricks confirmed at the underlying close, fills at the next real price with doubled slippage, and stops judged on real bars; the rules are the same on Classic and on Reserve. The reversals left in your report are the ones you could have sold.

Frequently asked questions

What is the difference between Renko and FlexRenko?

Classic Renko builds each brick from the previous brick's edge and needs two bar sizes of movement to reverse. FlexRenko adds a trend offset and a reversal offset that shift where new bricks start inside the previous brick, so continuation bricks overlap a little and reversal bricks can overlap a lot. With both offsets at zero the two charts are identical.

Why is my FlexRenko strategy much worse in AlphaPrime than on the chart?

Most often because the chart backtest filled reversals at the reversal brick's open, which lies inside the previous brick at a price that traded before the reversal was known. AlphaPrime fills after the brick completes, at the next real price. The offset was being paid to the backtest as free edge, and it is gone.

What reversal offset should I use?

One you choose for the exit behaviour you want and then hold fixed. Half the brick size is a reasonable middle setting. Compare against zero; if your result depends heavily on the offset, the result is mostly the fill at the overlap.

Does FlexRenko work on forex and crypto?

Yes, with brick size in pips or price units and the same rules. Crypto's bursts of volatility complete bricks and reversals in clusters, so test with slippage above the doubled starting point before trusting a result there.