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:

Description:

Test Start Date: ^Top

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

Start Date Stepping: ^Top

Trading Blox provides a progressive set of tested segments using Start-Date stepping feature.  

 

This provision will test all the dates set in the Simulation Parameters Date settings.  Period lengths of each tested segment are dependent up the Test-End date settings.  

 

Each stepped-date segment will create a Suite tested segment specified by the period days specified for the testing length between each start-date incremented test.  

 

Each of the segments in the series of tested Suite segments will display graph tested segment information for each tested segment.

 

To create a Stepped-Date test, enable Stepping of the Start Date Simulation Parameter.   Then enter the the test segment days the Start-Date will increment after each test segment is finished:

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.

Start-Date Test Use-All-Data Segment Table

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 influenced by any of the three filtering controls displayed in the Preferences' Large Reports Section.  

 

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:

Click to Enlarge; Click to Reduce.

Test Start & End Date Timing Options

Use All Data: ^Top

When this option is selected, a test that starts on the Test Start Date will continue to run until there are no files with data.  Even if the last date in some instruments are later than those without data.  

 

"Use All Data" is always the better option 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: ^Top

TB5_SimParam_Test End Type_Use-Date

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

 

Stepped Start-Date with a Fixed End-Date Testing Segment Example:

Start-Date Stepped Use-End-Date Segment Parameters Setting Example.

Start-Date Stepped Use-End-Date Segment Parameters Setting Example.

 

Click to Enlarge; Click to Reduce.

Start-Date Stepped Test Segment Fix End Date Table

Fixed Length:

 

 

 

 

 

Test Fixed Length (days):

^Top

 

 

 

 

Set Test Duration (days)

^Top

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.

 

Click to Enlarge; Click to Reduce.

Start-Date Stepped Test Segment Table

End of Year:^Top

This End of Year option creates a test period runs until 12/31 of each year.  When there is more data available, it will snap to 01/January of the next year, or the earliest date available in the instrument files.

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.

 

Slippage:

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:

SlippageDiagram2

Slippage percent:

25%

Theoretical buy order price:

100

High Price (for the day):

120

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.

Note:

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.  In Trading Blox version 5.x.x.x and later, the process is significantly different from previous Trading Blox version.

Use Broker Positions: ^Top

 

 

FALSE

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.

 

TRUE

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

FALSE

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

 

TRUE

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.

 

Note:

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.

 

Note:

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.

 

Trading Blox can enable up to 200 Threads.

 

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

 

Settings Entered Will Execute Item or Statistic Results

Multi-Parameter Goodness Setting Field

 

The Multi-Parameter Goodness settings used with multiple-parameter test stepping test:

End Balance
CAGR%
MAR
Sharpe
Ann. Sharpe
MAX TE DD
Longest DD
Trades

 

When this field is left blank, the MAR statistic will be used.  To enable this option, more than a single method test can be added.  Default setting is to use the "MAR & Sharpe" calculations.

 

Previously setting the measure of goodness a number entered into the Preferences, or in scripting.  In the current versions, these are now in the Suite's Parameters tab.  The multi-parameter goodness measures are entered as a setting in the suite parameters area.

 

Any number of statistics names separated by a comma determines how the Goodness setting responds.  For example, the statistics entered might be: "MAR, Sharpe".   If you are stepping multiple parameters, this will then control the goodness measure used for the surface and 3D charts (heat maps) created for a multi-parameter stepped test.

 

You can use custom statistics as well, so if you use test.AddStatistic("MyStat", 30), you could then use that "MyStat" statistic as a goodness measure.  When stepping a single parameter, the stepped graphs show a measure of goodness vs. the parameter being stepped.   Only the first statistic entered is used in these graphs because only one output appears in goodness chart analysis.  Likewise, in walk-forward testing (WF), only one statistic is used.

 

WF testing sample optimization runs are looped over, and one set of parameters is used.  The sample uses the best goodness measure. You can select the statistic used for this measure of goodness in the Walk Forward Suite Parameters section.

 

Additional Charting:

You can see the optimization run results for the measure of goodness in the Log Window and also PRINT the information in the After Test script.

 

Trading Blox does not save the testing information for charting.  However, access to all statistics for all optimization and OOS runs is available.  To chart in a different way, you can save the testing information to a file and use it as desired.

 


Edit Time: 1/7/2021 3:54:07 PM


Topic ID#: 201

 

 

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