Why a Supertrend stop on Renko must flip on the close, not the wick

A wick through the band is price visiting; a close through the band is price accepting. A Supertrend that flips on the visit reverses under trades that are still working.

A Supertrend flip is a comparison between a price and the opposing band, so which price it reads decides how easily the trend turns. Read the bar's extreme and one excursion satisfies it. Read the close and only a completed bar can. On a Renko chart the two are different kinds of number: where the bricks keep their traded high and low, the wick is the excursion the trades reached, while the close is the grid level the brick confirmed at — and until it confirms there is no closed brick at all.

What Supertrend plots

An ATR over a lookback, measured out from the midpoint of each bar by a multiplier, gives two bands: one above price and one below. Neither follows the raw calculation bar to bar. Each ratchets — the upper band only moves down while the previous close stays under it, the lower band only moves up while the previous close stays above it. A previous close on the far side of a band releases that ratchet and the band re-forms around the current calculation, which is why the line can sit further from price after a reset than it did before one. The plotted line is the lower band while the trend is up and the upper band while it is down.

The variants differ on the flip test. In the classic construction the trend turns the moment any price reaches the opposing band, and "any price" means the highest or lowest trade the bar carried. One excursion through the band is the whole test, which is how a single wick ends a plotted trend.

What a wick is on a Renko chart

A Renko brick completes on distance, not on time. Price has to travel a fixed number of ticks from the grid anchor — or a multiple of that against the direction the grid is running — before a brick confirms, and its close is the grid level it confirmed at.

What the wick is depends on the bars type. Bricks drawn without wicks have a high and a low that are the body's own two edges, so the distance price covered inside the brick is not in the record; anything reading High and Low reads the brick size. Bricks that keep their traded extremes record something else: the high and low are the prices trades actually reached while the brick developed, with only the confirming boundary clipped into whichever of the two the brick completed on.

That second case puts a real excursion in front of a flip test. While a brick develops its high and low move with the trades, so a run past the opposing band appears in them at once. The close is not settled yet. The tick that confirms a brick belongs to the next brick, and until that tick prints there is no closed bar for a bar-close test to read. A wick through the band and a close through it are separated by however much further price must travel to finish the brick — a distance, not a wait.

The commit filter

A commit filter puts two conditions between an excursion and a flip, and both are evaluated on the close.

First, a bar has to close past the opposing band by a buffer measured in ATRs, so the distance a close must clear scales with how much the market is moving. A buffer of zero means any close past the band counts. Second, that has to happen on as many consecutive bars as the persistence setting asks for; one close that does not qualify resets the count to zero. Only when both are satisfied does the trend flip, and the flip is marked on the bar that completed it. The wick never enters the test; the only price it reads is the close.

That machine is stateful. It carries a candidate direction and a running count from bar to bar, and it steps once per closed bar, which is why it requires Calculate set to On bar close — the default. The On price change and On each tick modes step it more than once within the same bar, which corrupts the count and repaints the line. Such an indicator checks the setting and prints a warning to the NinjaScript Output window if it is not on bar close. The machine also has a starting point: nothing plots until two bars after the ATR period has filled, so with the default period of 10 it begins on the twelfth bar, and the flip state starts as an up trend until the first commit turns it.

On a Renko chart that requirement fits the bar type. One completed brick is one evaluation. The close being evaluated is the grid level that brick confirmed at, not a price that could still move. And where closed bricks are appended once and never revisited, the bar the test ran on does not change afterwards.

Where this shows up in my own tools

TakeFlight Supertrend is the free NinjaTrader 8 indicator I wrote around that filter, and it is the stop I keep on my own charts. Classic ATR bands with the ratchet, a flip that needs a close past the opposing band by an ATR-scaled buffer held for a set number of consecutive bars, a triangle at each confirmed flip, and a named plot that other NinjaScript on the same chart can read. It runs on bar close, and says so in the Output window if that setting is changed.

Built custom. I do this for hire — fixed quote, most jobs under a week. Get a quote →