The optimal position sizing results depend on the performance metric maximized during the optimization. These are referred to as the optimization objectives. To see the choices available, select Optimize Position Sizing from the Analysis menu (or the same command from the Portfolio menu for optimizing a portfolio). This brings up the Optimize Position Sizing window, as shown below.
The choices for the optimization objective appear in the top left section of the window, labeled "Maximize…." The same objectives are available for optimizing portfolios. You can choose to maximize the following performance measures: Net Profit, Rate of Return, Average Trade, Average Trade (%), Profit Factor, Return-Drawdown Ratio, or Modified Sharpe Ratio. In addition, the maximum peak-to-valley percentage drawdown can be limited to a specified value; e.g., 20%. See Chapter 12, Viewing the Results, Performance Results, for a definition of each performance measure when optimizing over the current sequence of trades. When
optimizing using Monte Carlo analysis, see Chapter 12, Viewing the Results, Monte Carlo Results, for a definition of each performance measure.
When optimizing a market system, the optimization process is applied to whichever position sizing method is currently selected. Likewise, for portfolios, the optimization process applies to the position sizing methods currently selected for each market system, as shown on the Position Sizing window for the portfolio. Each market system may use a different position sizing method if desired, and the portfolio can mix stocks and futures. The program will search for the position sizing parameter value(s) that maximizes the chosen objective, subject to the drawdown constraint, if selected. The following table lists the parameter that is optimized for each position sizing method.
Position Sizing Method Optimized Parameter
Fixed size Number of shares/contracts/units Constant Value Position value
Fixed amount of equity Amount per share/contract/unit Percent Volatility Percent of equity
Fixed risk (fixed fractional) Fixed fraction (risk percentage) Profit risk method Percentage of profits risked
Fixed ratio Delta
Generalized ratio Delta
Margin target Margin as % of equity
Leverage target Leverage
Percent of equity Value of position as % of equity Max drawdown method Percent of maximum drawdown Notes to table:
1. For the profit risk method, only the percentage of profits is optimized. The percentage of initial account equity is unaffected by the optimization.
2. For the fixed ratio method, only the delta is optimized. The initial trade size and the delta fraction are unaffected by the optimization.
3. For generalized ratio position sizing, only the delta parameter is optimized. The exponent is not changed.
4. The following position sizing methods have no adjustable parameters and cannot be optimized: None, Kelly formula, Optimal f, and Maximum possible.
While the optimization is ongoing, the top part of the Optimize Position Sizing window will be dimmed, and the results will be displayed as they are generated in the bottom part of the window. The corresponding chart window will change to display the message “Optimization in progress. Please wait…” To cancel the optimization without saving the results, click the Cancel button at the bottom of the Optimize Position Sizing window. To cancel the optimization while keeping the best results found up to that point, click the Cancel Save button. After the optimization process is complete, the summary results will be displayed in the bottom part of the Optimize Position Sizing window. The complete optimization results can be displayed in a separate window by clicking the View Full Results button. Provided the optimization is successful, the chart window will be recalculated to use the optimal parameter value(s).
Options
There are several available options for optimizing position sizing. These options are available on the upper part of the Optimize Position Sizing window, whether for market systems or portfolios. One option is whether to optimize over all trades in the current sequence or using a sliding window. This option is only available for market-system documents, not portfolios.
When optimizing over all trades, the optimization looks for the position sizing parameter value that optimizes the objective over all trades in the current sequence. In other words, the optimization objective is calculated based on the performance statistics generated from the trades shown in the chart window. For example, if the optimization objective is rate of return, the optimization will try to maximize the rate of return calculated over all trades shown in the chart window.
The other choice is to optimize over a sliding window of trades. In this case, the user enters the number of trades in the sliding window, and the optimization is repeated for each window as it slides forward one trade at a time. For example, suppose there are 100 trades in the current sequence, and the user enters a sliding window size of 50 trades. The first optimization will be performed over trades 1 - 50. The optimization window then slides forward one trade, and the next optimization is over trades 2 - 51. The third optimization will be over trades 3 - 52, and so on until the last optimization is performed over trades 51 - 100.
In a sliding window optimization, an optimal result is obtained for each window. These optimal position sizing parameter values can be used in plotting the main chart window by selecting the Position Sizing Method tab in the Position Sizing window under the Analysis menu. On the Source drop-down menu in the Parameters section, select the option “sliding window opt, in-sample” or “sliding window opt, out-of-sample.” The former will cause the chart to be plotted using the optimal sliding window parameter values applied as optimized (in sample). The latter choice will apply the parameter value optimized over trades n - m to trade m+1. For example, the parameter value optimized over trades 1 - 50 will be applied to calculate the number of contracts for trade 51. In this way, you can test the optimization results "out of sample," without the benefit of hindsight. This is explained further in Chapter 14, Menu Commands, Analysis Menu Commands, Position Sizing Command.
Another option available for optimization is whether to optimize using the current sequence of trades or Monte Carlo analysis. This option is available for either market systems or
portfolios. Selecting "Current sequence of trades" from the "Optimize using..." section of the Optimize Position Sizing window instructs the program to perform the analysis calculations using the current sequence of trades, as shown in the chart window. Alternatively, you can select "Monte Carlo analysis" to instruct the program to perform the analysis calculations using Monte Carlo analysis. In this case, the optimization objective will be calculated using Monte Carlo analysis at the confidence level entered on the Setup window under the Options tab (Settings tab for portfolios). For example, if a confidence level of 95% has been chosen for Monte Carlo analysis and the optimization objective is the rate of return, then the optimization will use the rate of return at 95% confidence as the optimization objective.
There are two different search methods available for optimizing individual market systems. The default method, which is called the adaptive search method, iteratively subdivides the interval around the parameter being optimized until the optimal value is found. The alternative method is called the exhaustive search method. This method divides the search interval into evenly spaced values and evaluates every value within the interval. In almost all cases, the adaptive search method will be much faster than the exhaustive method. Consequently, the adaptive search method is recommended for most optimizations. The exception is when the optimization is for the number of shares/contracts/units in fixed size position sizing. In this case, the adaptive search method may fail to find a solution or may take longer than the exhaustive search method.
For portfolios, there is only one search method. Optimizing a portfolio involves searching for the best position sizing parameter values for all market systems simultaneously. An
There is one option that is only available when optimizing a portfolio. The option labeled “Start optimization at…” allows you to set the starting point for the optimization at the current position sizing values or at values chosen by the program. The former choice starts the optimization at whichever values are currently selected for calculating the equity curve, as displayed in the chart window. These values can be changed using the Position Sizing command of the Portfolio menu. This is often a good choice if you believe the current position sizing values are close to the optimum.
The latter choice (“Values chosen by program”) randomly selects the parameter value for each market system. Several randomly chosen sets of parameter values are generated, and the set that produces the highest value of the objective is selected as the starting point. Because not all randomly generated values will yield positive results or meet the drawdown constraint (if selected), some trials will be rejected. As a result, this process can be time-consuming. In effect, the process of finding the starting point in this manner is an optimization by itself. The benefit of this approach is that it can often yield results that are unexpected and often quite different than starting from the current parameter values. In fact, if the results obtained by starting at the current parameter values are not satisfactory, the recommended approach is to perform the optimization again starting at values chosen by the program.