Appearance

Personalize your experience

Mode
Accent Color
Direction
Analysis Marketplace
QuaScript

Anchored VWAP Constellation

Admin's Choice NewFree

Eight swing-anchored VWAPs and the buyers' cost band

Trendlines & LevelsPrice overlay WebGPU CanvasHybridDashboardSignalsAlerts
quascriptlevelsvwapanchoredswingssupport

Favourites and Admin's Choice analyses are listed in the terminal's indicators window under Analysis Marketplace.

Language
QuaScript
Engine
Native C++, incremental on live ticks
Rendering
WebGPU + Canvas
Placement
Price overlay
Settings
4
Plots
11
Lines of code
140
Source
presets/analysis/levels/anchored_vwap_constellation.qs
Anchored VWAP Constellationengine result
Loading the engine result…
quatick-charts · QuaScript engine on synthetic 1-minute bars · drag to pan · scroll to zoom · Run executes the script on the engine (⌘/Ctrl+Enter while editing)

About

Eight volume-weighted average prices, each anchored at one of the last four confirmed swing lows (emerald family) and the last four swing highs (rose family). An anchored VWAP is the average price paid by everyone who traded since that swing, so it is where those buyers or sellers are break-even. Newer anchors are brighter; older ones fade. The cloud between the highest and lowest low-anchored lines is the buyers' cost band, coloured by how much of the constellation price is above. Reading: price above most lines = the recent crowd is in profit and tends to defend dips; price below most = trapped buyers become supply. A reclaim of the newest swing-high VWAP is the first sign that sellers since the last top are under water. Signals: reclaim of the newest swing-high VWAP, loss of the newest swing-low VWAP, full constellation support.

11
Plotted series
5
Signal marks
1
Drawings
3
Alert rules
4
Settings
127
Lines of code

What it draws

Price overlay · counted from the engine's plot table and the script's draw calls

Series

  • Line8 visible · 3 helper
    Swing low VWAP 4Swing low VWAP 3Swing low VWAP 2Swing low VWAP 1Swing high VWAP 4Swing high VWAP 3Swing high VWAP 2Swing high VWAP 1
  • Band fills (render.band calls)1
Legend
Swing low VWAP 4 Swing low VWAP 3 Swing low VWAP 2 Swing low VWAP 1 Swing high VWAP 4 Swing high VWAP 3

Signal marks

Swing-high VWAP reclaimSwing-low VWAP lostFull supportNew low anchorNew high anchor

Drawings and chart effects

  • Dashboard tables1 created

How it runs

From source to the live chart, for this script

  1. 1
    Compile

    The QuaScript compiler checks the 140-line script (127 lines of code) and lowers it for the native C++ engine. Compile errors point at the exact line and column.

  2. 2
    Place

    The header sets overlay = true, so everything is drawn on the price chart, on the same scale as the candles.

  3. 3
    Compute

    The script runs once per bar, oldest to newest. Each bar also runs one loop (1 for). 17 persist variables keep state (objects, counters) across bars.

  4. 4
    Stay live

    On the terminal the script keeps one live engine session: a tick rolls the forming bar back to its checkpoint and re-executes only that bar, and new bars are appended, so history is never rerun while the market moves. The live result is identical to a full run.

  5. 5
    Render

    The results are handed to the chart: series on WebGPU, drawings on the Canvas 2D QuaScript layer.

  6. 6
    Tune

    4 settings in 2 groups appear in the chart's settings dialog. Changing one reruns the engine with the new value.

Rendering

Hybrid: this script draws on 2 surfaces at once

WebGPUSeries renderer

The browser's modern GPU API. The chart uploads every line, band and mark of the script as GPU buffers and draws them in one pass, so dense heatmaps and dozens of series stay smooth while you pan and zoom. Without WebGPU support the chart's GPU layer falls back to WebGL 2, then Canvas 2D.

In this script
  • • 11 plotted series
  • • 1 band fill call
  • • 5 signal mark types

Chosen by render = webgpu in the header.

WebGLNot used

GPU drawing through WebGL 2, available in every current browser. Used for chart-native profiles and for series that ask for it with backend = "webgl". Fast for large numbers of bars and wide fills.

CanvasUsed

The browser's 2D drawing API. Text-heavy and object-style output (dashboard tables, zones, tags, segments), candle colors and backgrounds are painted by the QuaScript layer, a Canvas 2D surface over the chart. Series use Canvas when the script's header does not ask for a GPU.

In this script
  • • 1 dashboard tables (QuaScript layer)

Alerts

3 alert rules declared with alert.rule

Swing-high VWAP reclaim

Close above the VWAP anchored at the newest swing high

Swing-low VWAP lost

Close below the VWAP anchored at the newest swing low

Full support

Price is above every anchored VWAP

Settings

4 settings, grouped as in the chart's settings dialog

Swings
SettingTypeDefaultRange / optionsId
Swing bars leftInteger82 – 50swing_bars_left
Swing bars rightInteger41 – 30swing_bars_right
Signals
SettingTypeDefaultRange / optionsId
Cross margin (ATR)Number0.30 – 3, step 0.05cross_margin_atr
Bars between repeatsInteger201 – 500bars_between_repeats

Script

packages/quascript/presets/analysis/levels/anchored_vwap_constellation.qs

Header

analysis "Anchored VWAP Constellation" {
    overlay = true
    render = webgpu
    short_title = AVC
    precision = 2
}
Total lines
140
Code lines
127
Comment lines
12
Helper functions
0
Loops
1
Persistent variables
17
Higher-interval feeds
0
Engine plots
11

Built with

Technical analysis (ta.*)
ta.atrta.bars_sinceta.pivot_highta.pivot_low
Math (math.*)
math.coalescemath.is_namath.maxmath.min
Imported modules
viz/premium

Discussion

Sign in to join the discussion. Your posts and replies show up on your profile.