OPEN-SOURCE SCRIPT

IQ Trend Beams [TradingIQ]

4 181
🔹 OVERVIEW

IQ Trend Beams is a trend assistant that draws your trendlines the way a disciplined chartist would - and then holds them accountable. It maintains two channels, support and resistance, each always showing one working line. A line is born forming: it moves and re-shapes freely, polished every bar by a perceptual score toward the line a skilled trader would actually draw. When its geometry settles and it has earned enough tangency credit, it locks - and from that moment the ink is frozen forever; it never moves again. Locked ink extends until break evidence fires, then it is broken: restyled but never relocated, holding the screen as history until its successor locks.

Riding each live beam is its own forecast; a calibration band, a reach profile, and ghost levels, all built from the volume that has actually traded around that line.

This is an honest visualization and modeling tool, not a signal service. It draws structure clearly and states its own confidence out loud; it is not a validated edge or a promise of profit. Read the limitations section - it is not window dressing.


🔹 THE TWO CHANNELS - AN AUDITED PROMISE

Most trendline tools quietly redraw the past so the line always looks right in hindsight. Trend Beams refuses to. A line lives through three visible states:

Forming (dotted) - the assistant sketching. It is free to move and re-fit while it hunts for the right geometry. This is the only state in which a support/resistance line moves, and it is dotted precisely so you can tell a guess from a commitment.
Locked (solid) - the geometry has stilled and earned its tangency credit, so the line is frozen. It will never move again. A locked beam is a promise the tool has to keep in public.
Broken (restyled) - break evidence fired. The ink is re-styled to show it failed, but it is never relocated; it holds its original slope as an honest record and, if you keep history on, dims into the background once its successor locks.

Because a locked line cannot move, what you saw at lock time is what you keep. This is the core design commitment of the tool.

Two rails, either direction by design. Support is the lower rail, fit to the swing lows on the underside of price; resistance is the upper rail, fit to the swing highs above it. Neither is locked to a single slope: in a falling market the support rail angles down with the lows (the floor of the down-channel), and in a rally the resistance rail angles up with the highs (the ceiling of the up-channel). That is deliberate. A tool that forces support to only ever point up would go blind to the lower boundary of a downtrend - and miss exactly the moves that matter. Trend Beams instead always draws both boundaries of the channel price is actually in, so a strong move is framed on both sides rather than half-missed. If you prefer to read it the classical way, follow the rail that agrees with the trend and treat the other as the opposite wall of the same channel.


🔸 HOW A LINE EARNS ITS LOCK

While forming, each line is scored every bar by a perceptual fit, a running measure of how well its geometry matches what a careful trader would draw against the recent swing structure, blended with a one-pole toward its fitted slope so it settles rather than twitches. A lock is granted only when the geometry has gone still for long enough, the line has accumulated real tangency credit (genuine touches, not a single graze), and it spans a minimum bar count - and it is refused outright if it would invert the channel. The Mode dial sets how much evidence this takes.


🔹 THE AUDIT BADGE

Locked ink can carry a small measurement badge that reports, in plain terms, how the line is actually holding up:

Wick-through - recent piercing of the line, exponentially weighted, measured against the tool's 10% design target. A well-behaved line lets price kiss it, not knife through it.
Survival probability - the current modeled odds that the line is still valid.
Maturity - how far through its estimated total run the move is, so a young trend reads differently from an exhausted one.

The badge is the tool grading its own work on the chart, not a trade instruction.


🔸 THE FORECAST - EACH BEAM READS ITS OWN VOLUME

Every live beam carries its own forecast, built entirely from the volume that has traded around that line. Trend Beams bins the intrabar volume by its distance from the beam, smooths it into a continuous density (a kernel-density estimate), and renders three things that ride the line:

Calibration band - translucent ribbons hugging the beam, one per density bin, showing where the trend has held its volume. Strength is encoded as colour vibrancy at a constant perceptual lightness (the Oklab principle - a dense core reads vivid, the thin tails fade), so nothing is made brighter or darker than its weight warrants.
Reach profile - a smooth filled contour fanning into the future margin, where each level's forward extent is its density times the trend's estimated remaining length. It answers, at a glance: if this trend keeps going, how far - and around which prices - does its own volume say it reaches?
Ghost levels - dashed lines at the distribution's densest peaks, riding parallel to the beam, marking the prices this trend keeps returning to.

The forecast attaches only to a beam's currently-visible live element - its forming sketch, or its locked ink - and keeps no history. It is a read of the present trend, refreshed at the live edge, not a replay of the past.


🔸 THE ENGINE DIALS

Mode - the tempo. Fast locks, breaks and re-forms sooner (short swings); Slow demands more evidence and holds through more noise (long moves); Medium is the balanced reference.
Precision - how much data the engine reads: the perceptual fit window and the intrabar sample rate. Higher tiers resolve finer structure at more load. Sampling is timeframe-aware and never drops below one minute.


🔹 LAYERS, COLOUR & LEGIBILITY

Every layer is a toggle - forming lines, broken history, audit badges, and the forecast - so you can run it as a bare two-line channel or a fully dressed read. Colours come from three clean anchors: Support, Resistance, and Chrome (badges and neutral furniture). The whole translucent forecast - band, profile, and ghost levels - is coloured in the Oklab perceptual space, so strength shows up as vibrancy at a constant lightness rather than as glare, and a single Contrast dial scales the entire forecast from a whisper to bold.


🔸 HOW TO READ IT

• Treat a forming (dotted) line as a hypothesis and a locked (solid) line as a committed level - the tool is telling you which is which on purpose.
• Watch the audit badge: rising wick-through and falling survival probability say a locked line is wearing out.
• Read a broken line as a failed level that still marks where the structure gave way.
• Use each beam's band to see where its trend has held its volume, its reach profile for how far the trend's own volume says it can run, and its ghost levels for the prices it keeps returning to.


🔹 INPUTS

Trend Engine - Mode (tempo) and Precision (data depth).
Layers - show forming lines, broken history, audit badges, and the forecast.
Colors - Support, Resistance, and Chrome anchors, plus a Contrast control for the translucent forecast.
Channels - enable the support and/or resistance side independently.


🔸LIMITATIONS AND HONEST NOTES

• This is a drawing and modeling assistant, not a validated strategy. It makes no performance claim and no edge claim. Nothing here is financial, investment or trading advice.
Locked and broken lines do not repaint - once a line locks, its geometry is frozen. Forming lines move by design (they are the live sketch, and are dotted to say so), and each beam's forecast (band, profile, ghost levels) refreshes at the live edge as new volume arrives and attaches only to the current live element. These are live reads, on purpose; none of them rewrites confirmed history.
Survival probability, maturity, remaining length and the reach profile are model estimates from the trend's own statistics - projections, not guarantees, and not forecasts of price.
• Intrabar sampling is subject to your plan's intrabar data limits; higher Precision tiers read more intrabar data.
• Drawing budgets are finite. The tool caps its lines, labels and polylines internally, but very long histories with everything enabled push against TradingView's per-script drawing limits - trim the layers you don't need.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.