Unicorn Trading
ProSizerTM Frequenly Asked Questions (FAQ)

(Well, they may not be frequently asked, but they are still good questions that deserve answers. Please read the documentation before asking questions.)

| Home | ProSizer | FAQ | Documentation | Competition | Purchase ProSizer |


Click on the Q: to jump to the answer. Press your Back button to return to this list of questions.

Data input


Interpretation and What-Ifs



Data input


Q: What numbers do I have to input?

A: The software requires you to have three columns of data, as shown in the first three columns on the lower left of this screenshot. You also have to set some numerical parameters, indicated by the pale yellow cells, and some position sizing model criteria in the dialog box.


Q: Is the input data given on a daily basis, or on a per trade basis?

A: Each data row is per trade, because all analysis is based on a closed-position equity curve. The first data column is profit or loss for the trade, the second column is the initial risk (stoploss) for the position, and the third column is the initial volatility (e.g. 20-day average true range) of the market when the position was entered. These values can be obtained from TradeStation by putting a call to the _SystemHistory function in your strategy's signal. _SystemHistory needs to be called on each bar, passing it your current stop price and the current Average True Range. _SystemHistory will create a file containing the required data for every closed position.


Q: Do I have to input the risk and volatility columns?

A: If you don't have that information, just put in a reasonable constant value representing each trade's initial risk (initial stoploss amount), and set volatility to some other reasonable constant approximating the average High-Low range of each bar. Be aware that doing this will render useless the two most powerful position sizing models: percent equity risked and percent equity allocated to volatility.

However, if you use TradeStation, these data are very easy to obtain simply by having your signal call _SystemHistory on each bar, passing it your current stop price and the current Average True Range. _SystemHistory will create a file containing the required data for every closed position.


Q: What should I use for volatility? "Average True Range" or "3-day high minus 3-day low" or what?

A: Whatever you want. 10-20 day average true range (ATR) seems to work pretty well, but any measure of volatility should give you a useful result. Some measures might give you better results than others. In my experience I have found that ATR is crude but causes the %volatility model to perform better than the other models. I suspect, however, that the best measure of volatility is probably something that doesn't depend on past history, such as implied volatility calculated from at-the-money option prices.


Q: Would you help me on using the function _SystemHistory with TradeStation? The function verfies in PowerEditor but I don't know how to make it look at the trades and export to a .csv file.

A: Just put a call to _SystemHistory somewhere in your code, so that _SystemHistory is called once on every bar. The arguments are a file name, your current stoploss price, and a volatility like AvgTrueRange(10).

I recommend that you keep the call to _SystemHistory in your signal all the time, but with an empty filename parameter "" (empty quotes). This will prevent _SystemHistory from executing until you want it.

Whenever you want to generate a trade history, simply change the filename parameter to some file name ending in .csv (be sure to include a full directory path in the file name), and press F3 in PowerEditor. This will force TS to execute your strategy over the entire history. Immediately change the filename back to "" and press F3 again to re-verify. This will disable _SystemHistory again; you don't want TS to keep adding to the file every time you make a change to your strategy. You now have a file that you can import into Excel.

That's all there is to it. Also, when specifying a file name, remember that certain character pairs preceded by a backslash (\) will generate errors in PowerEditor; see the warning in the _SystemHistory source code.

The current version of _SystemHistory outputs four columns, the last being Maximum Adverse Excursion. If you use ProSizer to analyze the trades, you don't need this last column. Just don't copy it into ProSizer.


Q: Do I just replace the figures in the first three columns and then fill in the cells U2 and U3 with the first and last row of my data?

A: NO! Don't modify the contents of anything but the pale yellow cells! Except for your data input columns, you shouldn't edit anything else but those pale yellow cells. All you need to do is delete all the data in the first three columns, then write in your own. You need do nothing else. The spreadsheet figures out how much data you have.

It's also a good idea to avoid inserting and deleting rows and columns, because the macros expect certain key cells to be in specific locations.

Feel free to reformat any cells you want (make them boldface, change the number of decimal places, whatever). Also feel free to edit any unoccupied cell. Just don't change the content of an already-occupied cell unless it's pale yellow.


Q: How many trades can I input? Can I increase this number?

A: ProSizer comes with space to input 600 trades. To extend this number, look for the instructions for adding more rows on the top right of the Data worksheet. Follow the instructions carefully. The procedure is simple, but not trivial.


Q: Should the data for profit include transaction costs? I see there's a separate cell in the spreadsheet for transaction costs. I'm confused.

A: Your data should be profit after transaction costs. That input cell isn't used for anything except displaying the calculation for expectancy. Expectancy isn't used anywhere, it's just displayed for information purposes. To calculate expectancy one has to know the size of a "scratch loss" (a small loss less than or equal to transaction costs) so that these losses may be ignored in the calculation.

If you use the _SystemHistory function to make TradeStation output your profits and losses, then transaction costs are already accounted for, provided you set your commission and slippage properly in your strategy.




Q: ProSizer doesn't do anything! It seems to have something to do with Excel security levels. What's wrong?

A: You need to enable macros. Newer releases of Excel are set so that macros cannot run by default. ProSizer wouldn't exist without macros. Go to Tools >> Macros >> Security and set the security level to Medium. This will cause Excel to ask you if you want to enable macros, each time you open a file that contains macros. ProSizer's macros are just iterative mathematical calculations, which are harmless and which you can examine; nothing is hidden from you.


Q: Do I get the source code?

A: YES! Everything is open to you. Nothing is protected, passworded, or hidden. Because nothing is protected, you can really mess up the macros if you insert or delete columns or edit anything besides the permitted inputs (yellow input cells and input data columns). The macros expect certain key cells to be in specific places.


Q: Is documentation available how to use it?

A: Yes. The documentation is provided on the "documentation" tab, which you can see at the bottom of this screenshot. The documentation is also reproduced here.


Q: What's the "margin call" result I see on the data worksheet?

A: ProSizer has a crude way of generating margin calls. Margin calls occur in ProSizer whenever the equity is reduced below the margin required to enter the previous trade. This isn't realistic; in real life a margin call would happen only when the equity drops below the maintenance margin required to stay in the previous trade. The mainenance margin requirement is usually less than the initial margin requirement. ProSizer's margin calls therefore represent the most conservative possibility. If you see any, then consider it a sign that your position sizing strategy might be too dangerous.


Q: Can ProSizer do "Optimal-F" analysis? I don't see that capability.

A: Yes, ProSizer can do this. It's explained in the documentation. Optimal-F is merely ProSizer's Fixed Fraction model, where the model parameter is adjusted for maximum return without regard to drawdown. You can see how Optimal-F performs by setting ProSizer to use the Fixed Fraction model and adjusting the parameter until the mean return is maximized. Ralph Vince's Optimal-F strategy arrives at this optimal parameter value via a different method, but the end result is still the same.

One reason I developed ProSizer was because none of the Optimal-F literature dealt with Monte Carlo simulations and the associated statstistics. Also, nobody in their right mind would ever trade at the Optimal-F point due to the gut-wrenching drawdowns involved (80% or more). Furthermore, the fixed-fraction model on which Optimal-F is based performs poorly if you want to trade at a more reasonable drawdown level, compared to other models. ProSizer lets you decide what drawdown you can stomach, and then lets you see what model gives you the best return for that drawdown.


Interpretation and What-Ifs


Q: How would ProSizer work if my strategy enters the market with multiple contracts and then scales out of the market by a 25% of the original number of contracts on the entry (for example, my strategy goes long 4 contracts and sells 1 contract up to 4 times along the way)?

A: This is not a position sizing strategy, it's an exit strategy. Van K. Tharp addresses this in Trade Your Way to Financial Freedom, an excellent book which I highly recommend. Basically, such strategy gives you emotional comfort because you seem to be "insuring" your profits. To quote Tharp (p. 265), "if you step back from this sort of exit and really study it, you'll see how dangerous this type of trading is. What you are actually doing ... is practicing reverse position sizing. You are making sure that you will have multiple positions when you take your largest losses... [and] that you only have a minimal-sized position whain you make your largest gains. It's the perfect method for people with a strong bias to be right, but it doesn't optimize profits or even guarantee profits." In other words, you're taking partial profits with full losses, thereby reducing your expectancy without reducing your risk.

Because of this, I didn't design ProSizer to handle such a strategy. Nor can it anyway, because the data you input are profits and losses of closed 1-lot trades; it uses no intermediate data.


Q: How would I find the best position sizing strategy for my trading system? What do the results tell me?

A: Here is what I suggest.

  1. Input your data into the first three columns of the Data worksheet. Delete any old data.
  2. Set the number of Monte Carlo iterations to 100 or less, so that it calculates reasonably fast but still gives valid statistics. Set it higher if your computer is fast.
  3. Check the "non-unique trades" checkbox if you have a small number of trades (like 50 or less). It doesn't hurt to leave this checked if you have a large sample, although calculations will be slowed by a factor of five.
  4. In the dialog box, select one position sizing model, and leave the other set to "none." Each position sizing model has a corresponding yellow parameter cell above the dialog box. (The fixed-ratio model uses two cells, 10000/delta and lot size. I personally don't like this model because it doesn't consider equity or risk, but I included it by popular demand.)
  5. Now decide how much drawdown you are willing to endure; say, 20%. Adjust the model parameter until the mean of Maximum Drawdown in the Monte Carlo results is about 20%. It should take less than a dozen adjustments.
  6. Write down the statistics such as mean return, maximum drawdown, return/drawdown ratio and the corresponding model input parameter that produced them. You may want to note the +2 and -2 standard deviation values, which give you a good idea of the minimum and maximum expected values of these results.
  7. Go to step 4 to select another position sizing model and repeat.

When you are done, look at what you wrote down. You should see one clear winner that gives you the maximum return for your chosen maximum drawdown.

You can squeeze out some additional performance by taking your two top performing models and combining them in the Combo worksheet. I have found it seems best to have a combination that chooses the maximum number of lots generated by each model in the combination, but you may get different results depending on your data.

  1. In the combo worksheet, set the yellow cells and position sizing models. Remember to set the drawdown cutoff to 20 percent, as this was your cutoff earlier. Initially, set the table axes to wide ranges, for example 2 to 60. This will give you a "big picture" view of your parameter space. It doesn't matter in which direction the axes increase. Set the Monte Carlo iterations to a low number like 30 for now, and press Calc. It will take a minute to calculate all the combinations.
  2. In the colorful table, look for the boundary between the boldface and non-bold cells that occupy the brightest color that contain values overall larger than the rest of the table (with only 20 iterations these values will have a lot of variability). Note the axes ranges around this area. Re-scale the axes. Now set the Monte Carlo iterations to 100 and press Calc. In this way you can zero in on the optimum combination of the two models. If you get scattered colors rather than contiguously-colored areas, you need more iterations.
  3. Once you find a combination that looks good (see the documentation for criteria on what "good" means), go back to the Data worksheet and test this combination for 500 or more iterations (I use 2000), and compare it to what you wrote down for the individual models earlier.

You will likely find that the optimum combination that gives you the same mean of maximum drawdown, is slightly better than any of the models individually.


Q: I have trades generated by a portfolio of things, not just one issue. Can I still use ProSizer to evaluate position sizing models?

A: Yes and no. There is the problem of different margin requirements for each issue, for one thing. You can, of course, just put your list of trades into ProSizer and get a useful result, provided you understand that the results won't represent real trading as it would if you had just one issue.

Here we run into a limitation of this type of Monte Carlo analysis. When trading a portfolio of issues rather than single issue, your trades exhibit serial correlation; that is, your trades are not independent events. What does this mean for position sizing? In reality, when you enter a new position, you would base the number of lots on your total equity including the profit and loss from your already-open positions. So, the size of new positions depends on the outcome of other open positions that coexist simultaneously.

While portfolio-based Monte Carlo simulations do exist (see the Competition page), ProSizer assumes that you have no serial correlation. That is, each trade is an independent event; only one position is open at a time. This is a safe assumption when trading on one issue with no pyramiding. However, if you apply ProSizer to a series of trades from a portfolio, understand that ProSizer cannot base position sizes on open equity because it assumes all equity is closed equity at the start of each new position.


Q: What if I have a strategy that trades spreads? Can I still use ProSizer?

A: Of course. All you need are profit/loss data from each spread. Each spread must be the same size (number of shares or contracts must be constant for each trade).

Initial stoploss and some measure of spread volatility would be useful for ProSizer too, because then ProSizer could make use of the more powerful %risk and %volatility strategies, but without them you can still use Fixed Fraction.

Ideally each spread should be independent, opened at once and closed at once, not one leg closed and re-opened in another stock or expiration month or whatever, and no multiple overlapping spreads. Overlapping positions imply that you have a portfolio. ProSizer isn't the best tool for portfolio optimization, although you can still use it and get a useful result.


Q: If I'm simulating fixed lot size, and I don't check the "Non-unique trades (replacement)" option, nothing gets displayed on the %Return distribution graph. Is this a bug?

It's not a bug. If you have a fixed lot size, and you don't check the "Non-unique trades (replacement)" box, you are using all the trades in your original sequence exactly once, and you will get the same return no matter how you scramble the trades. If you add up the profits and losses for all your trades exactly once, they will always add up to the same number no matter what order you add them up. There is no distribution if all returns are the same, therefore nothing can be displayed in the %Returns graph.

This happens becasue fixed lot isn't position sizing. Any of the other position sizing algorithms will scale the profits and losses up or down, differently for each scrambled sequence, and this will result in a distribution of returns.

If you do check the "Non-unique trades (replacement)" box, the %Returns graph displays a distribution. Instead of scrambling the original sequence, ProSizer instead randomly chooses trades from the original sequence to build up a new sequence. This is known as "selection with replacement" -- some trades may get selected more than once, or not at all. In this case you do get a different return for each sequence because not all the same trades are being used each time. Because each sequence has a different return, the %Return graph will show a distribution of returns.

| Home | ProSizer | FAQ | Documentation | Competition | Purchase ProSizer |

Copyright © 2004 by Unicorn Research Corporation
All rights reserved.