Position Size Simulator

In Van Tharp's Definitive Guide to Position Sizing, Dr. Van Tharp asserts that position sizing is the most important aspect of a trading system. He goes on to say that the optimal position size will vary from trader to trader according to their personal objectives and definition of ruin.

To illustrate, Dr. Tharp offers six definitions of what might be considered optimal. He then subjects a number of theoretical trading systems to a position size simulator in an attempt to find the position sizes that optimize each of the six definitions.

This web page has been constructed to allow traders to experiment with the same theoretical systems, using an equivalent simulator. During the testing of the tool, it was discovered that there are a number of typographical/calculation errors printed in the book, some of which are summarized at the bottom of this page. Email correspondence with the Van Tharp Institute has confirmed that they are aware of the errors. Otherwise, the trader should see generated results that are comparable with what was published in the book.

Note that naturally occurring variance between runs of the same experiment are to be expected, despite using the same parameters. The greater the number of simulations run in an experiment, the more reproducible it will be.

You need a Java enabled browser to use this simulator.

Usage

To run an experiment, simply select a predefined trading System and enter input values for each of Initial Equity, Objective, Ruin, Trades, and Simulations. Then, press the Run button. Each of these are defined in more detail below.

The simulator will simulate trade results using a percent risk position size for each of 0.2% through 30%, incrementing by 0.2%. Sizing by percent risk refers to limiting the total initial risk of a position to a fixed percentage of equity. For example, assuming a 5$ per share initial risk sized using 1% of a $100,000 initial equity, position size would be 100,000 multiplied by 0.01 divided by 5 giving 1,000/5, or 200 shares.

When running, a "busy bar" will appear next to the Run button and the input areas will be temporarily disabled. Upon completion, the busy bar will disappear, the input areas will become re-enabled and the results will be output in a tabular format similar to the presentation of the book. Changing any of the input values after a completed experiment will cause the output table to clear its values in anticipation of the next run.

The time required to complete an experiment will depend upon the power of the user's computer. An aging, single core, 1.4Ghz laptop with 1GB of memory can perform 10,000 simulations of 100 trades in under 10 seconds. The simulator will leverage up to 8 cores, making multi core machines significantly faster.

System

A number of systems have been defined in the book. This simulator presents those defined in Chapter 3 and Chapter 11.

R Multiples

For each system, the R Multiple distribution is presented. Strictly speaking, systems SQN1-SQN7 are closed systems. As such, the R Multiples are exact counts, as opposed to probabilities. For the remainder of the systems, the table represents the probability of any given trade resulting in the listed R Multiple. R is defined as the initial risk of the trade. For example, a stop loss $5 below the purchase price of a stock would represent a $5 initial risk. An R Multiple is defined as the final result of the trade expressed as a multiple of the initial risk (i.e. as a multiple of R). For example, if that same trade closed with a $7.50 gain, then the R Multiple would be $7.50/$5.00 giving +1.5R. Similarly, had the trade closed at a $1 loss, the R Multiple would be -$1.00/$5.00 giving -0.2R.

Basic Information

For each system, summary statistics are provided. Again, for systems SQN1-SQN7, the statistics (e.g. Standard Deviation) should be calculated assuming a total population, as opposed to a sample. However, for simplicity of the simulator, all systems are treated as a sample of trades from a larger population. The difference is negligible for the number of trades being considered. Included in the basic information is a System Quality Number (SQN). This value represents an empirical measure of the quality of the system, where larger values are better than smaller values, and values below 1.7 represent an unreliable system. For most systems, both the standard deviation and the resulting SQN have been miscalculated in the book.

Initial Equity

Initial equity is assumed to be the account balance prior to taking the first trade. In each of the systems evaluated in Chapter 11, the initial equity is stated as being $100,000. The simulator allows a minimum of $10,000 to a maximum of $1,000,000 at $10,000 increments.

Objective

Objective represents the trader's desired gain by the end of the given number of trades. The objective is expressed as a percentage of initial equity (e.g. an Objective of 300% indicates a desire to have a final equity of at least $100,000 + ((300/100) x $100,000) giving $400,000). In each of the systems evaluated in Chapter 11, the objective is stated as being 300%. However, in some cases the actual objective used appears to have been 100%. The simulator allows a minimum of 10% to a maximum of 1,000% at 10% increments.

Ruin

Ruin represents the loss at which the trader would stop trading the system. Ruin is expressed as a percentage of initial equity (e.g. a Ruin of 50% indicates a tolerance of up to a (50/100) x $100,000 = $50,000 loss). If at any point ruin is reached before the given number of trades, that series of trades is terminated and the next simulation of trades is started. In each of the systems evaluated in Chapter 11, ruin was stated as being 50%. The simulator allows a minimum of 1% to a maximum of 100% at 1% increments.

Trades

Trades is the number of trades to simulate for each simulation. The gain from each trade is calculated as the percent risk (i.e. the position size) multiplied by the running equity multiplied by a randomly chosen R Multiple. That gain is then added to the running equity for use in the next trade's calculation of gain. In each of the systems evaluated in Chapter 11, trades was stated as being 100. The simulator allows a minimum of 10 trades to a maximum of 1,000 trades at 10 trade increments.

Simulations

Simulations is the number iterations to perform the given number of trades at each of the percent risk increments. In each of the systems evaluated in Chapter 11, simulations was defined as 5,000. That is to say that 100 trades were simulated 5,000 times at each risk level ranging from 0.2% through 30%. The simulator allows a minimum of 1,000 simulations to a maximum of 250,000 simulations at 1,000 simulation increments. A minimum of 10,000 simulations is recommended in order to have repeatable results. More is always better.

Understanding the Results

The results table will contain one row for each of the six proposed definitions of optimal.

Approach

  1. Maximum average return refers to selecting the percent risk that results in the greatest average return of all simulations in the experiment. In reality, this is not a recommended approach since a single simulation resulting in a huge gain can raise the average return even when all remaining simulations result in ruin. This approach illustrates why a simple backtest of a trading strategy may not be sufficient to begin trading with real money. Only through simulation do we begin to see the alternative outcomes.
  2. Maximum median return refers to selecting the percent risk that results in the greatest median return of all simulations in the experiment. The median return is the return at which half the simulations finished above that level and half finished below that level.
  3. Maximum probability of reaching objective refers to selecting the percent risk that results in the greatest number of simulations ending with a gain equal or greater than the stated objective.
  4. Probability of ruin under 1% refers to selecting the greatest percent risk that still results in fewer than 1% of simulations reaching the stated ruin.
  5. Probability of ruin above 0% refers to selecting the lowest percent risk that still has some simulations (i.e. more than 0% of simulations) reaching the stated ruin.
  6. Maximum difference between probabilities of objective and ruin refers to selecting the percent risk that results in the greatest spread between the probability of reaching the objective and the probability of ruin.

Optimal Risk (%)

The percent of equity to risk on each trade (i.e. position size) in order to maximize the approach.

Probability of Objective (%)

The probability of achieving the given objective, after having made the given number of trades sized per optimal risk.

Probability of Ruin (%)

The probability of ruin, when attempting to make the given number of trades sized per optimal risk.

Average Gain (%)

The average gain, above initial equity, after having made the given number of trades sized per optimal risk.

Median Gain (%)

The median gain after having made the given number of trades sized per optimal risk.

Caveats

The user should be aware that there are a number of assumptions built into the simulation approach, with respect to number of simultaneous trades, distribution of trade results, degree of representation of the data, etc. It is recommended that the user refer to the book for more detail.

Errata

  1. In the book, Systems SQN2-SQN7 have incorrect values for standard deviation, and by extension for their calculated System Quality Number which is dependant upon the standard deviation. Similarly, the standard deviations are incorrect for the systems presented in Chapter 11, though to a lesser degree.
  2. The simulation results of Chapter 11 are stated to have been based on 5,000 iterations of 100 trades, using an initial equity of $100,000, an objective of 300% gain above initial equity, and using a definition of ruin as being a 50% drop below initial equity. However, some of the results appear to have actually been based on a 100% gain (e.g. System 11-1, 11-5, 11-6).
  3. The simulation results of Chapter 11 are stated to have been calculated for each risk level from 0.2% to 30%, at a 0.2% increments. Yet, some result tables in the book show odd value risk levels (e.g. System 11-5, 11-6) suggesting that, in reality, not all tables were produced using the same even value risk increments.