Sample scripts
Eleven sample TapeScripts for the tick heatmap — big prints, VWAP bands, cumulative delta, book imbalance, wall pulls, Telegram alerts and four signal-only strategies.
Samples are listed under Samples in the TapeScript widget. Selecting a sample copies it to your scripts folder and opens the copy. The sample itself does not change.
Indicators
| Sample | Description | Output |
|---|---|---|
| Absorption Watch | Marks trades into a level that holds much more size than the trade. Plots VWAP. | Markers, VWAP line |
| Big Prints | Marks trades much larger than the recent average, colored by aggressor. Optional sound. | Markers |
| VWAP Bands | VWAP since the script started, with ± k·σ bands. | 3 lines on the heatmap |
| Cumulative Delta | Buy aggressor volume minus sell aggressor volume. | Line in the script pane |
| Top-of-Book Imbalance | (bid size − ask size) / (bid size + ask size) at the best prices, smoothed. | Line in the script pane |
| Wall Pulls | Alerts when a large resting level is removed away from the best prices. Requires order-book data. | Markers, alert |
| Telegram Alerts | Big prints and absorption, each sent to Telegram as an HTML card with price, size and 30-second delta. | Markers, alerts, Telegram messages |
Strategies
The strategy samples show entries and exits on the chart. They do not place orders.
| Sample | Entry condition |
|---|---|
| Strategy - Absorption Reversal | Selling into a bid that does not move: long. Buying into an ask that does not move: short. |
| Strategy - Delta Breakout | Price breaks its recent range with strong delta in the same direction. |
| Strategy - VWAP Reversion | Price is k·σ away from VWAP and aggressive flow reverses. Target: VWAP. |
| Strategy - Imbalance Scalper | Strong imbalance at the best prices confirmed by trades. Short holding time. |
All four strategies:
- Hold one virtual position at a time.
- Exit at take-profit (
rr× risk), stop-loss (stopBps) or after a maximum time (maxHoldMs). All three are inputs. - Mark entries (
LONG,SHORT) and exits (TP,SL,TIME, with the result in bps). - Play
placeon entry,fillon a profitable exit andrejecton a losing exit. - Plot an Equity (bps) line in the script pane and log trades, win rate and equity to the Console.
What each sample shows
| Sample | Language features |
|---|---|
| Big Prints | rolling(), marker() |
| VWAP Bands | Top-level state, @interval, several lines |
| Cumulative Delta | "bottom" pane, venue.hasAggressor |
| Top-of-Book Imbalance | onBbo, ema() |
| Wall Pulls | onDepth, an object keyed by price, remove() |
| Telegram Alerts | alert() with telegram, a function that builds HTML, timeWindow() |
| Strategies | Functions, position state, alert keys |