Trade System Parameters

 

The Trade System Parameters section of the TSO Setup window displays all the user-defined parameters associated with the selected Trade System. The start values initially are those that were set in the Trade System. However, you can change those by clicking in the cell and entering a new value.

Select which parameters to use in the order you want the parameters run through optimizer. That way, both the Optimize Order column and the Use Column are completed.

To change the order, click in the Optimize Order column and select the correct order from the drop-down list.

The Start Value and End Value determine the range of values you want to test for each parameter. Enter the first value you want the Optimizer to use for each parameter in Start Value. Enter the last value you want the Optimizer to use for each parameter in End Value.

The Step value determines how the Optimizer increments the parameter to change the parameter's value. If the start value and end value are both integers, a step of 1 means the Optimizer tests every value of the parameter between the Start Value and End value. A step of 5 means the Optimizer tests the Start Value, reset the parameter to Start Value +5, and then test again, until it reaches the End Value set for that parameter. That means only every fifth value of the parameter between its Start and End Value is tested.

The Optimizer changes only one parameter at a time, so all combinations of the specified parameter values are tested.

The Number of Steps indicates the number of test steps needed to test all combinations of the values for every parameter, based on your inputs in this section and the algorithm selected.

Example: The following values produce a number of steps value equal to 392 calculated as follows:

Start Value

End Value

Step

1

7

1

1

8

1

3

9

1

 

Number of steps = (from 1 to 7inclusive) = 7

(from 1 to 8inclusive) = 8

(from 3 to 9inclusive) = 7

7 x 8 x 7 = 392 steps

Note:  The parameters settings are displayed in the main TSO window. However, they can only be changed using the Formula Toolbox window.

Statistics Calculation can be per trade, or per contract or share.

Setting Chart Characteristics

 

If you want to change the data settings, use the drop-down lists and Setup buttons to make your selections. These settings determine which kind of chart the TSO uses for its calculations and how a chart is displayed if a chart display is requested for a specific result in the result table.

Choose chart type

Select the chart type you want to optimize. Choices are Bar, Percent Bar, No Gap, Fill Gap, Candlestick, Constant Volume Bar, Yield.

Click the Setup button to set the parameters for the selected chart type.

Choose interval and session

From the Chart Parameters section, you can select the bar interval and miscellaneous setup characteristics.

Select the chart interval to use in the chart. Options in the drop-down list include: 1 min, 5 min, 10 min, 15, 30, 60, Daily, Weekly, Monthly, Quarterly, Semi-Annual and Annual. If you want an interval that is not in the list, enter that interval in the Interval box.

The All Sessions Setup button allows users to access the Misc and Bats tabs of the Chart Preferences window.

Set Bar Range

 

1.  To change the bar range, click the Edit button. The Define Bar Range window appears.

2.  Choose one of the three buttons in the From section, as described below.

3.  Select the top button in the From section for daily or longer bars.

4.  Click the drop-down list button next to the date to display the Calendar and select the desired date.

5.  Input the desired time (for intraday bars) or select the second button for intraday bars.

6.  Input the desired number of bars to look back.

7.  Input the desired time (for intraday bars) or select the third button to start the bar range a specific number of days back.

8.  Input the number of days back to start the range.

9.  Click either the Current button in the To section or the button immediately below that to select a date and time to end the evaluation.

10. Enter a date and time, if necessary (if the Current button has not been selected).

11. Click the OK button to apply the selections and close the Define Bar Range window.

Setting Thresholds

 

Thresholds act as filters to limit the calculations that are reported in the results table. Only calculations whose calculation values meet all of the threshold settings appear in the results table. While TSO is stepping through the parameter values, the current step results are displayed, but unless a step meets the threshold criteria, no other rows are added to the results table.

1.  Click the Thresholds Setup button

2.  Click the parameter column to select the parameter to set the threshold value(s) on.

3.  Click the From column.

4.  Click the down arrow to display the list of threshold operators.

5.  Select from, less than, or greater than and enter a value. If you select from, you must also enter a to value.

6.  Click the Close button to enact the selections and dismiss the Thresholds window.

All thresholds are summarized in the TSO Setup window in the Threshold field. If you can't see all the threshold summary information, expand it by clicking the square button in the field.

Selecting Statistic to Optimize On and the Optimization Order

The Statistic to optimize on is the statistic by which you want to measure the success of your Trade System. The default statistic to optimize on is Total Net Profit.

1.  Click the Optimize On drop-down arrow and select the statistic on which you want TSO to optimize.

2.  Select whether you want the results to display sorted in increasing or decreasing order for this statistic.

The statistic that is optimized on is always the first statistics column (after the parameter listing) displayed in the summary result table. It is always visible.

Selecting TSO Algorithm

CQG offers 2 TSO Algorithms, exhaustive and genetic.

The Exhaustive algorithm evaluates the effectiveness of the trade system for each possible combination of all the parameters, as defined in the TSO Setup window. The best found parameter combination corresponds to the absolute maximum of effectiveness and cannot be further improved. The great disadvantage of the exhaustive algorithm is that it may take a long time.

The Genetic algorithm evaluates a subset of every possible combination of all the parameters defined in the TSO Setup window. The genetic algorithm takes its basic idea from biology and searches the most effective parameter combination according to biological laws. It does not guarantee the result, as does the exhaustive algorithm, but it probably finds the most effective combination, or one close to it, and it takes less time to run.

 

First, a number of living creatures (population size) are placed randomly in the knots of a parametric grid. Then these creatures live and reproduce themselves (crossing the genes and undergoing sometimes rare mutations) as would really take place in biology. The creature strength is defined by the effectiveness of the trade system with appropriate parameter combinations. After evaluating the effectiveness for all the creatures, the strongest creatures, selected from both “parents” and “descendants”, form the succeeding generation, which becomes the new “parents." It is the demonstration of the biological law: the weaker perishes, the stronger survives. Thus, generation-by-generation the strongest creatures are assumed to approach the absolute maximum.

If the process comes to a dead end (remember, we are not sure that we have found the absolute maximum), the part of the current generation, defined by the Discarding level is cancelled and replaced with the randomly selected creatures. This corresponds to influx of fresh blood in biology.

The Elite chromosome's set defines the capacity of the best chromosome buffer. That buffer keeps the best chromosome (creatures), which can never perish. Eugenics deals with this kind of selection in biology.

The number of steps means the total number of knots, where the effectiveness of the trade system should be evaluated. This number should be much less than the total number of knots, used in the Exhaustive algorithm, otherwise it makes no sense to apply the Genetic algorithm. Note that the number of generations is approximately equal to the number of steps divided by the population size.

1.  Click the Algorithm drop-down arrow and select Genetic.

2.  Click the Setup button to display the Genetic Parameters window.

3.  Set the genetics parameters and click the Close button on the Genetic Parameters window.

Genetics Parameters

Genetics Parameter

Description

Number of steps

The total number of times the effectiveness of the trade system should be evaluated. The algorithm increases its effectiveness when the number is increased, but the calculations takes longer.

Population size

The number of living creatures in population. These creatures are included in crossover and mutation processes. When each creature appears (after crossover and mutation processes) for the first time, its effectiveness must be estimated. This increases the number of executed calculations by 1. The Chromosome Number should be a few dozen, or may be a hundred or slightly more. It should be less than the total steps used in the Exhaustive algorithm.

Elite Chromosome's set

The capacity of the chromosome buffer, which keeps the best combinations of parameters that never perish. This buffer can be updated in each generation. This number must be less than the Chromosome Number in Population. Recommended values are 1/4 or 1/6 of the Chromosome Number in Population.

Discarding Level

Defines the number of generations, during which at least one new chromosome must appear among the Best Chromosomes. If this has not happened, the buffer is emptied and filled afresh from by the chromosomes from the Best Chromosome buffer and completed by the randomly selected ones. This parameter should not be very large, and probably should be in the range of 5 to 20.

Probability of mutation

Random change of the internal chromosome structure (bit representation) and its value. Like in biology, this should be a rare event. This value is expressed as a probability, and typical values are 0.01, 0.03 or 0.05. Although you can set the mutation probability greater than 0.1, it is not recommended for best results.

For additional information on the genetic algorithm, see Genetic Algorithms + Data Structures = Evolution Programs by Zbigniew Michalewicz