Cookbook
Complete, working wrun indicators you can copy, run, and adapt, in six groups: what to draw on price, how to read order flow, prediction-market odds read against the markets they move with, HUD cards that read a market at a glance, views beyond the time axis (profiles, volatility curves and surfaces, fund flows, the order book, cross-market maps, calendars, the yield curve), and strategies that trade. Forty of them are also the templates the chart's New indicator starter list offers, one card each, under the same group names; the other six are shorter recipes that build up the loop one idea at a time, each with the indicator in full and the reasoning behind it.
Every recipe page is a full indicator, not a snippet. Pick its card in the editor's starter list, or paste it into a blank indicator tab under the language marker, press Run, and it works. Then read "How it works" for the moving parts, "Where it runs" and "When data is missing" for the markets it serves and what it says on the ones it does not, and "Customize it" for the variations worth trying. Each recipe ends with the concept pages behind it, so you can go deeper wherever something catches your eye.
Inside a group the shorter recipes come first, easy to advanced, then the picker's templates in the picker's order. The first one is the cleanest introduction to the loop: load a series, compute a number, draw it.
- On price: marks, zones and tints drawn on the chart's own bars.
- Order flow: buyers and sellers, open interest and liquidations, bar by bar.
- Prediction markets: a Polymarket market's odds against the market they move with.
- HUDs: one reading of the whole market, kept beside the candles.
- Beyond the time axis: profiles, curves, chains and fund flows on a second axis.
- Strategies: packages that trade, replayed by the Strategy Tester.
On price
Marks, zones and tints drawn on the candles themselves, from the chart's own bars.
| Recipe | What it does | What it teaches |
|---|---|---|
| Volume spike detector | Flags bars whose volume blows past its trailing average, scored as a z-score | one input, a TA class, a gated mark |
| Typed inputs tour | Every kind of setting but text on one small channel indicator, with two pages, presets, a hover card, a HUD card and legend entries | fourteen of the fifteen setting kinds, the layout words and the "@name" bindings, the block kit |
| Anchored VWAP | Weekly and daily VWAP that reset on UTC session boundaries, with a shaded band and a stretch readout | bar.time(), state that resets, a box as a channel |
| Regime filter | A no-repaint 4h trend gate that tints a line by regime and marks entries only when the higher timeframe agrees | higher timeframes without lookahead, color_by, shape_where |
| Key levels | Prior-day and prior-week highs and lows plus the day open, as horizontal levels on any interval | segments as levels, a param as a gate |
| Zone tracker | Supply and demand zones drawn as boxes that switch off when price mitigates them | boxes with a when gate, ring-buffer windows |
| Session map | Asia, London and New York each boxed around the session's high and low with a tag, the live session growing bar by bar | box and label handles keyed by the UTC clock, a ring of ids reused by day, one text slot for many tags |
| Volume heat hours | Every clock hour boxed over its range and tinted by its volume against the last day's average hour, hot hours tagged with their multiple | folding hours from the chart's own bars, a rolling baseline, opacity as the reading |
| Supply and demand zones | A zone at every confirmed swing, extended right until a close breaks it, with breakout marks and the nearest zone on each side tagged with its price | PivotHigh and PivotLow, zones as box handles that stop extending, right-anchored price tags |
| Trend alignment | The chart's EMA beside the 1h and 4h EMAs as steps, the background tinted while all three agree, a three-cell strip reading the state | closed 1h and 4h candles streams, render.bgcolor gated by a data-only output, an anchored strip |
| Trend candles | The chart's own candles tinted by where the close sits against two averages, a dot on each flip, a counter of how long the state has held | render.barcolor, shape outputs for events, a counter in an anchored label |
| Strike matrix | The live options chain as net gamma exposure by strike across the four nearest expiries, docked on the price axis with the ATM row outlined, the per-strike bars beside the board, and the largest GEX strike, the gamma flip, max pain and the put wall drawn across the chart as labelled levels | options_ on the live bar, a plot.matrix and a plot.levels docked on one side and kept apart by an offset, draw.line levels with knockout label handles, the OptionsChain kit |
| Session OI levels | Open interest by strike drawn as one profile per session, each anchored inside its own span of time | plot.levels with span: "time", a spans frame, segments per series |
Order flow
Who traded, who is positioned and who was forced out, from sided trades, open interest and liquidations.
| Recipe | What it does | What it teaches |
|---|---|---|
| Aggregated CVD | Aggressive buying minus selling on the chart's market, accumulated, with volatility bands and sign coloring | the trades source, accumulators, missing policies, which inputs the chart pins to another market |
| CVD divergence | Cumulative volume delta in its own pane, price swings dotted on it, and the evidence drawn when price and CVD disagree at two swings | side-split trades.volume, a displaced shape output, line and polyline handles across two panes |
| Positioning regimes | Each bar's open-interest change in coins colored by who moved, a key card with each regime's share, a dot where the leading regime changed hands | oi.close reading NaN, one histogram output per colour, draw.card with text slots |
| Absorption | Bars where heavy one-sided volume failed to move price, lit in the delta pane, boxed on the chart and dotted on the absorbed side | a ratio against a rolling norm, two histograms sharing a pane, sign palettes |
| Liquidation bursts | Long and short liquidations in USD stacked in one column per bar in their own pane, a burst tagged on price with its size in money | the liquidations source by side, a z-score gate, label handles with money text |
| Book heat | The order book painted as a heatmap behind the candles, resting size per level, the scale read off the run | book.cells, plot.heatmap over cells, a palette and a quantile scale |
| Liquidation heat | Estimated liquidation levels as a grid of 64 rows around the close, hot rows lit, rewritten every bar | out.grid, plot.heatmap over a grid, a diverging palette with a floor |
| OI liquidation heat | The Liquidation Map's estimate drawn through time: positions opened from open interest, folded every bar onto a grid of 128 rows around the close and swept where price trades through | oi.close and side-split trades.volume read as positions, out.grid and plot.heatmap with a dollar tooltip, data-only outputs for alerts |
| Volume footprint | One footprint column per bar from the profile buckets, imbalances marked and stacked, the point of control per column | volume_, plot.footprint, imbalance words |
| TPO letters | Thirty-minute letters per day on the chart's own candles, the initial balance bracketed, single prints lit | plot.tpo, the letter interval rule, initial_balance |
| Session volume profile | A volume profile per session from the profile buckets, the value area shaded, each session boxed | plot.profile with span: "session", value_, background |
Prediction markets
A Polymarket market's odds set against the market they move with.
| Recipe | What it does | What it teaches |
|---|---|---|
| Odds vs price | A Polymarket market's odds against a pinned asset: rolling correlation, a divergence histogram, the asset's close in a window below the chart, a verdict card | a leg pinned to another market, Correlation and Zscore, a four-colour ladder on a histogram |
HUDs
One card pinned to the price pane, each in its own look, that answers one question first and reads the numbers behind it underneath, kept current on the live bar.
| Recipe | What it does | What it teaches |
|---|---|---|
| Market HUD | The trend in a word, then RSI, the taker buy share and the last closed bar's volume against its average on three rings, ATR percent and the open-interest change in coins as a sparkline, in the glass look | one render.hud card in a look, a headline pill coloured by a ladder output, a rings tile, data-only outputs read by the tiles |
| Decision board | A headline written from six factors ("Buyers Ahead, 3 to 1"), the net score as a stippled line and each factor's reading in a row with a dotted leader, in the broadsheet look | each factor as a rule with its thresholds as settings, counts as data-only outputs, a headline written into a string slot |
| Order flow HUD | Who is pushing price in a word, each bar's taker buy share as bars from the 50 mark, the window's buy share, the net taker delta in dollars and the liquidations on each side, in the chart desk look | side-split trades and liquidations, rolling windows kept as rings, a value tile with this bar's delta beside it |
| Order book HUD | The heavier side of the book in a word, the bid share within 1% of the mid in segments, the dollars resting by distance and the biggest walls, dotted on price, in the cockpit look | book.cells read in two passes, depth bands summed by distance, line handles set on the live bar |
| Session HUD | The session trading now, how much of it has passed and the session up next, the share of an average day's range used, the close in today's range, the distance from the VWAP and the prior day's high and low, in the stage look | param.session windows read with inSession, a daily candles stream, a countdown written into a string slot |
| Gamma map | Dealer gamma at spot in a word, the chain's gamma exposure by strike docked on the price axis, the walls and the flip drawn across the chart, the levels as numbered rows in the terminal look | options_ on the live bar, exposure math in the indicator, plot.levels docked on the axis |
Beyond the time axis
Views whose second axis is price, tenor or the calendar.
| Recipe | What it does | What it teaches |
|---|---|---|
| Volume profile and value area | The rolling volume profile docked on the price axis with POC and the value area lit, the three levels drawn with price tags, a heatmap of volume by UTC hour below the chart | volume_ as a block, plot.levels docked on the axis, panel.heatmap |
| Volatility term structure | Implied volatility at three tenors in a pane, the gap tinted while the curve is inverted, flip dots on price, a curve of now against a week ago, a regime card | implied_ and skew inputs by tenor, a range tinted by a ladder, panel.line on a category axis |
| Options dashboard | Eight tiles over the live options chain (net GEX, the flip, max pain, the dealer regime, the put/call ratio, the skew, vega and dealer delta), the gamma exposure curve over hypothetical spots with a signed fill, a badge and callouts, and a rolling CVD pane | options_ on the live bar, the OptionsChain kit, panel.tiles and panel.line over frames with markers and a badge, a named pane |
| ETF flows | The chart coin's daily spot-ETF net flow as one bar per day, the running sum in a strip on the price pane, a wash behind each day's candles, a card | etf_ landing once per day, lower-pane box handles, out.inset, render.bgcolor |
| Liquidation map | An estimate of where open positions would be liquidated, docked on the price axis as a two-sided profile, the largest rows drawn across the chart with tags, a cockpit card | open interest split by taker side into leverage tiers, plot.levels with baseline: "center", line and label handles |
| Options odds cloud | Where the options market expects price to settle at an expiry, docked on the price axis as one hump with the most likely row marked, the 68% and 95% bands drawn across the chart, a glass card | options_ turned into odds per price row, per-row colours and a gradient on plot.levels, declared draw.line and knockout draw.label drawings |
| Who is trading | The window's dollar volume shared out by trade size as a donut, bought against sold per size as bars with the verdict as a chip, a stage card with the whales' buy share | trade_ over a rolling window, panel.pie, panel.bars with a badge |
| Rotation map | Eight coins placed by strength against BTC and its momentum on a four-quadrant map with trails, the leader named in a chip and a terminal card | nine hourly candles streams on Binance Futures smoothed in days, panel.scatter with guides, quadrants and trails, param.color inks written into the frame |
| Volatility smile | Implied volatility by strike for three expiries as smooth curves over a strike axis, a spot marker, ATM callouts, a skew chip, a broadsheet card | options_ read out of the money, panel.line on a number axis, point callouts and a badge in the frame |
| Correlation matrix | How the chart's market moved with eight others as a market by market heatmap with an average row, a signal card with the most tied and most free markets | eight pins with missing: "nan", Pearson correlation on the live bar, panel.heatmap on category axes with a palette scale, a highlight row and a summary row |
| Venue share | Each venue's share of the last 24 hours of BTC dollar volume as a donut, a table of venue, last, premium, volume and share, a dial card with the widest premium | pinned close and volume on four venues, panel.pie, a styled panel.table, param.text and param.color settings, chart. |
| Volatility surface | Implied volatility across six expiries and nine moneyness buckets as a heatmap with the ATM row outlined, the term structure as tiles, a glass card | options_ interpolated to buckets, panel.heatmap with highlight, panel.tiles, a render.legend entry |
| Seasonality grid | A year by month grid of returns on daily charts, a weekday by hour grid of the average move on intraday charts, the best cell named, a broadsheet card | two candles streams of the chart's own market (26 weeks of 1h, 12 years of 1d) picked by chart., one panel.heatmap with a highlight and an Avg summary row, a signed scale |
| Depth curve | The order book as two cumulative staircases meeting at the mid, the biggest walls called out, the heavier side in a chip, a phosphor card with the ratio, the wall and the spread | book.cells summed outward from the mid, panel.line step series with fills, markers with an exact y, a caption |
| Yield curve | The Treasury curve today against a week and a month ago over a tenor axis, 2Y and 10Y callouts, the 2s10s spread in a chip and a broadsheet card | nine economic.value pins, prints kept in a ring, days turned into bars with chart., panel.line with three series |
Strategies
Packages that trade: orders placed in the file, replayed by the Strategy Tester under the chart.
| Recipe | What it does | What it teaches |
|---|---|---|
| Moving-average cross | Long when the fast average crosses above the slow one, flat when it crosses back under, with a tinted ribbon and a mark on each cross | strategy(...) in the source, orders in onBar(), a range ribbon |
| Risk-sized reversion | Buys the dip as RSI leaves oversold, protects it with an ATR-sized stop and target, leaves on recovery; each trade's rails drawn on price | an entry sized from its stop with qty(...) and strategy., a protective exit re-armed each bar, rails as line handles |
How to use a recipe
- The ring is the loop: the Editor, Templates, the recipe's card, Run, a setting changed, a value read at the Console prompt, and back to the editor.
- Publish leaves the ring: the indicator goes to other charts, to readers and to alerts.
- The three verbs in the middle are what every recipe does: load a series, compute a number, draw it.
- Open the editor: the chart toolbar's Editor button, or the Build icon in the Indicators dialog.
- For a recipe that is also a template, press the Templates icon ("Browse starter templates") in the editor's Explorer and pick the recipe's card under its group. The pick fills an untouched draft, or opens in a tab of its own, with the
//@lang=wrun-tsline on top. For any other recipe, press New indicator in the Explorer, pick Blank indicator (a tab holding the//@lang=wrun-tsline alone), and paste the recipe's indicator block under that line. - Press Run on a liquid symbol. Run compiles the file in your browser and draws it on the chart. The order-flow recipes want a market where the venue reports buy and sell volume; each page's "Where it runs" names the markets it serves.
- Open the overlay's settings. Every setting is a row there, labelled by its description and drawn as the control its kind names (a number field bounded by its
minandmaxforparam(...)andparam.int, a toggle forparam.bool, a menu forparam.choice), so lookbacks and thresholds change without touching code, and a change reruns the indicator over the loaded bars. Colors are declared on the outputs, boxes, and segments: edit the hex strings and Run again. - Read a value at the editor's Console prompt, which reads the last run without a new build (below).
- Publish it from the editor to add it to other charts, share it, or put an alert on it (Publishing, Alerts). A published indicator runs in each reader's browser, or on OpenMarket's servers when its code is Protected.
What the Console prompt answers after a Run, with the Volume spike detector's z as the output:
outputs every output with its value on the newest bar
params the settings the last run used
rows the bars the run covered, the first and last bar time, the warm-up bars
z the output's value on the newest bar
z[-3] the same output three bars back
last 20 z its last 20 bars; a data-only output reads the same wayMost recipes read the chart's own market and interval (Execution model). The ones that pin say so on their page. The chart serves a pin on a secondary ohlcv input: an interval coarser than the chart's and a whole multiple of it (Multi-timeframe), or another market at the chart's interval (Odds vs price). A market pin on any other source is refused by name, which is why Aggregated CVD reads the chart's own venue. Stocks, forex and gold pin the same way (Multi-source). On CME markets the editor's Run is paused, and a community indicator cannot read CME data; OpenMarket's official wrun indicators can.
What the recipes share
A few shapes come back in every recipe:
- State lives in module-level variables. A value that must survive from bar to bar is a module-level
let; a window of past values you index into is aStaticArray<f64>ring buffer, whichHistorypackages as a class (Stats, history and lists). - Decisions are numbers. A condition the chart should act on is a data-only
noneoutput written as1or0; the declarations turn it into a look throughshape_where,color_by, or a box'swhengate. - Calendar math comes from the bar's open time.
bar.time()is each bar's open in epoch seconds; dividing by 86400 gives the UTC day, and a boundary in that index is where sessions reset. - An output can carry an alert. Once the indicator is published and on a chart, the chart's alert dialog offers every drawn output with conditions such as Crosses above and Greater than, and a data-only gate becomes a ready-made signal through
alert(name, { when })in the file (Alerts).