TakeFlight Supertrend
Every Supertrend I tried flipped on a wick.
Why I built it
One spike through the band and the plotted trend reversed under a trade that was still working. This one has a commit filter — the trend only flips after price closes beyond the opposing band and its buffer. A wick alone doesn't count. Clean stop line, flip markers, bar-close discipline built in. It is the stop I keep on my own charts.
What it does
The bands are the classic Supertrend construction: an ATR over your lookback, measured out from the midpoint of each bar by your multiplier, one band above and one below. Each band then 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 resets that band, so it re-forms around where price actually went.
What is different is the flip test. A classic Supertrend turns the moment any price pokes the opposing band, which is how one wick ends a trend. Here the flip is a two-part commit. First, a bar has to close past the opposing band by the commit buffer, and that buffer is measured in ATRs, so the distance a close must clear scales with how much the market is moving. Second, that has to happen on as many consecutive bars as Persistence bars asks for; a single close that does not qualify resets the count to zero. Only when both conditions are met does the trend flip. I wanted a stop line that ignores a wick, so nothing but a close can flip it.
On the chart you get one line and one kind of marker. The line is the lower band while the trend is up and the upper band while it is down — teal under price in an up trend, red above price in a down trend — and once the ATR has filled it is drawn on every bar, so it runs back through history rather than starting at the right edge. A triangle prints at each confirmed flip, pointing the way the trend turned. The line is also a named plot, StopLine, so other NinjaScript on the same chart can read the current value off it.
Two things to expect on a fresh chart. Nothing plots until two bars after the ATR period has filled — with the default 10, the line starts on the twelfth bar. And the flip state starts from an up trend, so that is the direction the earliest bars carry until the first commit turns it.
It compiles inside NinjaTrader 8 from one source file. Nothing else — no DLLs, no extra data feeds.
Settings that matter
All four are the indicator's own inputs, edited in the NinjaTrader Indicators dialog (right-click the chart > Indicators...) when you add it or any time after. Calculate is in the same dialog.
| Setting | Default | What it changes |
|---|---|---|
| ATR period | 10 | Lookback for the ATR that sizes both bands. |
| Multiplier | 3.0 | Band distance from the bar midpoint, in ATRs. Bigger is a wider stop. |
| Commit buffer (xATR) | 0.5 | How far past the opposing band a close has to land, in ATRs, to count toward a flip. 0 means any close past the band counts. |
| Persistence bars | 1 | How many consecutive qualifying closes are needed before the trend actually flips. |
| Calculate | On bar close | The default, and the mode the indicator requires. The flip machine is stateful and steps once per closed bar; On price change or On each tick corrupt that state and repaint. The indicator prints a warning to the NinjaScript Output window if you change it. |
Install
- Unzip, then copy
TakeFlightSupertrend.csintoDocuments\NinjaTrader 8\bin\Custom\Indicators\. Do not use Tools > Import — the zip is a plain file set, not a NinjaTrader export. - In NinjaTrader: New > NinjaScript Editor, then press F5 and wait for "Compile successful". On this first compile NinjaTrader appends its own auto-generated code region to the file; that is normal.
- Open a chart, right-click > Indicators..., find
TakeFlight Supertrend, add it, OK, and leave Calculate set to On bar close.
Requires NinjaTrader 8 desktop. Nothing else.
What it is not
TakeFlight Supertrend draws a line and marks the bars where that line flipped. It writes nothing to disk, places no orders, and does not tell you what or when to trade. Where your stop actually goes is your call. Futures trading involves substantial risk of loss.
Built custom. I do this for hire — fixed quote, most jobs under a week. Get a quote →