or return to October 1998 Contents
NOTE FROM UKRAINE
Editor,I am deeply impressed by the high quality of your journal. It was a great pleasure to read articles in different areas of technical analysis.
VLADIMIR KHRAPKO
Dept. of economics and management, Simferopol State University, Simferopol, Crimea, Ukraine
DAYTRADING STOCKS
Editor,A few months back, I wrote you requesting articles on daytrading the financial markets. In the August 1998 issue, an article by Mark Conway, "Daytrading stocks," was published dealing with the new techniques of daytrading. Well, I'd like to congratulate you on such an informative and excellent piece. It shows just how sensitive you are to the needs of your readers and how responsive to our requests. The quality of your magazine is self-apparent.
P.S. It's subscription renewal time again for me, and as they say in the military, I intend to "re-up."
Thank you for writing! -- EditorHAROLD ERWIN
via E-mail
DISCOVERING THE GANN TREASURE
Editor,I bought Robert Krausz's book A Gann Treasure Discovered earlier this year. [We excerpted the book in our February 1998 article, "The new Gann swing chartist." -- Editor] The book caused me to reread Krausz's past STOCKS & COMMODITIES articles. I have been learning to trade for 10 years. I wanted Krausz to know how valuable his book and articles are to me and how much I appreciate his insights. At last I have something that is clear, fairly simple and makes sense. I have been able to begin trading confidently and consistently. Losses, when I have incurred them, have been smaller than in the past.
STEVE WALKER
Dallas, TX
TRADING CONTRACTS
Editor,I have a question about evaluating systems. I have backtested a system that generated its first signal on November 7, 1996. However, that signal was generated on an August 1998 gold contract. How would one take advantage of such early signals, when most trading takes place in contracts that are usually three months out or less?
You need to build a historical database using continuous contract data. Please see "Using percentage-based back-adjusted data" by Enrico Donner in our September 1998 issue for an example of how to do so. -- EditorRALEIGH
via E-mail
ON APPLYING LINEAR REGRESSION TO TIME SERIES DATA
Editor,The sequence of open-high-low-close (OHLC) bars of a stock share or other financial instrument forms a statistical time series. Each closing value of each bar in the time series (Yt) is autocorrelated to the prior values of the series (Yt-1, Yt-2, Yt-3...Yt-n) and is measured by the autocorrelation coefficientk. Thus, each Yt value is dependent in some manner on prior values of Yt. In statistical terms, the Yt values are not independent realization of a random variable.
Further, due to the autocorrelation inherent in the time series, the error terms from a linear model of the Yt will be correlated. This autocorrelation of the error terms can be measured by the Durbin-Watson test (see Neter & Wasserman, 1974, for a good discussion of this test).
These two features of Yt in a time series seriously confound two of the five important assumptions for using linear regression models on raw time series data (Yt). Yet many articles (as a recent example, in STOCKS & COMMODITIES, "Surfing the linear regression curve with bond futures" by Dennis Meyers in May 1998) discuss indicators and trading methods that apply linear regression to the raw time series Yt.
To make matters worse, time series in the capital markets usually have trends in them (those ethereal things we traders seek to ride to riches). As a result, most time series are nonstationary (to use the econometrics term) and cannot be modeled using econometric techniques (autoregressive models, moving average models and combined autoregressive moving average models being but three types) until the trend has been removed from the time series.
The simplest method available to achieve detrending is first-order differencing (1) of the time series. This is a simple computation (1 = Yt - Yt-1); subtract the closing price of yesterday Yt-1 from today's Yt to create the first-order difference (1) of the time series. This calculation is simple to implement as an indicator in MetaStock (C - ref(C,-1)). Now model this time series with linear regression if you must.
Better still, use AR (autoregressive models), MA (moving average models) or combined ARMA (autoregressive moving average models), which are used daily by econometricians all over the world (mind you, economists are a terrible advertisement for predictions of economic outcomes!). These econometric techniques build on the inherent autocorrelation structure of time series data. Chatfield (1975) is an excellent introduction to this class of techniques.
Alternatively, apply the Lowess function to the time series (Becker et al., 1988) using the statistics package S. Better still, use chaos models of time series. They are the new statistical frontier of time series modeling. But please, don't use linear regression to model time series.
Here are my references:
Becker, R.A., J.M. Chambers, and A.R. Wilks [1988]. The New S Language: A New Programming Environment for Data Analysis and Graphics, Wadsworth & Brook, Pacific Grove, CA.
Chatfield, C. [1975]. The Analysis of Time Series: Theory and Practise, Chapman Hall, London.
Meyers, Dennis [1998]. "Surfing the linear regression curve with bond futures," Technical Analysis of STOCKS & COMMODITIES, Volume 16: May.
Neter, J. and W. Wasserman [1974]. Applied Linear Statistical Models, Irwin.
Dennis Meyers replies:BILL FITZGERALD
via E-mailThank you for your letter detailing some of the perils in applying linear regression to time series data. This same list of perils applies to most mathematical or statistical techniques applied to an economic time series in a fixed test period.
Without your intending to do so, your letter provides added support for my assertions in my past articles; that is, that statistics derived from the test sample are meaningless and are of no value in prediction if the model is to perform on data it has not been derived from (that is, out-of-sample data). The only statistics provided in that case, if they are valid, is how well a model has curve-fitted the data.
Your logic is flawed with respect to taking the trend out of the data before applying linear regression. First, we are looking for the trend. It is the change in trend as we move forward in time that drives the model. Second, it is completely immaterial what the derived statistics are in the test sample. They are meaningless with respect to predicting how the system will perform in the future. The only statistics that mean anything are how well the system performs on extensive out-of-sample testing.
I gather you are fond of trumpeting the more advanced mathematical techniques of AR, ARMA, and so on, as better modeling techniques. But there's not a shred of proof that these advanced mathematical techniques yield better trading results than simple breakout techniques. In addition, your mathematical references are out of date with respect to modern advanced modeling techniques.
The mathematical techniques of AR and ARMA were originally derived to deal with signals and noise from missiles, satellites, spacecraft, moon landings and other scientific problems. Noise processes in economic time series are not well defined and are certainly not the same as electromagnetic, planetary or instrument noise from communication, rocket and space projects. The mathematical techniques of AR and ARMA make assumptions about noise processes. Many of these assumptions were based on observations from missile and communication data. These same assumptions may not accurately describe the noise processes intrinsic in economic price series, and thus these techniques may produce no better results than the simple moving average.
The basic fact remains: Without extensive out-of-sample testing of a system, no matter what mathematical techniques are used, there is no way to predict with any probability how that system will perform in the future.
SECURING OPTIMAL F
Editor,In your July 1998 issue, you published an article titled "Secure fractional money management." The technique uses Ralph Vince's optimal f, and purports to limit the drawdowns that occur when optimal f is applied. But the authors do not consider the biggest problem with optimal fapplications.
Optimal f is a random variable. It depends on the largest loss experienced to date and all the trade results to date. Because these variables are subject to large statistical fluctuations, optimal f is subject to random variations. The method set forth by the authors does not address the drawdowns that can occur when future trades are subject to an optimal f different from the calculated value.
A partial solution is to just replace the largest loss to date in Vince's formula with a conservative choice of a larger loss. Still, the resulting optimal f will be exposed to large variations from the trade history employed. The best way to address these problems is to simply rerun the optimal f calculation over several different time frames containing the same number of trades and then average the results for optimal f. That way, the result will be much more "secure."
PAUL H. LASKY
via E-mail
INSECURE ABOUT SECURE F
Editor,The article "Secure fractional money management" by Leo J. Zamansky and David C. Stendahl that appeared in the July 1998 issue of STOCKS & COMMODITIES contains a major error. Optimal f is not the percentage of equity to trade, as stated in the article. Optimal f is used to figure the number of contracts to trade:
The equations that the authors give are correct, but because of their error in thinking, they misapply the equations.
In the example of the three series given in the article, the authors correctly come up with an optimal f of 1/3. But then to interpret this as being able to buy only three contracts is wrong. Using their interpretation, you could buy only three contracts in each of the series and end up with $101,500, a terminal wealth relative (TWR) of 101,500/100,000 = 1.015. This is far from the TWR of 1.185 that is seen in their Figure 3. Using the correct interpretation, you don't buy three but 66 contracts!
66.666 = 100,000 * 1/3/(500) You always round down the number of contracts. Then, after winning $33,000 in the first, the second series gets 88 contracts: 88 = 133,000/(1,500). The third series gets 118 contracts: 118 = 177,000/(1,500). You end up with $118,000, giving TWR = 1.18.
The authors' calculation of maximum drawdown of $7,500 is dwarfed by the actual maximum drawdown, which is 5/3 of equity, or $220,000, as it occurs in series 2. The correct value of the secure f is 0.01.
Perhaps the authors became confused with equalized optimal f (see page 83 of Ralph Vince's The Mathematics of Money Management). In this method, you can come up with a number that is a fraction of equity to trade with, but this number is neither f nor optimal f. (As far as I know, Vince does not identify this fraction, but it is evident from his equations.) In this method, you use the percentage loss or gain for each trade. In the authors' example, the trades become ($500/$10,000 = $0.05, 0.05, -0.05) instead of ($500, 500, -500). In this case, the equalized optimal f = 1/3; it is the same as optimal fbecause the buy price was always $10,000. Now use this equation:
For the equalized optimal f of 1/3, the fraction of equity is 666.7% = (1/3)/(0.05). Yes, this does mean you are buying on margin. For the equalized secure f of 0.01, the fraction of equity is 20%.
After getting every other interpretation wrong, the authors do come up with the correct final answer of 20%. This leads me to believe that they do have access to a program that correctly generates these numbers for them.
Despite my criticism, Zamansky and Stendahl are to be congratulated for the idea of secure f. Fixed fractional money management is a wonderful and complex subject that deserves some attention. Too bad this article got the fundamentals wrong.
Leo Zamansky and David Stendahl reply:BRADEN A. BROOKS
via E-mailThank you for the feedback about our July 1998 article, "Secure fractional money management."
Mr. Brooks is correct in saying that according to Ralph Vince, the formula is number of contracts = (equity) * (optimal f) / (- profit of worst trade). He is also correct that according to this formula, we buy 66 contracts, not three. However, as we assumed in the article, one contract price is $10,000. To buy 66 contracts, we need to have enough money to buy 66 contracts at $10,000 each. That makes 66*$10,000 = $660,000. And that amount should be only one-third of the total capital available, which, as stated, is $100,000. The question we are answering is: How many contracts can we buy following optimal f? The answer is $33,000 / $10,000 = 3. If the contract price were $500, then the number of contracts to purchase would be exactly 66. If the contract price were less than $500, then the number of contracts to purchase also would be exactly 66.
Vince, in his book Portfolio Management Formulas, states on page 80, "Margin has nothing to do whatsoever with what is the mathematically optimal number of contracts to have on." We emphasize the word mathematically. In real trading, if you need to buy one contract, you need to have a certain amount of money in your account, say x, and if you buy n contracts, you need to have the amount of money equal to n*x. In the article's example we call it price, but in reality it is a margin requirement. In other words, the formula for the number of contracts should be adjusted to the price of the contract and be modified to look as follows:
We agree that we should have specified that. Of course, if you follow this number of contracts purchased, the TWR is not going to be 1.18, because the contract price is too high and does not allow you to buy the number of contracts that would maximize it. However, the lower the price of a contract, the closer you will come to the calculated maximum of TWR.
We develop tools to use in trading futures. We cannot introduce a calculation that is not based on real trading rules. In real futures trading, the margin requirement per contract always exists and has a very similar meaning to the contract price in the game introduced.
As to the software we use to obtain our results, we use only the software written by us. In fact, readers can download the secure f calculator from our Web site, as mentioned in the article, and run it to obtain values for both secure fand optimal f. This should demonstrate the validity of this approach.
We appreciate the feedback from Mr. Brooks, who makes the important point regarding the difference between optimal fas a mathematical concept and trading using optimal f given the constraints imposed by the reality of futures trading.