Variables, indicators and parameters can have different scopes. Scope in programming determines the range, or reach from which a data item can be referenced. In Trading Blox different types of variables can have different levels of scope. Scope is established by selecting the various scope references provided in the Scope's drop-down list, which is always set to Block unless the programmer changes the scope assignment. When scope is set to Block, that is most narrow or limited reach that the data in that data element is allowed. Local variables, those declared using the keywords Variables & Type entered into the script section code space, and not used in a custom function, are scoped the script section in which they are declared. Local variables declared and scoped within a custom function can also be accessible to the variables in the script section that called the custom function.
Setting the variable scope to something other than to Block scope allows the variable to be used in other blox in the system. However, the other blox needs to have a variable with the same name, and it should be defined as external.
Only IPV and BPV can be defined as External.
All variables, parameters and indicators are reset between every test run during a multi-stepped parameter test, and it happens just before the Before Test script. An exception to this data refreshing is allowed when the variable is set to the Simulation scope reference.
IPV and BPV variables are reset to their default value, the parameters are set to the next stepped value, and all indicators are recomputed.
Setting IPV or BPV variables using Simulation scope will prevent the values from being reset to the default value. This can be useful when keeping track of a value over the course of many stepped tests, or when loading external data in the Before Simulation script.
Because all values are reset just before the Before Test script, the Before Simulation script has no access to indicators or parameters, as they are not set yet. Any IPV or BPV that are set or loaded in the Before Simulation script will be reset to their default value unless they are defined as Simulation scope.
|
||||||||||||||||||||||||||||||||||||||