RealTest User Guide
RealTest User Guide

 

 

Navigation: Realtest Script Language >

Output Format Specification

 

 

 

 

Several of the Script Sections in RealTest serve to define items which are both calculated and displayed.

These sections include: Charts, Graphs, Results, Trades and Scan.

In each of these sections, the format in which to display the value of the calculated formula can be optionally specified by including a special kind of comment within the formula definition.

A format specification comment must use the squiggly-brace comment style.

If no format specification is provided, the "general" format will be used (as in Excel).

As one quick example, the NetProfit formula in Results.rts is defined as {$0} S.Equity - S.StartEquity. The $0 tells RealTest to display this stat as a whole dollar value.

You can see other examples of these codes in the section links above.

Two forms are supported within the { } block: the short-glyph form (e.g. {$0}) documented in the first table below, and the newer named-attribute form (e.g. {format: dollar, places: 0}) documented in the second. The two forms cannot be mixed in the same comment block, but the same formula may contain multiple comment blocks.

Short-Glyph Form

Code

Used In

Shows This

Digits (if present) Specify

#

scans, trades, charts, graphs, results

general-purpose numeric value

number of decimal places

#x

scans, trades, charts, graphs, results

integer in hexadecimal format

n/a

##

scans, trades, charts, graphs, results

general-purpose number without commas

number of decimal places

$

scans, trades, charts, graphs, results

value as currency

number of decimal places

%

scans, trades, charts, graphs, results

value * 100 as a percent

number of decimal places

-

with any of the above codes

value as above, use red if negative

the ABS is the number of decimal places

//

scans, trades, charts, graphs, results

value as a date string

n/a

//:

scans, trades, charts, graphs, results

value as a date+time string

n/a

:

scans, trades, charts, graphs, results

value as a time string

n/a

~

scans, trades, charts, graphs, results

value as True or False

n/a

^

charts

show this indicator in an upper indicator pane (^ = ^1 = pane closest to price; ^2 and ^3 select additional panes stacked above)

optional pane number 1, 2 or 3

^

graphs

include this graph in Test Summary Reports

n/a

|

charts

show this indicator in the volume pane

n/a

 

|

graphs

draw bars rather than a line

base value (x-axis) for bar chart

|

results

show this item in the status bar

n/a

"name"

any

override the default item name

n/a

An output format specification comment can be inserted anywhere within the item's formula.

Any unrecognized character in the comment cancels its interpretation as an output format.

Named-Attribute Form

An output format comment may alternatively contain a comma-separated list of name: value attributes, e.g. {format: dollar, places: 0, color: orange}. The script editor pops a context-aware autocomplete list when the cursor is inside the { } block, showing only the attributes that apply in the current script section.

Attribute

Alias

Used In

Value

format

unit

scans, trades, charts, graphs, results

one of: number, plain, dollar, percent, fraction, date, datetime, time, bool, hex

places

decimals

scans, trades, charts, graphs, results

integer number of decimal places

negred

scans, trades, charts, graphs, results

1 or 0 – show negative values in red

name

label

scans, trades, charts, graphs, results

quoted display label that overrides the item name

color

charts (per indicator); strategy / template / benchmark / statsgroup / combined section headers

named color, #RRGGBB, or RGB(r,g,b) – overrides the default palette color (see below)

pane

charts

one of: price, ind1, ind2, ind3, volume – selects which chart pane to draw the indicator in

line

linetype

charts, graphs

one of: Line, Bars, Dashed, Dotted (graphs treat Dashed/Dotted as Line)

base

charts, graphs (with line: Bars)

baseline (x-axis) value for histogram-style rendering

hat

charts, graphs

1 or 0 – equivalent to the legacy ^ glyph (route to indicator pane in charts; include in Test Summary Reports in graphs)

Color Values

The color: attribute accepts three value forms:

1.a named color: black, white, red, darkred, green, darkgreen, blue, darkblue, cyan, magenta, yellow, orange, purple, brown, gray, darkgray, lightgray

2.an HTML-style hex code: #RRGGBB (e.g. #FF8800)

3.an RGB triple: RGB(r, g, b) with each component 0–255

On the Strategy, Template, Benchmark, StatsGroup, and Combined section header lines, a {color: ...} comment overrides the color used for that strategy in graphs, result columns, trade overlays on charts, and combined-strategy reports.

 

 

 

Copyright © 2020-2026 Systematic Solutions, LLC