RealTest User Guide
RealTest User Guide

 

 

Navigation: RealTest Script Language > Script Sections >

Parameters Section

 

 

 

 

Parameters or optimization variables are defined in their own section of the script.

They can be given any name, which can then be referenced from any formula in the script.

The syntax for defining parameter variables is different from other script sections where the standard formula syntax is used.

The end product of a parameter variable declaration is a list of values to use.

The syntax supports all of the following methods of defining a value list:

A single number

Traditional loop statement, e.g. "from 5 to 50 step 5"

Loop with multiplication, e.g. "from 5 to 200 mult 1.1"

Optionally, either of the above can include a "def" and/or "round" clause, e.g. "from 5 to 50 step 5 def 20" or "from 5 to 200 mult 1.1 round 1"

Or you can simply list the values you want, separated by commas, e.g. "1, 3, 17, 44"

A comma-separated list can also end with a "def" clause, e.g. "10, 20, 50 def 20", making that value the default without reordering the list

Note that all values used in this section must be simple numeric constants. No expression syntax (e.g. division) is allowed.

The following are examples of supported syntax:

If no default ("def") is specified, then the default value will be the first number in a list or loop.

Default values are used in the following circumstances:

a single test is run, rather than an optimization

an optimization is run but that parameter is not selected in the optimization parameter list

a formula from a non-strategy section, e.g. Scan, refers to a Data item that refers to a parameter in its formula

The Debug Panel can be used to experiment with the above syntax.

Evaluating any "from" statement in the debug formula causes the resulting value list to be written to the log window.

To specify within the Parameters section which of your parameters should be selected by default in the RealTest Optimizer, add {X} to the definition of each parameter that you want to be selected.

Two commands can edit this section for you: the Optimizer dialog's Save to Script button adds or removes the {X} markers to match the dialog's parameter check boxes, and the Results menu's Save Parameters to Script command (see the Results Menu) sets "def" clauses from a selected test's parameter values.

A third command, the Results menu's Apply Parameters and Data, edits no script: it sets a selected test's parameter values in memory and recalculates dependent Data items with them, so that trade lists, chart indicators, graphs, plots and the Debug panel show that test's context. The next run or apply reverts to the script's own values.

Note that parameters (like Data and Library items) remain in memory after a run so that charts and the Debug panel can continue to evaluate them. They are only cleared when the next script run declares its own Parameters section. This means that if you run a script with no Parameters section of its own, the previous script's parameter names remain defined, and formulas that reference them will still resolve. To explicitly clear them, declare an empty Parameters section.

 

 

 

 

 

 

Copyright © 2020-2026 Systematic Solutions, LLC