Appearance
report
How do you hand fifty coins' scores to the Strategy Tester, the terminal's backtest report, or to the Screener, which runs a script across many symbols, when a plot holds one value a bar? Write them with report.column, one value per member per bar, or a matrix with report.matrix. They go into a table the run returns to those tools, which show it beside the chart. A script can't read any of it back.
ameno
indicator("Momentum ranks")
array<string> m = request.universe(20)
array<float> mom = request.each(m, ta.roc(close, 20))
// One column of the table: each member's rank on each bar.
report.column("mom rank", m, cs.rank(mom))
report.matrix("ratio mom", m, request.pairs(m, ta.roc(close, 20)))
plot(array.size(m), "Members")Both calls write only on a run that asks for a report: the Strategy Tester's analysis, run when its report opens, and the Screener's scan of a script that writes one. On any other run, a chart included, they do nothing and their arguments don't run, so they cost nothing. A var changed inside their arguments therefore changes only on a run that asks, so keep anything a plot or an order reads out of them. Both return na. See when it writes.
report.column
AmenoScript only
ameno
report.column(title, m, values) → voidWrites one column of the run's table: a row per bar and member, holding values lined up with m.
A member gets a row on each bar that names it, and a column that starts late reads na before it. A second write to the same cell replaces the first. A bool writes 1 or 0, and na an empty cell. When values and m differ in length, the run warns once for that column and keeps the cells that line up.
| Parameter | Description |
|---|---|
titleseries string | The column's name. |
marray<string> | The members, an array<string> of symbols. |
valuesarray<float> | One float, int or bool per member, in the order of m. |
See column.
report.matrix
AmenoScript only
ameno
report.matrix(name, m, x) → voidHands on a matrix with a row and a column per member, keeping a frame each bar the matrix changes.
A frame is the bar's time, the members and the cells, as they stood at the bar's end. A write equal to the last one costs nothing, so writing every bar is fine. A name keeps up to 1,048,576 cells of frames, and past that it keeps every second change, then every fourth, with the first and the last always kept. A matrix of any other shape makes the run warn once and changes nothing.
| Parameter | Description |
|---|---|
nameseries string | The matrix's name. |
marray<string> | The members, an array<string> of symbols, in the order of x's rows and columns. |
xmatrix<float> | The matrix, such as request.pairs' result. |
See matrix.