This table shows how each Trading Blox Builder script section is available during testing, and when in will execute for each test date and or time.  For example, Before Simulation and After Simulation script section will only execute once during the selected Suite test.  In a stepped test, Before Test and After Test will execute once for each step in a test.


Before Trading Day and other scripts identified in the table column named: Runs Once Each Bar will execute for each test date or date-time record in the data.


Script section identified in the Runs Once Each Instrument will execute once for each instrument for each date or date-time record in the data file.  Instrument identified in this column not assigned a "Y" designation, but instead show a reference notation (see table below), will only execute when the instrument test condition for that instrument requires execution.

Script Execution Timing Table TBv4.2.2.8

All the Trading Blox Builder module scripts are shown in this table:  


Each column descriptions shows the details of how often each script is executed for each of the script names.


Only script sections with Trading Blox Builder Basic statements will execute.  Script that are blank are not executed.


Only the scripts displayed in blox are executed.


Order number listed to the left of each script name is a relative indication of the order in which the scripts might execute most often.  Script execution for section identified with a notation also require the notation's condition be met to enable execution.


Each notational exception is describe in the legend below the table.


Blox Script name rows in the above image that have a Legend 'D' mark entered in the Instrument column, those script names will automatically provide IPV variables with context so they can be accessed and changed.


Instrument scripts that automatically provide context, will execute each instrument symbol in the portfolio that has a date record in its file that aligns with the system testing date in progress.   For example, if there are ten-instruments in the portfolio, each instrument script will execute one time on on each of the system testing dates.  When a instrument doesn't have a date that aligns with the current system test date, the instrument object instrument.tradesOnTradeBar property, will be FALSE, and that instrument won't be tested again until has date record that aligns with the system testing date.  When an instrument has a date record that aligns with the next system testing date, the instrument.tradesOnTradeBar property will be TRUE.


There are exceptions with the script sections that contained a red Legend 'D' and a green background cell.  These scripts have dependencies that are explained in the Legend notes.


Instrument scripts without any Legend symbols, do not automatically provide instrument context, and they do not process each instrument in the portfolio.  Howevr, instruments can be processed in these script section, but they must be loaded and processed using the LoadSymbol function using a repeatative loop structure, and they must use Instrument-BPV type variable that is created in the BPV variable creation dialog.



Execution Description:


Unit Size and Can Add Unit scripts will only execute after a Broker Object function call that generates an order to enter the market with a new position or a new unit.  Only new entry orders pass through these script sections.  See order.isEntry


Entry Order Filled scripts only execute after the Can Fill Order script section completed its execution and allowed the order to continue.  They also require an entry order was filled. See order.continueProcessing


Can Fill Order scripts only execute when either an entry has been filled in the market, or when an exit order has closed an active position or any of a position's unit segments.


Exit Orders only execute when there is an active instrument position, and it only executes when the instrument with the active position is sequenced into context.


Exit Order Filled scripts only execute after the Can Fill Order script section has completed its execution and allowed the order to continue, and when an active position or any of its units have been closed.


Adjust Stops scripts executes when there is an open position ahead of the risk scripts so that risk information used can be collected and changes can be implemented.

Custom Scripts

<Custom-name-scripts> only execute when called.  They can be called from any another script, standard or custom, and when they complete their execution they return to line in the script from which they were called.



order.continueProcessing, order.isEntry, System Object, Accessing Instruments, LoadSymbol

See Also:

Script Section Type Details, Global Script Timing Table


Edit Time: 4/14/2018 2:06:08 PM

Topic ID#: 173


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