Release notes

View as MarkdownOpen the editor

What is new for people who write wrun indicators. Newest first.

Each entry is one version of the indicator kit the editor builds with, written 0.<N> and dated by the day it was published. A later fix to that version shows as a dated line under its entry. The notes start at 0.124: what came before is told on the pages it changed. Versions and contracts explains what a new version can and cannot change.

0.127

An indicator holds up to 1,024 settings.

Nothing to change. A script that built before builds exactly as before.

1,024 settings

An indicator can declare up to 1,024 settings after expansion (128 before), so a script ported from Pine keeps all its inputs. The build still refuses the declaration that crosses the cap. See Picks, lanes, the cap.

0.126

Panels that sit in a grid, and tables and tiles that hold more.

Nothing to change. A script that uses none of the new words builds exactly as before.

Panels in a grid

Panels below the chart can sit in a grid. Call panel.layout({ columns, areas }) to name each panel's cells: up to 8 weighted columns and 8 rows, "." for an empty cell. See Panel layout.

Tables and tiles take more words

Tables and tiles hold more text and take more options. A table cell holds 256 characters (64 before).

What you can doWrite
Hide a table's header.header: false
Wrap a series' column in a table.wrap: true
Draw a table on the chart.place: "chart"
Give tiles the filled accent.accent: "fill"
Lay tiles out in up to 12 columns.columns
Put captions over runs of tile columns.groups

What changes for a script that uses the new words

The new words ride one new sheet table, panel_layout, that an older chart skips. Each panel keeps a value an older chart draws.

0.125

Safer builds, stronger backtests and more ways to draw.

Nothing to change. Every script you already have builds exactly as before.

Seven new build warnings

The build names seven mistakes that run fine but compute wrong numbers. A warning never blocks a build: a script that built before still builds and runs, and may now show a warning.

MistakeWarning
A series class is updated only inside a branch, so it skips the other bars.WRUN_DECL_UPDATE_IN_BRANCH
A setting is read at the top of the file, where it reads NaN.WRUN_DECL_SETTING_BEFORE_START
One series instance is updated twice a bar, so it moves twice.WRUN_DECL_UPDATE_SHARED
A time pattern uses a letter the formatter does not replace, such as hh or a. It prints as typed.WRUN_DECL_TIME_PATTERN_UNKNOWN
A choice setting is compared with a bare index.WRUN_DECL_CHOICE_NUMBER
new Clock() names no zone, so it reads hours in UTC. Name the zone, or write new Clock("UTC").WRUN_DECL_CLOCK_NO_ZONE
ago(n) reaches past the size of a History, which is always NaN.WRUN_DECL_HISTORY_AGO_PAST_SIZE

The one you will meet first

Compare a choice setting with the generated name of the option, pc_<setting>_<label>, as the built-in templates now do.

text
if (p_mode() == 1)                     // warns
if (p_mode() == pc_mode_exponential)   // no warning

To keep a line on purpose, say why in a comment: // om-allow update-in-branch: <reason> or // om-allow update-shared: <reason>.

Stronger backtests

A strategy can read its own trades, place more kinds of orders and switch on six backtest settings. Each setting is off until you set it, so the numbers of a strategy you already published do not move.

When a market order fills. By default it fills at the open of the next bar. With processOrdersOnClose it fills at the close of the bar that gave the signal.signal barfills at the next opendefaultsignal barfills at its closeprocessOrdersOnClose: true

Six settings on the strategy declaration

SettingWhat it does
processOrdersOnCloseA market order placed on a confirmed bar fills at that bar's close, not at the next open.
bracketsOnEntryBarAn exit's stop and target work from the entry fill, on the entry's own bar.
commissionPerContractA fee for each unit of every fill.
commissionPerOrderA fee once for each order fill.
allowEntryInOnly long entries, or only short entries, open a position.
maxDrawdownPercentAt this fall from peak equity the strategy cancels its orders, closes the position and rejects new entries.

New orders and trade reads

What you can doCall
Place a stop-limit entry.sendStopLimit()
Close part of a position.strategy.closeQty strategy.closePercent
Set exits in ticks of the market.profitTicks lossTicks trailTicks strategy.tickSize()
Read the prices, times, bars, size, profit, fees, run-up and drawdown of each trade.strategy.closedTrades strategy.openTrades
Label the next order in the Strategy Tester.comment()

A long backtest no longer stops at 10000 closed trades. The trade list keeps the newest 10000, an older trade is trimmed, and every total still counts it. See Limits.

More ways to draw

Four new drawing options and one label style. Every picture is a real chart.

Before
Violet boxes drawn over the candles, which tints the candles
behind_candles: true
The same boxes under the candles, every candle fully visible

Under the candles. behind_candles puts a range, a box, the box handles or a declared box under the candles.

Before
A line on the closes, broken where the script writes no value
join_gaps: true
The same line, unbroken across the bars with no value

Across empty bars. join_gaps joins a line across bars with no value.

show_last: 20
A line on the closes of the newest 20 candles only
Only the last bars. show_last draws an output (not an inset) on its last bars only.
Labels with a pointer
Four labels around one candle, each with a small tip that touches its price
A tip that touches the price. Drawing labels take the four pointer styles.

displacement_bars shifts a background or bar tint.

New building blocks

Nine kit classes for patterns that used to need hand-written code, and a bar that knows more about itself.

ClassWhat it is for
SessionsSeveral time windows in one object.
PoolObjects that come and go.
HandlePoolKeep the newest N drawings.
HistoryOfThe past values of an object.
FixedMapValues keyed by a number.
MatrixRows and columns of numbers.
Htf HtfHlcAny ta class on a higher timeframe.
SteppedThe stepping alone, for values you commit yourself.

Also new: the approximate comparisons (approxEq and its siblings, for two computed prices that == would call different), format on the text kit, and copyFrom on the stateful TA classes.

A bar knows more about itself

QuestionCall
Its number.bar.index()
Whether it has closed.bar.isClosed()
When it closes.bar.closeTime()
Whether it is the last bar of the regular session, or of the day.bar.isLastRegularBar() bar.isLastBarOfDay()

The close time and the two last-bar flags read the new time fields bar_close_sec and session_last.

Log lines and dividends

Write lines to the editor's Console, and read the cash dividends of a US company.

What is newWord
Log lines. Write a line with up to four numbers to the editor's Console. Only in the editor: a published indicator never logs.log.info log.warning log.error
Company data. A dividends input reads a US company's cash dividends. ticker names the company, so it works beside any chart. The next dividend's date and amount are two market facts. Both are filled when the indicator runs in your browser on the chart.dividends

What changes for a script that uses the new things

Your scriptWhat changes
Calls bar.index(), bar.isClosed(), a log line or a new strategy call.It builds on the new runtime version, wrun-7.
Reads bar.closeTime() or a last-bar flag.It adds the time input to its sheet.
Every other script.It builds exactly as before.

Try it

text
strategy({ processOrdersOnClose: true, maxDrawdownPercent: 20 });
log.info("closed trades {0}", f64(strategy.closedTrades.count()));

0.124

Option flow filters you can change from the settings dialog.

Nothing to change. A literal word such as dte: "0dte" reads as before, and nothing you already published changes.

Filters from a setting

An options_flow input can take its expiry and moneyness filters from a setting. Write dte: "@<setting>" or moneyness: "@<setting>" over a param.choice whose picks are the filter's own words (its style_values, else its labels). The chart reads the picked word on every run, so a change in the settings dialog fetches again with no rebuild, the same way expiries already works on option_strike_flow. Scope "venue" still takes "all" alone. See Knobs from a setting.

Two mistakes caught earlier

Two mistakes now stop before the first run.

MistakeWhere it stops
A setting is named like one of the filter's own words. dte: "@week" over a setting named week would read as the word and never as the setting, so the build asks you to rename the setting. This holds for every filter that takes a word from a setting.At build
The default of a bound choice is none of its options. Before, the first run failed instead.At the sheet check

Try it

text
param.choice("dte", ["Every expiry", "0DTE only", "This week"], "Every expiry", { label: "Expiries", style_values: ["all", "0dte", "week"] });
input("calls", options_flow.call_prem_total, { dte: "@dte", missing: "nan" });