Appearance

Personalize your experience

Mode
Accent Color
Direction
Analysis Marketplace
QuaScript

Event Intensity Heat

NewFree

Self-exciting intensity of up and down shocks

WebGPU StudioOwn pane WebGPU CanvasHybridDashboardSignalsAlerts
quascriptgpuwebgpuhawkesshocksclusters

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
Own pane
Settings
5
Plots
7
Lines of code
54
Source
presets/analysis/gpu/event_intensity_heat.qs
Event Intensity Heatengine 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

Self-exciting intensity of large moves, separately for up and down shocks. A shock is a bar whose return exceeds a multiple of the rolling volatility; each shock raises its intensity, which then decays, so clusters of shocks build heat. Up intensity grows above zero, down intensity below it, as gradient histograms; the area behind them is the total. Reading: rising down intensity = selling pressure is feeding on itself (stops, liquidations); a decaying total after a cluster = calm returning, when mean-reversion entries work again. Signals: cluster starts and "calm returning". Method: Hawkes (1971) self-exciting process.

7
Plotted series
3
Signal marks
1
Drawings
2
Alert rules
5
Settings
46
Lines of code

What it draws

Own pane · counted from the engine's plot table and the script's draw calls

Series

  • Level3
    Cluster upCluster downZero
  • Area2
    Total intensityTotal intensity mirror
  • Histogram2
    Up intensityDown intensity
  • Horizontal levels3
Legend
Total intensity Total intensity mirror Up intensity Down intensity Cluster up Cluster down

Signal marks

Up-shock clusterDown-shock clusterCalm returning

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 54-line script (46 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 pane = hpane with height = 0.26 (26% of the chart), so the output gets its own pane under the price with its own scale.

  3. 3
    Compute

    The script runs once per bar, oldest to newest. 2 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

    5 settings in 3 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
  • • 7 plotted series
  • • 3 levels
  • • 3 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

2 alert rules declared with alert.rule

Down-shock cluster

Large down moves are clustering

Calm returning

Shock intensity decayed after a cluster

Settings

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

Shocks
SettingTypeDefaultRange / optionsId
Volatility windowInteger10020 – 2000volatility_window
Shock size (sigma)Number21 – 5, step 0.1shock_size_sigma
Process
SettingTypeDefaultRange / optionsId
Decay per barNumber0.120.01 – 0.8, step 0.01decay_per_bar
Jump per shockNumber10.1 – 5, step 0.1jump_per_shock
Signals
SettingTypeDefaultRange / optionsId
Cluster levelNumber1.50.2 – 10, step 0.1cluster_level

Script

packages/quascript/presets/analysis/gpu/event_intensity_heat.qs

Header

analysis "Event Intensity Heat" {
    pane = hpane
    height = 0.26
    render = webgpu
    short_title = EIH
    precision = 2
}
Total lines
54
Code lines
46
Comment lines
7
Helper functions
0
Loops
0
Persistent variables
2
Higher-interval feeds
0
Engine plots
7

Built with

Statistics (stat.*)
stat.stdev
Microstructure kernels (hft.*)
hft.hawkes
Math (math.*)
math.log
Imported modules
viz/premium

Discussion

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