Simulation Parameters

The following is a list of the Trading Blox global Simulation Parameters.  Each parameter option is a link to information about of how each is used.   The parameters in the Suite Parameter section are applied to all of the systems in the suite being tested.  


A description of how each parameter affects the systems in the suite is a link to an explanation section in the following table.  Trading Blox default values are displayed in this Suite Parameters image:

Click on a Menu Item for more information.

Simulation Default Parameter Settings


Global Parameter:


Test Start Date ^Top

Date value entered will be the date when a Suite test can begin.

Start Date Stepping:

Trading Blox will provide Suite testing segments during the Start-Date, and the last data date.  To create a stepped testing segment, enable Stepping of the start date, and then enter the test segment length that is to be tested:

Click to Enlarge; Click to Reduce.

Start-Date Stepping Example

When the above test is performed, it will generate a table at the top of the Summary Performance Report that looks similar to the following table:

Click to Enlarge; Click to Reduce.

Stepped Start-Date Performance Summary

In this example, the Suite testing range was set to use all the data available.  The test end-date in the above example has the Use All Data option selected.  The other two test-end date options can be used when a test range is to be less than all the available data for an end-date.


A Stepped Starting Date test often has enough steps to qualify as a Large Scale Report.  These large reports can be impacted by any of the three filtering controls.  These filters will remove one or more of the stepped period results from the list of possible results.  When that happens, it can cause some stepped reports to go missing.  If you find some reports missing, check to see the filtering control is active.  Removing the values in any of three filtering categories will disable the filter:

Click to Enlarge; Click to Reduce.

Large Scale Reporting Filters Can Limit Stepped Start-Date Performance Summary Segment Reporting

Test End Type ^Top




Testing can end in three different ways:

TB5_Test Date Options

Use All Data

TB5_SimParam_Test End Type_Use-All-Data

When this option is selected, a test that uses all the available data in each instrument.  Even if the last date in some instruments are later than those without data.  "Use All Data" will be the better selection when a system is generating trading orders.  It is better because the orders won't be stuck on at earlier date than the current date needed for trading when the data being updated is later than the "Use Date" value.

Use Date


TB5_SimParam_Test End Type_Use-Date

This option allows the testing to be bounded to results that were available between the dates listed.

Fixed Length


Previously Named:

Use Start Date Stepping


Test Fixed Length (days) was:
Increment Test Start (days)


This option isn't available:
Set Test Duration (days)


TB5_SimParam_Test End Type_Fixed Length

This option enables Trading Blox to generate a test of segmented test period by enabling a process that increment and applied the incrementing the Start date by the number of days in the Test Fixed length (days) setting.  Previously, this was the "Use Start Date Stepping" option that created a performance table of progressive start dates from the first date all the way to the specified number of Test days.

Earn Interest ^Top

Earned Interest default setting is TRUE and it will add interest from available cash to the account when set to True.

A False setting disables the interest earning option.


Interest rates used during a simulation are determined by the currency rate files provided in the

Forex Rate file folder for your system base currency:


Click to Enlarge, Click to Reduce

Forex Rate File Folder Disk Location

These interest rate files must be maintained when there is a change in interest rates.


Preference section of Trading Blox determines which Currency Rate file to use in a test:

Click to Enlarge, Click to Reduce

Forex Rate Setting Preference Section 


Above image example shows USD as the base currency.  This USD setting will use the USD_Rates.txt file in the Forex Rates folder lending rate to determine the earned interest.  Other currency designators will use the interest rate files that match the setting in the field.


Only the cash amount earns interest:

Cash for Futures and Forex is the total equity.  Money used as margin for Futures trading is not deducted from the cash balance since many brokers will allow T-Bills for margin requirements allowing traders to earn interest on the money that is used for margin.


Cash for Stock class instruments is closed equity minus purchase equity.  This means money used to purchase stocks is deducted from the cash balance.

Slippage Percent ^Top



The frictional cost of trading has two components: commissions, and slippage (sometimes also known as "skid").


In actual trading, slippage is the difference between a trade's entry or exit order price, and the price at which the trade is actually filled. In order to accurately reflect the conditions of real trading, the impact of slippage must be simulated during back testing.



The frictional cost of trading has two components: commissions, and slippage (sometimes also known as "skid"). In actual trading, slippage is the difference between a trade's entry or exit order price, and the price at which the trade is actually filled. In order to accurately reflect the conditions of real trading, the impact of slippage must be simulated during back testing.


Since slippage can vary dramatically from trade to trade, depending on market conditions at the time an order is executed, Trading Blox employs a slippage assessment technique that is based on market volatility.


The simulated fill price is obtained by calculating a slippage factor, which is added to (or subtracted from), the theoretical entry price.


For a long entry, the slippage factor is calculated by measuring the range from the theoretical entry price to the day's highest price, and multiplying that amount by the Slippage Percent. (For short entries, the slippage factor is calculated by measuring the range from the theoretical entry price to the low). The slippage factor is then added to, or subtracted from the theoretical entry price, to obtain the simulated fill price.


Here is how it works for a buy trade:


Slippage percent:


Theoretical buy order price:


High Price (for the day):


Slippage Factor:

(120 - 100) x 0.25 = (20 x 0.25) = 5

Simulated fill price:

Order Price + Slippage Factor = (100 + 5) = 105


The distance between the high price and the order price is multiplied by the slippage factor. In this example, the difference between the high price and the order price is 20 points. The 20 points are multiplied by the 25% slippage to get an estimated slippage of 5 points. The fill price for the order will be 5 points worse than the stop order price of 100 simulating a fill at 105.


Slippage for sell orders is computed using a similar calculation using the distance between the order price and the low of the day.


In historical back testing, failing to accurately estimate slippage can lead to two types of mistakes: Underestimating frictional costs may lead you to trade a system that produces spectacular hypothetical results, but does not hold up well under real trading. Conversely, overestimating frictional costs may dissuade you from trading an otherwise good system.


It is also worth noting that the more frequently a system trades, the more profound the impact of frictional costs will be.

Minimum Slippage ^Top

The Global Parameter property "Minimum Slippage" is a Futures only parameter.


In testing and order generation, this parameter control is only active for portfolios with Futures instruments. Stock results are not affected by this Global Property setting.


When a Suite is exported and or imported between version 4 version 5, the setting of this property will be set to zero.


Slippage works in conjunction with Slippage Percent parameter.


When this parameter is set to a non-zero value, results will have some slippage cost is assessed against every trade. Trading Blox will impose Minimum Slippage only if the currency value resulting from the Slippage calculation (based on Slippage Percent, above) is less than the currency value of slippage as calculated by the Minimum Slippage parameter.


Where entry occurs at or near the high or the low of the day, the potential adverse range is practically nonexistent, so the Slippage Percent calculation would be at or near zero.  In this case, Minimum Slippage can ensure that some slippage is assessed on the trade.


If Slippage Percent is set to zero, then the slippage for all trades will be the value specified by the Minimum Slippage parameter value.


Minimum Slippage can cause the fill price to be outside of daily high low range.

Max Percent Market Volume  

This option is no longer available as a built-in Global Parameter method.  A blox module with this ability can easily be added when this area of control is needed during system development.

Max Margin/Equity to Trade ^Top

The default is 100%, in that if a requested trade would require more than 100% of available equity in margin or cash, then the trade will be filtered. This parameter allows you to mofidy this behavior. If you enter 50 here, the system will filter trades if the new total margin required would be greater than 50% of the total available equity.


To obtain these dynamically updated values as orders are being processed, use the Test Object property: test.marketOrderValue.  This property contains the net margin required for tomorrow's market on open orders.  Plus the margin for entries, minus margin for exits.  The remainder value is added to the normal current outstanding margin process.

Trade Always on Tick ^Top

When this parameter is set to false, the system will trade with maximum precision. So if the system buys Gold on a stop at the moving average, which is 365.44789, then the system will buy at that exact value. Conversely it will exit the trade at an exact value as well. The trade price as listed in the trade details will only show the digits of precision of the instrument, as set in the Futures Dictionary, so the trade price would look like 36.45. But the trade profit would not match that value exactly.


When this parameter is set to true, the system will always trade on the tick. It will round up to the nearest tick for buy orders, and down for sell orders. So in the above example, if you placed an order to buy on stop at 365.44789, the system would place the order to buy at 365.45.


The fill prices would also be on tick, so a slippage of 10% could become more as the order price and then fill price gets pushed to a tick.

Smart Fill Exit ^Top

(Smart Exit Fills)

When set to true, this function will only fill the exit stop/limit order closest to the open for any particular unit. This can be helpful when using multiple exit blox that place stop/limit orders. If the open is at 10, (and the high is 12 and the low is 7), and you have an exit stop at 11 and a limit order at 8, the stop exit order will be filled.

Entry Day Retracement ^Top

Entry Day Retracement is the percent of the bar range (High-Low) used to compute the trigger price, which determines whether to fill the protective stop on the entry bar.


For a long entry order:

The protective sell stop will be filled if the trigger price is less than or equal to the stop price.


The trigger price is computed as:

'  trigger-price cannot be higher than the close or lower than the low.
trigger-price = entry-order-fill-price (bar-range * entry-day-retracement)


Therefore, using 100% as the entry day retracement is the most conservative approach where the trigger price will be the low of the day, and if the low is less than the protective stop price then the stop will be filled, and the position exited on the entry bar. Note that if on average the fill price is in the middle of the bar, a setting of 50% will on average also use the low of the day as the trigger price.


Using 0% as the entry day retracement is the most aggressive approach where the trigger price will be the close of the day, and if the close is less than the protective stop price, then the stop will be filled, and the position exited on the entry bar.


Using -1 as the entry day retracement will disable this feature, and the protective stop will be ignored for the entry bar.


When orders with a protective price Trading Blox will place the entry-risk points, and order-entry protective price in the order and instrument unit properties, so they are available after the bar of entry.


Entry Day Retracement description and rules information.

Start Date Stepping

Increment Test Start

Set Test Duration

This feature is now part of the Start and End date options shown a this link Start Date Stepping location.

Use Broker Positions ^Top




Default value is FALSE. In this position state, any positions listed in the Broker Position Editor are ignored when the test simulation is run and test results will only be from positions generated by the systems in the suite.



Set to TRUE only when positions you want in test, or order generation results derived from the the broker positions.  In order this option setting to have an affect there must be positions entered in the Broker Position Editor.  

Ignore All Test Positions ^Top

Hidden when Use Broker Positions = False


If you want a mix of actual positions and theoretical test positions be sure this option is set to FALSE.



This option is only available when the above Use Broker Positions is set to TRUE.



Set to true to ignore all the test generated positions.  Use this option only when you want positions in the test, or order generation results to come from the entered broker positions.


Often this is used on the very first day of order generation so that you can start with a clean slate and no open positions. If you want a mix of actual positions and theoretical test positions, then leave this box unchecked.

Max Position Units ^Top

A position's quantity is the number of shares or contracts are applied to an order.  A position's Unit count represents the number of orders that have been applied during the the time current position has been active.



This is a new Global Setting Simulation Parameter.  When a suite has multiple systems, and some of the systems create multiple units, ensure this value is set to allow a multiple units.  When there is any doubt, check to see if any of the systems that enables multiple-units is limited by this parameter setting.  

Thread Count ^Top

Global Parameter Thread Count represents the number of test in a stepped simulation that can run at the same time.  


Each step in a stepped test runs a complete copy of the Suite’s construction at the same time.   This means that a complete copy of the entire Suite’s systems, blox and data files needed to run a test-step is loaded into thread-space memory so it can run as if only one test was being tested.  


Trading Blox Builder default license allows two threads.  Additional threads can be allowed by accessing your Customer Login section in the Trading Blox Website.  


Each computer’s thread count can be between 1 and maximum number allowed by the Trading Blox license.  Thread counts should not be more than twice the number of cores in your computer’s CPU.   Available memory is important when using a large number of steps in a stepped simulation or when large portfolios are being used. Reducing Optimization Time provides more detailed information about how to judge how many threads would be effective with your computer.


Global parameter Thread Count’s value can easily be changed and saved with each Suite as the needs of each Suite are known.



Each Trading Blox user license has two threads by default.  When more threads are needed and licensed, the added threads are summed with the two default threads to determine how many threads can be allowed on the computer.  For example, if four threads are purchased, then the total number of threads that can be active at the same time is six threads.


The number of threads used for one application, or multiple applications on the same computer, are limited to the maximum number of licensed threads.  When the Global Parameter setting is set to use more than the licensed threads, an error message will appear reporting there must be an adjustment to the Global Thread’s parameter Thread Count setting.


Another way for the insufficient thread message to appear is when more than one instance of Trading Blox is running a simulation and the total required active threads being tested are more than the total allowed threads.  

Too Many Threads Required Warning

Click image to expand and reduce.

Under normal circumstances, this means in parallel, so you can have several applications open and sitting idle without affecting the count. The thread count in use on the computer is determined by the threads in use actually running a simulation.


Should one of the applications have a critical error and stops running, those threads in the Trading Blox that was halted by an error will still be reserved.  They can be released by exiting all open Trading Blox application.  When Trading Blox installations are restarted that will reset the threads in use count.

Simulation Scoped Variables

Each thread in a multiple thread stepped test contains an entire copy of the Suite’s systems, blox, and data files.  This also means that a copy of all the variables and scripts in a suite is contained in each thread.

Multi-Parameter Goodness ^Top


The Multi-Parameter Goodness setting is used with multiple-parameter test stepping graphs.  To enable this option, enter one or more statistic names in the Multi-Parameter Goodness statistics settings field.


When this field is left blank, the MAR statistic will be used.


Edit Time: 10/9/2017 4:37:04 PM

Topic ID#: 201



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