Working with Scripts

The following is a chart showing the most basic list of Blox and scripts that will be in most systems.


Each script is called only under specific circumstances after the instrument has been primed.  It can be called for every price record in an instrument file.  It can also be called instrument file, or at the end of a time period.  For example, a daily record file can call the Week or Month data version to access the last record in the week or last record in the month.  When this type access is used to access instrument information the values used can be the basis for how the values returned in an order are applied.


Additional details are available in the Simulation Loop topic.

Block Type

Script Type




Called When


Entry Orders




start of day





Exit Orders




start of day, when a position is active




Money Manager

Unit Size




called by broker only when an order is filled


You can build most systems using only these Block Types and these limited number of scripts.


After you have some experience with Trading Blox Builder, you may want to experiment with some of the Intermediate Scripts.


Scripts are created and edited in the Block Editor. You access the Block Editor by clicking on the Blox menu item in the Edit menu:




This will bring up the Block Editor:



The Blox and Groups area lists all the Trading Blox available. The Script area shows all the scripts currently in the selected block. If there is code associated with a particular Block's script, that script will be drawn in Black text and Blod. If a script is empty it will be dark gray. If you are examining a new system you can easily tell which scripts have been used by the Blox in that system by looking at the color of the scripts in the list.


The Blox Items area shows all the variables, parameters and indicators used by a particular block. For more information on Block Permanent Variables, and Instrument Permanent Variables, see the Variables Reference section. For more information on Parameters and Indicators see their respective reference sections: Parameter Reference and Indicator Reference.


You can create a new variable, parameter, or indicator by selecting the appropriate type and selecting new from the menu or right click, or by double-clicking on the type itself in the list.


To change the values associated with a variable, parameter, or indicator you can double-click that item directly or select edit from the menu.


The order of items in the list determines their order in the User Interface that gets generated as well as the order of processing for calculated indicators. To change a script's or item's position, select that item and then use the Move Up or Move Down menu item.


Edit Time: 2/5/2018 1:10:12 PM

Topic ID#: 652


Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software