Cookbook

View as MarkdownOpen the editor

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.On pricemarks, zones and tintson the chart's own barsOrder flowwho traded, who holds,who was forced outPrediction marketsodds set against themarket they move withHUDsone reading of the market,kept beside the candlesBeyond the time axisprofiles, curves, chainsand fund flowsStrategiesorders in the file, replayedby the Strategy Tester62%Basis64,120+1.2%RSI
  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.

RecipeWhat it doesWhat it teaches
Volume spike detectorFlags bars whose volume blows past its trailing average, scored as a z-scoreone input, a TA class, a gated mark
Typed inputs tourEvery kind of setting but text on one small channel indicator, with two pages, presets, a hover card, a HUD card and legend entriesfourteen of the fifteen setting kinds, the layout words and the "@name" bindings, the block kit
Anchored VWAPWeekly and daily VWAP that reset on UTC session boundaries, with a shaded band and a stretch readoutbar.time(), state that resets, a box as a channel
Regime filterA no-repaint 4h trend gate that tints a line by regime and marks entries only when the higher timeframe agreeshigher timeframes without lookahead, color_by, shape_where
Key levelsPrior-day and prior-week highs and lows plus the day open, as horizontal levels on any intervalsegments as levels, a param as a gate
Zone trackerSupply and demand zones drawn as boxes that switch off when price mitigates themboxes with a when gate, ring-buffer windows
Session mapAsia, London and New York each boxed around the session's high and low with a tag, the live session growing bar by barbox and label handles keyed by the UTC clock, a ring of ids reused by day, one text slot for many tags
Volume heat hoursEvery clock hour boxed over its range and tinted by its volume against the last day's average hour, hot hours tagged with their multiplefolding hours from the chart's own bars, a rolling baseline, opacity as the reading
Supply and demand zonesA 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 pricePivotHigh and PivotLow, zones as box handles that stop extending, right-anchored price tags
Trend alignmentThe chart's EMA beside the 1h and 4h EMAs as steps, the background tinted while all three agree, a three-cell strip reading the stateclosed 1h and 4h candles streams, render.bgcolor gated by a data-only output, an anchored strip
Trend candlesThe 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 heldrender.barcolor, shape outputs for events, a counter in an anchored label
Strike matrixThe 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 levelsoptions_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 levelsWhere open interest was built and unwound in each day, drawn as one profile per day, each anchored inside its own span of timeplot.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.

RecipeWhat it doesWhat it teaches
Aggregated CVDAggressive buying minus selling on the chart's market, accumulated, with volatility bands and sign coloringthe trades source, accumulators, missing policies, which inputs the chart pins to another market
CVD divergenceCumulative volume delta in its own pane, price swings dotted on it, and the evidence drawn when price and CVD disagree at two swingsside-split trades.volume, a displaced shape output, line and polyline handles across two panes
Positioning regimesEach 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 handsoi.close reading NaN, one histogram output per regime, draw.card with text slots
AbsorptionBars where heavy one-sided volume failed to move price, lit in the delta pane, boxed on the chart and dotted on the absorbed sidea ratio against a rolling norm, two histograms sharing a pane, sign palettes, a plot.spans box a bar
Liquidation burstsLong 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 sizethe liquidations source by side, a z-score gate, a plot.marks bubble with a size law bound to a setting
Book heatThe order book painted as a heatmap behind the candles, resting size per level, the scale read off the runbook.cells, plot.heatmap over cells on the chart's one-ink ramp, a quantile scale
Liquidation heatEstimated liquidation levels as a grid of 64 rows around the close, hot rows lit, rewritten every barout.grid, plot.heatmap over a grid on the chart's one-ink ramp, with a floor
OI liquidation heatThe 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 throughoi.close and side-split trades.volume read as positions, out.grid and plot.heatmap with a dollar tooltip, data-only outputs for alerts
Volume footprintOne footprint column per bar from the profile buckets, imbalances marked and stacked, the point of control per columnvolume_profile.cells, plot.footprint, imbalance words
TPO lettersThirty-minute letters per day on the chart's own candles, the initial balance bracketed, single prints litplot.tpo, the letter interval rule, initial_balance
Session volume profileA volume profile per session from the profile buckets, the value area shaded, each session boxedplot.profile with span: "session", value_area_shade, background
Option printsThe 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 priceoption_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 tapeThe 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 firstprints merged by contract, side and a time window, option_contract_state.cells on the live bar, tags as styled table cells
Flow marksThe 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 premiumoption_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 sidesThe 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 columnoptions_flow sums by side of the quote kept in a ring of bars, panel.bars with a per-run title
Strike footprintThe 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 closeoption_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 tideThe 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 eachoptions_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 statsThe 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 leadsoptions_flow market scopes summed by trade date, a panel.table over a frame, breakdown rows gated by a param.multi
Net flowNet 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 leanoptions_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 VWAPThe 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 fills
Options volumeThe 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 ratioone stack of bar outputs, positives up and negatives down, two splits written by one setting
Greek flowThe 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 togglesided options_flow model sums, a named pane for the second line, moneyness: "otm" behind when
NOPEThe 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 belowoptions_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 flowThe 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 contractsoption_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 strikeNet 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 dottedoption_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.

RecipeWhat it doesWhat it teaches
Odds vs priceA 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 carda 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.

RecipeWhat it doesWhat it teaches
Market HUDThe 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 sparklineone 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 boardA headline written from six factors ("Buyers Ahead, 3 to 1"), the net score as a sparkline and each factor's reading in a roweach factor as a rule with its thresholds as settings, counts as data-only outputs, a headline written into a string slot
Order flow HUDWho 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 sideside-split trades and liquidations, rolling windows kept as rings, a value tile with this bar's delta beside it
Order book HUDThe 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 pricebook.cells read in two passes, depth bands summed by distance, line handles set on the live bar
Session HUDThe 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 lowparam.session windows read with inSession, a daily candles stream, a countdown written into a string slot
Greek exposureThe 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 cardoptions_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 skewOne 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 headlineoptions_chain.cells on the live bar, the kit's IvTerm (nearest, deltaIv), a panel.bars with a per-run title
Expected moveThe 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 movesthe 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 contextThe 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 cardoptions_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 oddsOne 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 fractionsoptions_chain.cells on the live bar, the kit's Greeks and normCdf, param.price and param.time naming the contract
Options statsToday'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 changeoptions_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 stanceWhere 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 neitherscalar option_daily inputs landing once per session, the kit's DayHistory, market.earnings_next_ms(), pill tiles written by the rules
Options sentiment gaugeFear 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 dialoption_daily per session, a daily candles stream for momentum, one DayHistory per input, tile.gauge
Day typeThe 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 priceoption_stats_10m samples on the bars holding them, outcomes counted per state and horizon, a box handle, a state ribbon
Estimated dealer positioningAn 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 agooption_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 exposuresThe 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 rowsoption_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 changesWhere 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 cardoption_contract_state.cells on the live bar, its present bits, three plot.matrix boards, a panel.table
Top contractsThe 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 cardoption_contract_state.cells on the live bar, a panel.table of styled cells, line and label handles
Options sentimentOne 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 chartoption_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.

RecipeWhat it doesWhat it teaches
Volume profile and value areaThe 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 chartvolume_profile.cells as a block, plot.levels docked on the axis, panel.heatmap
Open Interest ProfileThe 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 weekoi_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 dashboardNine 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 paneone 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 flowThe 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 cardetf_flow.flow_usd landing once per day, lower-pane box handles, out.inset, render.bgcolor
Liquidation mapAn 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 cardopen interest split by taker side into leverage tiers, plot.levels with baseline: "center", line and label handles
Options odds cloudWhere 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 cardoptions_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 tradingThe 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 sharetrade_volume_by_size.cells over a rolling window, panel.pie, panel.bars with a per-run caption
Rotation mapEight 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 cardnine hourly candles streams on Binance Futures smoothed in days, panel.scatter with guides, quadrants and trails, param.color inks written into the frame
Correlation matrixHow 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 marketseight 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 shareEach 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 premiumpinned close and volume on four venues, panel.pie, a styled panel.table, param.text and param.color settings, chart.interval_sec()
Volatility surfaceImplied 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 cardthe 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 characterRealized 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-lifeone 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 breakdownThe 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 captionoption_contract_state.cells and option_contract_flow.cells summed by contract over today, three panel.bars on a number axis of strikes
Market shareEach 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 cardoptions_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 expiryThe 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 downoption_strike_flow.cells summed per expiry, the kit's fbExpiryLabel for the dates, a panel.bars with a per-run caption
Options at priceThe 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 premiumoptions_flow rows kept in a ring at each bar's typical price, a stacked plot.levels with series and a poc_price
IV rankWhere 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 shortoption_daily with missing: "nan", the kit's DayHistory (rank, percentile, span), step lines with guide outputs at the bands
Variance risk premiumThe 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 cardoption_daily beside a daily candles stream, a forward-aligned history in a second DayHistory, spread columns coloured by sign
Skew historyThe 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 quartilesoption_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 regimeThe 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 percentileDayHistory.zscore and percentile, an exponentially weighted deviation, render.barcolor behind a gate
Exposure historyDealers' 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 percentileeleven option_daily fields, a lens param.choice, sign-coloured columns, a value tile with its change
Options historyOptions 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 IVone DayHistory per field, stacked bar outputs, a panel.table written on the live bar
Seasonality gridA 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 cardtwo 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 curveThe 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 spreadbook.cells summed outward from the mid, panel.line step series with fills, markers with an exact y, a caption
Yield curveThe Treasury curve today against a week and a month ago over a tenor axis, 2Y and 10Y callouts, the 2s10s spread on a cardnine 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.

RecipeWhat it doesWhat it teaches
Moving-average crossLong when the fast average crosses above the slow one, flat when it crosses back under, with a tinted ribbon and a mark on each crossstrategy(...) in the source, orders in onBar(), a range ribbon
Risk-sized reversionBuys the dip as RSI leaves oversold, protects it with an ATR-sized stop and target, leaves on recovery; each trade's rails drawn on pricean 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.EditorTemplatesthe recipe's cardRunPublish20-+settingsa change reruns it> last 5 zConsole promptload a series,compute a number,draw it
  • 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, 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:

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). 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 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).
  • 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).