NEWCard payments are live · from $18/month, USDT also acceptedSee plans
COINPRED / STRATEGY LIBRARY

ETH band-zigzag trend follower: pivots form on band touches, trades follow the turn

An open-source (MPL 2.0) trend-following strategy from Trendoscope. It uses Bollinger, Keltner, or Donchian bands to confirm zigzag pivots, then reads trend from the pivot direction and span. By default it enters when that trend flips and exits when it flips again. The author's chart is KUCOIN:ETHUSDT on the 1-hour timeframe. The rules follow the source; this page has no invented backtest numbers.

Illustrated guidesPine Script®Included with monthly & annual plans
← All strategies
Trendoscope · 1.0 · 2026-11-25 · Trend following
ETH band-zigzag trend follower: pivots form on band touches, trades follow the turn

The idea

This is Trendoscope's open-source script titled Band-Zigzag - TrendFollower Strategy [Trendoscope], short title BZSTF[Trendoscope]. The source header is © HeWhoMustNotBeNamed, the same author brand as Trendoscope. The method ties band breaks to zigzag swings: a pivot is recorded only when the high reaches the upper band or the low reaches the lower band, and the ratio of adjacent pivot spans is then used to decide whether that swing counts as trend. The publication describes the usual trend-following trade-off: win rate is often modest, the payoff per winner can be larger, and choppy markets are painful. The author also calls it an experimental prototype, not tuned for a particular symbol or timeframe.

The author's publication chart is KUCOIN:ETHUSDT on the 1-hour timeframe, so this entry is filed under ETH. The script is not hard-coded to one symbol; it will load on other charts, but the write-up and the image follow that publication chart. The source imports public HeWhoMustNotBeNamed libraries (ta, arrays, and eHarmonicpatternsExtended). TradingView resolves those libraries when you add the script; Coinpred ships only the unmodified strategy source. One publication detail differs from the code: the text says the pivot ratio must cross 1.0 to confirm trend, but the source compares ratio with that pivot's percentB. The rules below follow the source.

Author chart of the band-zigzag trend-follower on KUCOIN:ETHUSDT 1-hour, showing bands, zigzag lines, and entries
Author chart: KUCOIN:ETHUSDT (KuCoin Ethereum / Tether), 1-hour timeframe, from the author's publication image. The bands, zigzag, and entry/exit marks are visible; this only shows the layout and is not a performance claim.

How the indicators are calculated

  • Bands: the default is Bollinger with an sma base, length 20, and multiplier 2.0, computed via the imported eta.bb helper. You can switch to Keltner (optionally using true range) or Donchian. Sticky is on by default, so the bands do not contract until price breaches them. Adaptive is also on: while the current zigzag direction is up, the lower band will not fall; while it is down, the upper band will not rise.
  • Pivots: a high pivot is stored when the bar high is ≥ the adaptive upper band uupper; a low pivot when the bar low is ≤ the adaptive lower band llower. A same-direction pivot is moved to the more extreme price; a new zigzag leg starts only on an opposite pivot.
  • percentB is (high − llower) / (uupper − llower) for highs and (uupper − low) / (uupper − llower) for lows. ratio is the span of the current pivot versus the previous two: abs(current − last) / abs(prior − last).
  • A single pivot's trend sign is the pivot direction if ratio > percentB, and the opposite sign otherwise. trend uses the last confirmed pivot that way; currentTrend uses the latest still-unconfirmed pivot.
  • Use Recent Pivot Override is on by default. If the latest pivot has both ratio > percentB and ratio > currentTrendInvalidationMultiplier (default 1.618), currentTrendForce takes that direction and can override the combined trend, which is meant to cut a steep pullback earlier. Otherwise combinedTrend follows the last confirmed trend.
  • The strategy uses 10% of equity, 0.05% commission, margin_long and margin_short of 100 (full margin, i.e. no leverage in the usual Pine sense), and pyramiding=1.

Entry rules

  • allowEntry is set true when combinedTrend crosses above or below 0, then set back to false after an entry, so one trend typically gets one attempt (pyramiding=1).
  • Long (order name Long): combinedTrend > 0, allowEntry is true, and the current Trade Type condition holds. The default Trade Type is Any, so a flip to bullish is enough. Breakout also requires currentDir > 0; Pullback requires currentDir < 0; Pullback-Breakout requires currentTrend, trend, and currentDir all positive.
  • Short (order name Short): combinedTrend < 0, with the mirror conditions.
  • Trade Direction defaults to all, and strategy.risk.allow_entry_in enforces that choice.
  • The source does not wait for barstate.isconfirmed. A band touch or trend flip can appear before the bar closes; whether the fill stands depends on your TradingView order settings.

Exits and position size

  • Use Stop Loss is off by default. When combinedTrend turns positive, an open short is closed with strategy.close("Short"); when it turns negative, an open long is closed. The same flip that opens a new trade first clears the other side.
  • If you turn on Use Stop Loss, a long also places ExitLong with a stop at low − (uupper − llower), and a short places ExitShort at high + (uupper − llower). The author notes that this initial stop is not required if Recent Pivot Override is already on.
  • If combinedTrend returns to 0, the script calls strategy.close_all().
  • Each entry is 10% of equity, with no stacking. What that notional is worth changes with the symbol and equity, so treat the size as your own risk setting.

Inputs (source defaults)

InputDefaultRole
Trade DirectionallAllow both sides, or keep only one.
Trade TypeAnyEnter on the trend flip, or wait for a breakout, a pullback, or a pullback then breakout.
Use Stop LossfalseWhether to place an initial stop based on the band width of the entry bar.
Band type / MA / Length / MultiplierBollinger Bands / sma / 20 / 2.0Channel type, average, length, and multiplier.
Use True Range (For KC only)trueUsed only for Keltner Channel.
Sticky / Adaptive / Display Bandstrue / true / trueSticky and direction-adaptive bands, and whether to plot them.
Use Recent Pivot OverridetrueWhether an extreme latest pivot can override the combined trend.
Invalidation multiplier1.618Override threshold when the latest pivot's ratio also exceeds percentB.

Things to know before using it

  • The publication says the pivot ratio must cross 1.0; the source uses ratio > percentB. percentB moves with the band width, so it is not the same as a fixed 1.0.
  • This is trend following. In a choppy market it can flip often or give back a large run. The author lists a lower win rate and deeper drawdowns as traits of the method.
  • The script depends on public TradingView libraries. If those imports cannot be resolved, it will not run as published.
  • There is no default stop; the exit is the combined-trend flip. With Recent Pivot Override on, a steep opposing pivot can end the prior trend early.
  • The author says the script was not built or tested for a specific instrument or timeframe. The ETH 1-hour chart is the publication image, not a claim that these defaults fit that market.

Installing it on TradingView

  1. Download the .pine file from Coinpred (active membership required, see below), or check the original page for a newer version.
  2. Open the Pine Editor, create a blank script, paste the full source, and save. The imports in the source must resolve on TradingView.
  3. Click Add to chart. To match the author image, start with KUCOIN:ETHUSDT on the 1-hour timeframe.
  4. Review the trade direction, Trade Type, and the optional stop, then inspect fills in the Strategy Tester.
  5. Past tester results do not guarantee future returns.

About backtest figures

Source, license and version

  • Source: https://www.tradingview.com/script/9FsHYtrq-Band-Zigzag-TrendFollower-Strategy-Trendoscope/
  • Author: Trendoscope (source header © HeWhoMustNotBeNamed). Source version 1.0 (Pine v5), scriptAccess=open_no_auth.
  • License: Mozilla Public License 2.0. Redistribution must keep the copyright and license notices; modified files must remain under MPL 2.0. Coinpred ships the unmodified full source.
  • Members can download the .pine file on this page to study the rules. Judge the risk yourself, and follow your venue's rules.

Source, license and version

Mozilla Public License 2.0 (MPL 2.0),源码头注明 © HeWhoMustNotBeNamed,由 Trendoscope 账号发布。再分发须保留原版权与许可声明;如修改源码文件,修改后的文件仍须按 MPL 2.0 提供。Coinpred 未修改源码。 / Licensed under MPL 2.0 per the source header, © HeWhoMustNotBeNamed, published under the Trendoscope account. Redistribution must keep the copyright and license notices; modified files must remain under MPL 2.0. Coinpred ships the unmodified source.

View original source ↗

Check the script license and your TradingView account features. Historical results do not guarantee future performance.

More strategies

All strategies →