Appearance
Personalize your experience
Event Intensity Heat
NewFreeSelf-exciting intensity of up and down shocks
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
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.
What it draws
Own pane · counted from the engine's plot table and the script's draw calls
Series
- Level3Cluster upCluster downZero
- Area2Total intensityTotal intensity mirror
- Histogram2Up intensityDown intensity
- Horizontal levels3
Signal marks
Drawings and chart effects
- Dashboard tables1 created
How it runs
From source to the live chart, for this script
- 1Compile
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.
- 2Place
The header sets
pane = hpanewithheight = 0.26(26% of the chart), so the output gets its own pane under the price with its own scale. - 3Compute
The script runs once per bar, oldest to newest. 2
persistvariables keep state (objects, counters) across bars. - 4Stay 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.
- 5Render
The results are handed to the chart: series on WebGPU, drawings on the Canvas 2D QuaScript layer.
- 6Tune
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
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.
- • 7 plotted series
- • 3 levels
- • 3 signal mark types
Chosen by render = webgpu in the header.
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.
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.
- • 1 dashboard tables (QuaScript layer)
Alerts
2 alert rules declared with alert.rule
Large down moves are clustering
Shock intensity decayed after a cluster
Settings
5 settings, grouped as in the chart's settings dialog
| Setting | Type | Default | Range / options | Id |
|---|---|---|---|---|
| Volatility window | Integer | 100 | 20 – 2000 | volatility_window |
| Shock size (sigma) | Number | 2 | 1 – 5, step 0.1 | shock_size_sigma |
| Setting | Type | Default | Range / options | Id |
|---|---|---|---|---|
| Decay per bar | Number | 0.12 | 0.01 – 0.8, step 0.01 | decay_per_bar |
| Jump per shock | Number | 1 | 0.1 – 5, step 0.1 | jump_per_shock |
| Setting | Type | Default | Range / options | Id |
|---|---|---|---|---|
| Cluster level | Number | 1.5 | 0.2 – 10, step 0.1 | cluster_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
stat.stdevhft.hawkesmath.logviz/premium
Discussion