Navigation: Realtest Script Language > Syntax Element Details >







Import Specification


List of one or more symbols to include when importing data


An Import Section can have any number of IncludeList statements.

Each IncludeList statement can take one of the following forms:

One or more symbols, separated by commas (up to a maximum of 260 characters in total)

A path to a TXT file containing a list of symbols (one symbol per line with no commas)

A path to a CSV file in which a column of symbols has a name that contains "symbol" or "ticker" or "underlying"

The name of a Norgate watchlist, preceded by a dot (Norgate only)

The symbols from all of the specified include lists are combined into a single internal list.

If there are duplicates, only one copy of each symbol will be imported.

A special syntax, SYMBOL>ALIAS, can optionally be used to rename a symbol after it is imported (e.g. AAPL>APPLE). This is meant to be used when you actually want to import the same symbol from two different sources, so that each can be uniquely identified.

The number of the list in which a symbol first appears (whether literally or via an external file) is stored with the symbol and becomes the value return by ListNum when that symbol is the current context.

Though a symbol is only imported once, it can be listed in more than one IncludeList. The InList(n) function can be used to check whether the current symbol was among the symbols in the nth IncludeList.

An IncludeList can optionally be given a name. This is done by adding a squiggly-brace comment containing the name in quotes after the list definition, like this:

When a data file was imported using named include lists, a list name can optionally be used in place of the list number in the InList function, like this:

This can be a useful technique when combining multiple strategies in one script and therefore one Import definition.

By default any date for which at least one imported symbol has a bar becomes part of the global date list used to run tests and scans.

The symbols from an IncludeList can optionally be excluded from the global date list. This is useful, for example, when importing special symbols for risk-free interest rates, currency conversion etc. Often these symbols will include bars for dates which are otherwise market holidays.

To prevent the symbols in an IncludeList from being added to the global date list, add the comment {//} to the same line in the script.

If the list also requires a list name, use the same special comment, e.g. {"currency"//}.





Copyright © 2020-2024 Systematic Solutions, LLC