Navigation: <Root level>

Realtest Script Language





Writing RealTest scripts does not require any programming in a traditional sense.

In fact the script language does not include any standard programming elements such as functions, loops, if/then/else, and so on.

Learning to write RealTest scripts involves primarily the following:

understanding how scripts are structured (described below)

learning the formula expression syntax (similar to learning Excel cell formulas)

learning about the backtest engine and all of its inputs

lots of experimentation and reiteration


RealTest script contents are organized into section headers and section items.

Each section header and each item within a section is declared as a word followed by a colon.

Once declared, everything between the colon and the next section declaration becomes the contents of that section.

No statement termination character (such as a semicolon in other languages) is required.

A colon preceded by a word marks both the end of one script element and the beginning of the next.

Although this use of this Item: content syntax makes RealTest scripts look slightly like Python, there are no requirements for indentation or line endings. In theory, an entire script could occupy a single line.

For readability, it is recommended to give each section header and each item its own line, and to indent the items one tab stop. Among other benefits, this permits "folding" in the script editor, and it also facilitates context determination for the context-sensitive help.


One way to think of the RealTest script syntax is as a form without labels.

This sounds like a strange idea, but if you imagine a form with all the possible sections and items, it would be overwhelming.

Instead, the intelligent script editor becomes your dynamic form.

Try opening a new blank script and typing the letter 's':

Immediately you have a choice of three possible new form labels, aka section names to insert.

Select Strategy, and then press enter. The cursor moves to the next line and is automatically indented one tab stop.

Now type 'e' and see all the strategy labels that contain that letter:

Select EntrySetup, then type 'c' to begin your formula:

I find this interface much more convenient and easy to use than a large form with lots of labels on it. I hope you do to.





Copyright © 2020-2024 Systematic Solutions, LLC