|
Parameter Reference |
Top Previous Next |
|
Parameters are a very powerful feature of Trading Blox. Parameters allow you to create systems that present their own user interface to allow the user to easily change system settings.
For example, you can create a parameter to be used for the number of days in a moving average, and then change that value when you run your system for historical testing or trading purposes without altering your Blox or Systems. Trading Blox Builder automatically creates a user interface for your parameters which give the user the option of setting a fixed value or stepping through a series of values for every parameter you define. Parameters can also be referenced directly as if they were a variable in any scripts in the block where they are defined.
To create a Parameter, select "Parameters" on the left and click the "New" button.
The Parameter Type is an Integer in the case above. The supported types are:
Default Value The default value is the number initially assigned to the parameter when first presented in the Parameter Editor for a system. After that initial setting Trading Blox Builder will remember the current value so the Default Value is only used the first time a system is used for a Test Suite..The Default Value for the parameter above is 80.
Scope Set the scope based on what blocks and scripts need access to this parameter. If you set to Block scope (default) only the scripts in the block will have access. If you set to System scope, then all scripts in all block in the system will have access. If you set to Test scope, then all scripts in the test will have access.
Used for Lookback Check this box if the parameter is going to be used to reference past values of an indicator or past values of an instrument.
For example, if you are using the following type of code in your script, the parameter "closeLookback" should be a lookback parameter:
IF instrument.close[ closeLookback ] > instrument.close THEN
If you are only using this parameter as input to an indicator, then you do not need to check the lookback box.
Priming will be increased by this lookback value plus 1. So for a lookback value of 5, the first day scripts would run is day 6. Overall priming is the maximum bars required for indicators plus one, plus the maximum lookback parameter plus one.
User Interface Here is how this parameter looks to the user:
We can access this parameter in scripts by using "closeAverageDays". Parameter can also be used for inputs to Indicators. In fact, this is probably the most common use for parameters.
NOTE: Parameters are READ ONLY. They can be accessed by scripts, but not changed by them. |