Indicators · Stretch bands in a pane · explained simply

PeakLines H 1.11

Copy the full Pine script and paste it into TradingView’s Pine Editor. Or copy this explanation, open Grok, and paste it with your question.

Open Grok ↗

PeakLines H is the pane that goes with PeakLines. It draws the gap between a fast and a slow average as bars, with two self-adjusting bands that mark when that gap is unusually high or low. A green dot marks a possible buy and a magenta dot a possible sell, when an unusual stretch starts to ease.

PeakLines 1.00 on a Tesla (TSLA) daily chart with the PeakLines H 1.11 pane below it, showing the spread bars, bands, dots and money-flow area; historical screenshot, not live data.
Example screenshot—not live data. Tesla (TSLA) daily chart with PeakLines H 1.11 in the lower pane and PeakLines 1.00 on price. The table numbers in this picture are one example from this chart only, not a typical result and not anyone’s real trades. Select the image to open full size.

Six questions this page answers

Use the guide below the same way you would judge any tool on a chart:

  • What state is the market in?
  • What should I do, and at exactly what price?
  • How sure is it?
  • What proves it wrong?
  • Has it worked before on this chart?
  • What can’t it tell me?

What it tells you

What state is the market in? The pane shows how stretched price is right now compared with its own recent past. The math is the same as PeakLines on the price chart, with the same default settings:

The script draws four slow-moving averages of each bar’s midpoint (halfway between its high and low), using 8, 16, 24 and 32 bars. The spread is the gap between the fastest (8) and slowest (32) average. By default that gap is divided by the 14-bar average true range (ATR), so a big gap on a calm chart and on a wild chart can be compared fairly.

Then it looks back over the 88 bars before this one and finds two edges. The upper band is the level only the top 4% of those spread readings beat. The lower band is the level only the bottom 8% fell below. The bands are re-figured every bar, so they adjust on their own to each chart. By default the upper band never goes below zero and the lower band never goes above zero. The bands (and so the signals) only start once there are 88 bars of spread history.

The “H” version is the pane view. It does not use a higher timeframe.

Reading the pane

  • Bars (histogram): the spread. Gold shades mean the averages are stacked upward, blue shades mean downward, gray means mixed or flat. Hotter, brighter colors mean the gap is bigger than usual over the last 85 bars.
  • Thick line: the spread itself, colored the same way. Thin white line: its 3-bar average.
  • Magenta step line: the upper band. Cyan step line: the lower band. The space between them is lightly shaded.
  • Background tint: magenta while the spread is above the upper band, cyan while it is below the lower band.
  • Green and red area: DMFI, a money-flow reading built from price and volume. Green leans positive, red leans negative. It is drawn 1.5 times larger to be easier to see, and it does not change the dots. On charts with no volume it is left out.
  • A dotted line marks zero.

The dots

What should I do, and at exactly what price? The dots are decided at the bar’s close.

The trigger is the turn back. A buy does not fire while the spread is still sinking below the lower band. It fires on the first bar that closes with the spread crossing back up through the lower band: the stretch is starting to ease. A sell is the mirror: the spread crosses back down through the upper band. (A setting called Trigger: Level brings back the older rule of firing on any bar outside a band.)

  • Signals are only decided when a bar closes, so a dot does not appear and then vanish during the bar.
  • After a buy, another buy must wait at least 2 bars (the cooldown); sells work the same way.
  • A built-in $100 test book decides which signals count: a buying run stops at 16 buys, and a sell only shows while the book is holding shares.
  • Green dot (on the lower band): possible buy.
  • Magenta dot (on the upper band): possible sell.

The table

The table (bottom right by default) shows:

  • The trend color and spread mode (ATRN or RAW), the spread and its 3-bar average, the upper and lower bands, the distance between them (BandW), the lookback length, the DMFI reading and the percentile settings.
  • Cooldown: READY, or how many bars are left before the next buy or sell can fire.
  • Signal: BUY or SELL on a signal bar; LIVE if one is forming on the unfinished bar; a note if the cooldown blocked one; or whether the spread is below or above a band.
  • The $100 test book: Buys this cycle, AvgEntry, Realized (including the open cycle), Unreal, Cycles and Cycle PF. Buys start at $100 and grow 1.5 times per buy in a run; each sell sells 25% of what is held.

Alerts

Pick any of these in TradingView’s alert dialog. All fire at the bar close:

  • PeakLines Buy and PeakLines Sell: a green or magenta dot.
  • Below Lower Band and Above Upper Band: the spread is outside a band, with or without a dot.

What it can’t tell you

How sure is it? There is no confidence number. What proves it wrong? There is no stop line. Has it worked before? The small $100 book gives a rough idea; PeakLines on the price chart has the fuller $10,000 account.

  • It does not predict prices. A stretch can ease for a bar and then stretch again.
  • The bands always mark the top 4% and bottom 8% of recent bars, so some dots will show up even on a quiet chart.
  • It ignores news, earnings and the wider market.
  • PeakLines H is a TradingView indicator. MystTrades does not show live PeakLines H readings.

Version

PeakLines H 1.11 by TheurgyLabs (build of Nov 19, 2026). Version 1.11 made every signal wait for the bar close and added the LIVE note. Version 1.10 switched to the turn-back trigger, made the bands use only past bars, and added the $100 test book. Version 1.00 was the original “PeakLines H v1.”

For learning and research, not personal investment advice. This page explains the indicator; it does not show live readings or change your TradingView script. Any table numbers are a hypothetical test on past prices, not real trades. Past results do not promise future results.

← All indicators