Investment Studio > Views > System > Symbols

Under Symbols, you can define named, auxiliary quantities for use in system Rules (and occasionally in the Optimizer).

This allows large systems to be broken up in computational elements with well-defined purposes and descriptive names, while keeping the Rules section clean. Ideally, the latter should only contain references to Symbols.

Symbols toolbar

The toolbar contains four control groups. They can be repositioned by dragging their beveled "grip"

and hidden by unchecking the corresponding entry in the pop-up menu's Toolbar submenu (right-click the grid or the toolbar to open it). All buttons also have functional equivalents in the pop-up menu.

The toolbar is visible only if it contains a least one visible control group and is itself set to visible.
 
"Symbols" group

Edit as text. Opens a window with an alternate representation of the symbol table: plain text (no cells) with field columns separated by tab characters. Quicker to edit than the regular spreadsheet-style form when dealing with large definitions and/or long expressions, and particularly handy when you need to transfer a whole section of a symbol table (just copy and paste).
New. Click to define a new symbol.

A new entry will be added to the Symbols grid after the selected symbol, if any; after existing symbols otherwise.

Copy. Click to insert a copy of the selected symbol record after the original.
Delete. Click to delete the selected symbol record.
 
"Orientation" group

Standard grid orientation buttons:
Rowwise display. When this button is depressed, each symbol record is displayed in a grid row (record fields map to grid columns).
Columnwise display. When this button is depressed, each symbol record is displayed in a grid column (record fields map to grid rows).
 
"Position" group

Standard grid position buttons:
Move up / left. Click to move the selected symbol record toward the beginning of the list.
Move down / right. Click to move the selected symbol record toward the end of the list.
Grid position does not affect symbol evaluation or system execution.
 
"Changes" group

Commit. Click to commit to all changes made in the Symbols grid since the System view was last selected or since the latest Symbols Commit operation (if more recent). Leaving the System view causes an implied Commit.
Discard. Click to discard all changes made in the Symbols grid since the System view was last selected or since the latest Symbols Commit operation (if more recent).
 

Symbols grid

All symbol records in the grid contain a Symbol name, a Definition and an optional Comment:

Symbol names declared here can be used in references throughout the System view. They should be unique within the portfolio and follow the usual symbol naming conventions.
Each Definition is an expression which evaluates to a number (float) or to an array. It's recomputed automatically as needed in the course of system execution.

If the symbol's value is a constant (i.e. no expression is required to define it) consider using a Parameter instead. Doing so is more efficient and allows the value to be automatically optimized.

The Comment can be any text; it has no effect on symbol evaluation or system execution.

The following symbols are built-in and can be used in expressions throughout the System view, including Symbol Definition fields:

Built-in symbol Interpretation
X The current transaction date. Fundamental. On system execution, the Rules are evaluated for each value of X from FROM_DATE + 0.5 to TO_DATE + 0.5, in steps of 1 (= one calendar day).
FROM_DATE The system's start date, specified with the date range controls in the Rules toolbar.
TO_DATE The system's end date, specified with the date range controls in the Rules toolbar.
PORTFOLIO Identifies the system's portfolio. Can be used as the portfolio index argument with any portfolio lookup function. For instance, the expression

=portfolio_name(PORTFOLIO)

will return the portfolio's name.

Note that the built-in symbol RULE is only defined in the Rules grid. It can not be used in the Symbols grid or elsewhere in the System view.

Finally, there are asset symbols. Throughout the System view, the symbol of any asset in the portfolio can be used as the asset index argument with any asset lookup function. For instance, if the portfolio contains an asset with the symbol QQQ, the expression

=asset_name(QQQ)

will return that asset's name. Note that the asset symbol is not surrounded by quotation marks in the function call; it's really a symbol, not a string.

In the screenshot below, the definition of the symbol _crosses (an array) contains references to the symbols _closes and _sar (also arrays), which in turn use references to the asset symbol qqq; to the built-in symbols from_date and to_date; and to the parameters _min_af and _max_af:

All of the above symbols are available in expressions throughout the Systems view.