---
title: "Cookbook"
description: "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…"
order: 70
section: "cookbook"
---

<!-- source: docs/indicators/cookbook/overview.md; generated by packages/cli/scripts/gen-indicator-docs.ts, do not edit -->

# 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. Seventy-nine 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.

![The cookbook's six groups, one small drawing each: On price, candles with a zone boxed on them; Order flow, buyers up and sellers down on every bar; Prediction markets, an odds line over the market it moves with; HUDs, a card of readings; Beyond the time axis, a profile docked on the price axis; Strategies, the trades marked on price with equity rising above them](/wrun/images/diagrams/cookbook-map.svg)

1. **On price**: marks, zones and tints drawn on the chart's own bars.
2. **Order flow**: buyers and sellers, open interest, liquidations and options flow, bar by bar.
3. **Prediction markets**: a Polymarket market's odds against the market they move with.
4. **HUDs**: one reading of the whole market, kept beside the candles.
5. **Beyond the time axis**: profiles, curves, chains and fund flows on a second axis.
6. **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](volume-spike.md) | 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](typed-inputs-tour.md) | 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](anchored-vwap.md) | 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](regime-filter.md) | 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](key-levels.md) | 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](zone-tracker.md) | Supply and demand zones drawn as boxes that switch off when price mitigates them | boxes with a `when` gate, ring-buffer windows |
| [Session map](session-map.md) | 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](volume-heat-hours.md) | 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](supply-demand-zones.md) | 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](trend-alignment.md) | 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](trend-candles.md) | 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](strike-matrix.md) | The live options chain by strike across the four nearest expiries, net gamma exposure or another lens (delta, vega, vanna, charm, open interest), 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_chain.cells` 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 plain label handles, the kit's `GammaCurve` for the flip and `OptionsChain` for the walls and max pain |
| [Session OI levels](session-oi-levels.md) | Where open interest was built and unwound in each day, drawn as one profile per day, each anchored inside its own span of time | `plot.levels` with `span: "time"`, a spans frame, a colour per row |

## Order flow

Who traded, who is positioned and who was forced out, from sided trades, open interest and liquidations, and where the options money went, from the US listed options flow of a stock's own options.

| Recipe | What it does | What it teaches |
| --- | --- | --- |
| [Aggregated CVD](aggregated-cvd.md) | 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](cvd-divergence.md) | 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](positioning-regimes.md) | 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 regime, `draw.card` with text slots |
| [Absorption](absorption.md) | 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, a `plot.spans` box a bar |
| [Liquidation bursts](liquidation-bursts.md) | Long and short liquidations in USD stacked in one column per bar in their own pane, a burst marked on price by a bubble sized and captioned by its USD size | the `liquidations` source by side, a z-score gate, a `plot.marks` bubble with a size law bound to a setting |
| [Book heat](book-heat.md) | 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 on the chart's one-ink ramp, a quantile scale |
| [Liquidation heat](liquidation-heat.md) | 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 on the chart's one-ink ramp, with a floor |
| [OI liquidation heat](liquidation-heat-oi.md) | 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](volume-footprint.md) | One footprint column per bar from the profile buckets, imbalances marked and stacked, the point of control per column | `volume_profile.cells`, `plot.footprint`, imbalance words |
| [TPO letters](tpo-letters.md) | 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](session-volume-profile.md) | A volume profile per session from the profile buckets, the value area shaded, each session boxed | `plot.profile` with `span: "session"`, `value_area_shade`, `background` |
| [Option prints](option-prints.md) | The underlying's option prints on its chain (a US stock's on OPRA, a CME future's, a coin's on its venue), filtered by premium, calls or puts, the side of the quote, days to expiry and moneyness, newest first in a table whose rows name their contracts, each print a mark on price | `option_prints.cells` holding the window's newest prints and each bar's largest (`newest` beside `overflow: "largest"`), `options_flow` of scope `prints` for the per-bar sums, the `present` mask, a `panel.table` with `markets` written by `fb_contract`, `plot.marks` |
| [Flow tape](flow-tape.md) | The underlying's option prints merged into orders (sweeps across venues, splits on one venue, blocks in one print, inferred) and tagged opening, volume over open interest and unusual against the chain summary, newest first | prints merged by contract, side and a time window, `option_contract_state.cells` on the live bar, tags as styled table cells |
| [Flow marks](flow-marks.md) | The underlying's large option prints as marks on price, the up colour bullish and the down colour bearish, sized by premium, over a column of each bar's bullish minus bearish premium | `option_prints.cells` cut to each bar's 24 largest at the floor and types settings with `history: "90d"`, `options_flow` of scope `prints` for the per-bar sums, `plot.marks` with a size unit bound to a setting, a ladder-coloured histogram |
| [Contract sides](contract-sides.md) | The underlying's option contracts by side of the quote (above the ask, at the ask, the mid, at the bid, below the bid, no side), calls beside puts over today or the last bars, with each bar's bullish minus bearish contracts as a column | `options_flow` sums by side of the quote kept in a ring of bars, `panel.bars` with a per-run title |
| [Strike footprint](strike-footprint.md) | The underlying's option flow strike by strike and bar by bar behind the candles: bullish net premium, the calls' or the puts' alone, or contracts, around each bar's close | `option_contract_flow.cells` folded onto `out.grid` rows placed at strike prices, `plot.heatmap` with a diverging scale, a strike step learnt from the listed strikes |
| [Premium tide](premium-tide.md) | The whole options market's net call and net put premium (every US listed underlying, the coin on every crypto venue, or CME's market) summed through the session (the regular session on a US stock, the whole trading day on CME), each print capped, with the net volume below; tides over every strike or the out-of-the-money ones and every expiry or the same-day ones, several at once as one net line each | `options_flow` market scope, a `param.multi` gating each tide's inputs through `when` and `when_bit`, a histogram in a named pane, a card |
| [Options market stats](options-market-stats.md) | The whole market's put/call ratios by contracts and by premium through the day, a table of the day for every underlying, equities, ETFs, indices and the same-day expiries, and a card that says which side leads | `options_flow` market scopes summed by trade date, a `panel.table` over a frame, breakdown rows gated by a `param.multi` |
| [Net flow](net-flow.md) | Net call premium and net put premium on the chart's underlying (bought at the ask minus sold at the bid) summed through each session as two lines, the whole market's on a toggle, a card with the session's lean | `options_flow` fields as scalar inputs with `missing: "nan"`, a `scope: "market"` input fetched only while a setting is on (`when`), sums restarting on `time.trade_date` |
| [Flow VWAP](flow-vwap.md) | The chart's price weighted by the options premium bought at the ask since the session or the week, a line on the candles with dotted 1σ and 2σ bands lightly shaded, the premium of the chart's own chain or of another root (QQQ on an NQ chart), a card that reads where the close sits in σ | `options_flow` inputs on the chain a `param.choice` names (`underlying: "@chain"` over its `style_values`), a 0DTE set fetched only while a setting is on (`when`), a weighted Welford mean and deviation restarting on `time.trade_date` or its week, two `fill`s |
| [Options volume](options-volume.md) | The contracts each bar traded as stacked columns, calls above zero and puts below, split by side or into bullish, neutral and bearish, a card with the put/call ratio | one `stack` of `bar` outputs, positives up and negatives down, two splits written by one setting |
| [Greek flow](greek-flow.md) | The share delta and the vega the tape traded, bought at the ask minus sold at the bid, summed through each session in two panes, the out-of-the-money contracts on a toggle | sided `options_flow` model sums, a named `pane` for the second line, `moneyness: "otm"` behind `when` |
| [NOPE](nope.md) | The session's option share delta as a percent of the stock's own volume, one line in the up colour above zero and the down colour below | `options_flow` beside the chart's `ohlcv.volume`, the session from `time.session` (the regular session on a US stock, the whole trading day on CME, by `market.zone()`), a `split` line |
| [Interval flow](interval-flow.md) | The contracts one bar's interval traded, ranked by premium or volume in a table with ask and bid shares, fill, IV and share of the day, a histogram of every bar's busy contracts | `option_contract_flow.cells` read tuple by tuple, a session volume table by contract, `hasBit` for the VWAP and IV, a styled `panel.table` |
| [Premium by strike](premium-by-strike.md) | Net premium strike by strike as a heat map behind the candles on the chain's strike spacing, the session's net by strike docked on the price axis, partial bars dotted | `option_contract_flow.cells` with `strike_window_pct`, `out.grid` and `plot.heatmap` with `center: 0`, `plot.levels` with per-row colours, `isPartial` |

## Prediction markets

A Polymarket market's odds set against the market they move with.

| Recipe | What it does | What it teaches |
| --- | --- | --- |
| [Odds vs price](odds-vs-price.md) | 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-rung ladder on a histogram |

## HUDs

One card pinned to the price pane, in the chart's default 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](market-hud.md) | 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 | one `render.hud` card in the default look, a headline pill coloured by a ladder output, a rings tile, data-only outputs read by the tiles |
| [Decision board](decision-board.md) | A headline written from six factors ("Buyers Ahead, 3 to 1"), the net score as a sparkline and each factor's reading in a row | 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](order-flow-hud.md) | Who is pushing price in a word, each bar's taker buy share as a sparkline, the window's buy share, the net taker delta in dollars and the liquidations on each side | side-split `trades` and `liquidations`, rolling windows kept as rings, a value tile with this bar's delta beside it |
| [Order book HUD](order-book-hud.md) | The heavier side of the book in a word, the bid share within 1% of the mid on a meter, the dollars resting by distance and the biggest walls, dotted on price | `book.cells` read in two passes, depth bands summed by distance, line handles set on the live bar |
| [Session HUD](session-hud.md) | 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 | `param.session` windows read with `inSession`, a daily `candles` stream, a countdown written into a string slot |
| [Greek exposure](greek-exposure.md) | The dealers' exposure one greek at a time (gamma, delta, vanna, charm, vega, IV times open interest, open interest) by strike on the price axis and by expiry under the chart, over every expiry, the same day, a week, a month, the nearest N or stacked by days to go, read in one plain line on a card | `options_chain.cells` on the live bar, the kit's `Greeks` for vanna and charm and `GammaCurve` for the regime and the flip, three `plot.levels` shapes and a `panel.bars` |
| [Risk reversal skew](skew.md) | One expiry's risk reversal (the call's IV minus the put's) at nine deltas in bars under the chart, the 25 and 10 delta numbers, the four wing IVs and the smile's asymmetry, with puts rich, calls rich or flat as the card's headline | `options_chain.cells` on the live bar, the kit's `IvTerm` (`nearest`, `deltaIv`), a `panel.bars` with a per-run title |
| [Expected move](expected-move.md) | The expected move by a horizon from 1 to 90 days or to the earnings expiry on a US stock or ETF (0.85 of the at-the-money straddle) beside the 1σ range, drawn as two pairs of rails from the prior session's close (today's 00:00 UTC open on crypto), each tagged on the price axis, with the at-the-money IV at seven constant maturities and the next six expiries' expected moves | the `numbers` and `vol_term` book folds read through `BookStamp`, `OptionNumbers`, `ExpectedMoves.loadNumbers` and `VolTerm`, timed from the book's priced instant, `time.trade_date` for the prior close, guide outputs with `axis_label` and `axis_look` for the rails |
| [Volatility context](vol-context.md) | The term structure (contango, flat or backwardation from the 90-day over the 30-day at-the-money IV), the 25 delta skew over the 30-day IV (puts or calls rich) with the risk reversal, the 30-day IV against the realized volatility of the daily candles, and the front expiry's expected move, three verdicts in one line on a card | `options_chain.cells` on the live bar, the kit's `ExpectedMoves` (constant maturities, the expected move) and `IvTerm` (25 delta wings), a daily `candles` stream in a `CandleList` |
| [Contract odds](contract-odds.md) | One contract of the chart's chain, named by its settings and held to expiry: the odds of profit, the breakeven, the most it can make and lose and Kelly's fractions | `options_chain.cells` on the live bar, the kit's `Greeks` and `normCdf`, `param.price` and `param.time` naming the contract |
| [Options stats](options-stats.md) | Today's option activity of the underlying, calls against puts: who leads by the put/call ratio, contracts and premium with their ratios, the net premium, the bullish share and the open interest with its change | `options_flow` fields over every expiry and the same-day ones summed over today's bars, `option_contract_state.cells` on the live bar, a headline pill |
| [Option stance](option-stance.md) | Where the chart's underlying's options stand (the IV rank and percentile, dealer gamma against the gamma flip, the walls, the put/call ratios, the skew, the front move, the next earnings date) and whether selling premium, selling vega, directional, long-dated and cheap option buying run with it, against it or neither | scalar `option_daily` inputs landing once per session, the kit's `DayHistory`, `market.earnings_next_ms()`, pill tiles written by the rules |
| [Options sentiment gauge](sentiment-gauge.md) | Fear to greed from 0 to 100 over the underlying's own options and price: six inputs scored by their percentile against their own history and blended once four score, a step line under the chart with guides at the band edges, and a dial | `option_daily` per session, a daily `candles` stream for momentum, one `DayHistory` per input, `tile.gauge` |
| [Day type](day-type.md) | The session's state from its 10-minute options statistics (pinned, trending, volatile or unsettled) and the counted odds that it holds 30 minutes to 2 hours on, the typical move, the forward range boxed ahead of the live bar and the levels on price | `option_stats_10m` samples on the bars holding them, outcomes counted per state and horizon, a box handle, a state ribbon |
| [Estimated dealer positioning](dealer-positioning.md) | An estimate of option dealers' book every ten minutes: the gamma regime and its hedge per 1% move, the charm drift to the close, the vanna hedge, the delta today's signed flow left behind and net gamma against 10 to 30 minutes ago | `option_stats_10m` keyed by 10-minute slot in a `DayHistory`, `options_flow` at the ask and the bid summed per session, two named panes |
| [Spot exposures](spot-exposures.md) | The dealers' exposure bar by bar: a headline over every expiry from the 10-minute chain statistics (open interest), or from the strike rows of the expiries still trading and 7 or fewer trade days out (Greek exposure's week) where the chart has none; the headline's net gamma, delta or vega exposure as a line, the week's gamma flip and walls as step lines on price, a heat map of the week's exposure by strike behind the candles (the level or its change), and the gamma regime on a card with the week's net gamma in its rows | `option_stats_10m` for the headline, `option_strikes.cells` as the strike kit fold with its curve row (`fold: "kit"`, `levels`, `curve`: the server measures each bar's week), the kit's `OptionStrikes.loadLevels`, `NodeBoard` and `dealerRegime`, an `out.grid` heat map, a split line |
| [OI changes](oi-changes.md) | Where open interest built and unwound since its prior observation: a board of the change by strike and expiry on the price axis (or the change in percent, the open interest, the day's volume or the net volume), the largest increases and decreases in a table, the net change on a card | `option_contract_state.cells` on the live bar, its `present` bits, three `plot.matrix` boards, a `panel.table` |
| [Top contracts](top-contracts.md) | The most active contracts by the day's volume, open interest, premium or gain in a table, the three most traded and the three most held strikes drawn across the chart, the top contract on a card | `option_contract_state.cells` on the live bar, a `panel.table` of styled cells, line and label handles |
| [Options sentiment](options-sentiment.md) | One score from the volume-weighted strike offset of the day's volume and the 25 delta call IV minus put IV at 30 days, bullish at +20 and bearish at -20 on a meter, the IV gap as a line and the volume-weighted strike across the chart | `option_contract_state.cells` on the live bar, `option_surface.cells` on every bar (crypto, CME and US stock charts), the kit's `totalVarianceIv` |

## 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](volume-profile-value-area.md) | 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_profile.cells` as a block, `plot.levels` docked on the axis, `panel.heatmap` |
| [Open Interest Profile](open-interest-profile.md) | The current day, week or month's open interest change by price docked on the right as a two-sided column, the OI POC and value area tagged on the axis side, the period's bounds and its net change, the same rows on every chart finer than a week | `oi_candles` and `volume_profile_candles` streams a month deep, the forming hour from the chart's own bars, `plot.levels` with `baseline: "center"` and `tag_place: "axis"` |
| [Options dashboard](options-dashboard.md) | Nine tiles over the chart's own option book (net GEX, the flip, the dealer regime, max pain, the put/call ratio, net VEX and net DEX over every live expiry, today's move in 1σ moves, the front expiry's 25-delta risk reversal), the gamma exposure curve over hypothetical spots with a signed fill and callouts, and a rolling CVD pane | one `options_chain` input naming three book folds (`numbers`, `strike_profile`, `vol_term`) read on the live bar through `BookStamp`, `OptionNumbers`, `StrikeProfile` and `VolTerm`, `panel.tiles` and `panel.line` over frames with markers and a caption, a named pane |
| [Spot ETF flow](etf-flows.md) | 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_flow.flow_usd` landing once per day, lower-pane box handles, `out.inset`, `render.bgcolor` |
| [Liquidation map](liquidation-map.md) | 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 card | open interest split by taker side into leverage tiers, `plot.levels` with `baseline: "center"`, line and label handles |
| [Options odds cloud](options-odds-cloud.md) | 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 card | `options_chain.cells` turned into odds per price row, per-row colours and a `gradient` on `plot.levels`, declared `draw.line` and plain `draw.label` drawings |
| [Who is trading](whos-trading.md) | The window's dollar volume shared out by trade size as a donut, bought against sold per size as bars with the verdict as the caption, a card with the whales' buy share | `trade_volume_by_size.cells` over a rolling window, `panel.pie`, `panel.bars` with a per-run caption |
| [Rotation map](rotation-map.md) | Eight coins placed by strength against BTC and its momentum on a four-quadrant map with trails, the leader's label carrying its move against BTC, and a 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 |
| [Correlation matrix](correlation-matrix.md) | How the chart's market moved with eight others as a market by market heatmap with an average row, a 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](venue-share.md) | 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 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.interval_sec()` |
| [Volatility surface](iv-surface.md) | Implied volatility by strike and expiry (the six nearest expiries, the 21 strikes nearest spot) as a heatmap with the row nearest the chart's price marked and an ATM summary row, the term structure as tiles, a card | the `surface` and `vol_term` book folds read through `SurfaceMatrix` and `VolTerm`, `panel.heatmap` with `row_title`, a `summary` row and a `highlight` row, `panel.tiles`, a `render.legend` entry |
| [Volatility character](vol-character.md) | Realized volatility from the chart's own daily candles in one pane the View setting picks (historical volatility by window, the cone, the return structure, the seasonality or the character readings), a card naming the character with its half-life | one `candles` stream at `1d`, prefix sums, five frames of which one is written, `panel.line` on time and number axes, `panel.bars`, `panel.table`, `tile.pill` and `tile.meter` |
| [Strike breakdown](strike-breakdown.md) | The underlying's options by strike, one chart per upcoming expiry, calls up and puts down: open interest, its change, contracts, premium or net premium today, totals in each chart's caption | `option_contract_state.cells` and `option_contract_flow.cells` summed by contract over today, three `panel.bars` on a number axis of strikes |
| [Market share](market-share.md) | Each US options exchange's share of the market's contracts, today or over the newest sessions, nine exchanges by name (five picked by default) and the rest as Other, as a donut and a table, with the leader in a card | `options_flow` venue scope over the market scope's totals, nine exchanges gated by a `param.multi`, ten reads within a Plus chart's data budget, a ring of sessions, `panel.pie` and `panel.table` |
| [Premium by expiry](premium-by-expiry.md) | The session's bullish minus bearish option premium per expiry as bars under the chart, or the two sides apart, labelled by date and days to go, a note at the top of the chart when a bar's contracts were cut down | `option_strike_flow.cells` summed per expiry, the kit's `fbExpiryLabel` for the dates, a `panel.bars` with a per-run caption |
| [Options at price](options-at-price.md) | The options a stock traded over 1 to 30 sessions by the price it stood at, docked on the price axis as bullish, neutral and bearish (or calls and puts), in contracts or premium | `options_flow` rows kept in a ring at each bar's typical price, a stacked `plot.levels` with `series` and a `poc_price` |
| [IV rank](iv-rank.md) | Where the 30-day implied volatility sits against its past year: the IV rank and the IV percentile as step lines with guides at the bands, a card with the window's low, high and sessions, and a clear wait while the history is short | `option_daily` with `missing: "nan"`, the kit's `DayHistory` (`rank`, `percentile`, `span`), step lines with guide outputs at the bands |
| [Variance risk premium](vrp.md) | The 30-day IV against the realized volatility of the chart's daily closes: the spread now, and the premium completed 21 sessions later (never drawn before it is known) with its rank's sell and stand-down zones read on a card | `option_daily` beside a daily `candles` stream, a forward-aligned history in a second `DayHistory`, spread columns coloured by sign |
| [Skew history](skew-history.md) | The 30-day 25 delta risk reversal per session with its percentile and z-score, one expiry's risk reversal per bar from the option surface with partial bars on their own dotted line, that expiry's put tail with its z-score in five steps, the candles tinted where the risk reversal moves against spot, and the term structure now against its median and quartiles | `option_daily` and `option_surface` (crypto, CME and US stock charts) cells read through `hasBit` and `isPartial`, `DayHistory.quantile`, a `Zscore` over solid bars, a buffer of past bars behind a `render.barcolor` gate, `panel.line` over category maturities |
| [Volatility regime](vol-regime.md) | The 30-day IV's z-score against its earlier sessions as columns, the candles of stressed bars (the IV at its 80th percentile or above) dimmed, and the vol of vol with its own percentile | `DayHistory.zscore` and `percentile`, an exponentially weighted deviation, `render.barcolor` behind a gate |
| [Exposure history](exposure-history.md) | Dealers' net gamma, delta, vega, charm or vanna per session as columns, the walls, the gamma flip and max pain on price as steps, with the change from the prior session and the percentile | eleven `option_daily` fields, a lens `param.choice`, sign-coloured columns, a value tile with its change |
| [Options history](options-history.md) | Options volume, open interest or premium per session, the volume against its 30-session average, and a table of the newest sessions with the put/call ratio, the volume against its average, the open interest change and the IV | one `DayHistory` per field, stacked `bar` outputs, a `panel.table` written on the live bar |
| [Seasonality grid](seasonality-grid.md) | 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 card | two `candles` streams of the chart's own market (26 weeks of 1h, 12 years of 1d) picked by `chart.interval_sec()`, one `panel.heatmap` with a `highlight` and an Avg `summary` row, a signed scale |
| [Depth curve](depth-curve.md) | The order book as two cumulative staircases meeting at the mid, the biggest walls called out, the heavier side in the caption, a 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](yield-curve.md) | The Treasury curve today against a week and a month ago over a tenor axis, 2Y and 10Y callouts, the 2s10s spread on a card | nine `economic.value` pins, prints kept in a ring, days turned into bars with `chart.interval_sec()`, `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](strategy-ma-cross.md) | 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](strategy-risk-reversion.md) | 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.equity()`, a protective exit re-armed each bar, rails as line handles |

## How to use a recipe

![The loop every recipe shares: open the Editor, pick the recipe's card from Templates, press Run, change a setting and it reruns, read a value at the Console prompt, and Publish when it is yours; in the middle, the three verbs every recipe teaches: load a series, compute a number, draw it](/wrun/images/diagrams/cookbook-loop.svg)

- **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.

1. Open the editor: the chart toolbar's **Editor** button, or the **Build** icon in the **Indicators** dialog.
2. 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-ts` line on top. For any other recipe, press **New indicator** in the Explorer, pick **Blank indicator** (a tab holding the `//@lang=wrun-ts` line alone), and paste the recipe's indicator block under that line.
3. 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.
4. 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 `min` and `max` for `param(...)` and `param.int`, a toggle for `param.bool`, a menu for `param.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, as theme words such as `theme.up` or as hex strings: edit them and Run again.
5. Read a value at the editor's Console prompt, which reads the last run without a new build (below).
6. Publish it from the editor to add it to other charts, share it, or put an alert on it ([Publishing](../functions/publishing.md), [Alerts](../functions/alerts.md)). 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](volume-spike.md)'s `z` as the output:

```text
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 way
```

Most recipes read the chart's own market and interval ([Execution model](../core-concepts/execution-model.md)). 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](../core-concepts/multi-timeframe.md#the-interval-pin-a-real-coarser-feed)), or another market at the chart's interval ([Odds vs price](odds-vs-price.md)). A market pin on any other source is refused by name, which is why [Aggregated CVD](aggregated-cvd.md) reads the chart's own venue. Stocks, forex and gold pin the same way ([Multi-source](../core-concepts/multi-source.md#stocks-forex-and-gold)). On CME markets an indicator runs in the browser once you have accepted the CME market data terms, and the results stay on the chart.

## 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 a `StaticArray<f64>` ring buffer, which `History` packages as a class ([Stats, history and lists](../functions/stats-history-lists.md#history-xn-from-pine)).
- **Decisions are numbers.** A condition the chart should act on is a data-only `none` output written as `1` or `0`; the declarations turn it into a look through `shape_where`, `color_by`, or a box's `when` gate.
- **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](../functions/alerts.md)).
