TRADING SYSTEMS USING NEURAL NETWORKS TO FORECAST PRICE MOVEMENT

By Lou Mendelsohn

With this offering, STOCKS & COMMODITIES contributor Lou Mendelsohn concludes his examination of neural networks for financial forecasting in today’s globalized trading environment. Here, Mendelsohn concentrates on implementation issues and discusses how neural networks should be utilized as part of an overall trading strategy. Finally, he takes a brief look at the future of artificial intelligence technologies to implement synergistic market analysis.

No discussion of the design, training and testing of neural networks could be complete without addressing the topic of implementation. How can a neural network, or combination of networks, be integrated into information systems and trading systems? Here is an example that uses many of the concepts of neural network development covered previously: training and testing, preprocessing, fact selection, input selection, architecture and paradigms.

INFORMATION SYSTEMS
Information systems utilize neural networks to give the user predictive information on the target market, such as price forecasts, possible market direction or projected turning points. In this type of system configuration, the trader can use the predictive information alone or with other available analytics to fit his or her trading style, risk propensity and capitalization. Such systems can comprise a single neural network or multiple networks working in concert. In a multi-network system, each network can be designed and trained to forecast the market independently. For example, four separate networks might be used to forecast the high, low, short-term and medium-term trend direction during the following, day’s trading. Because these four market predictions are independently derived, the can be viewed separately and used to confirm one another.

In addition, with a more complex architecture, each of these network outputs can be used as inputs to another network, which might then be used to make other forecasts, such as predicting market turning points. Network architecture as depicted in Figure 1 is referred to as a hierarchical neural network. By encapsulating functionality into each network, one large network does not need to do all the work: in this design, predictions derived from networks at one level of the hierarchy are incorporated as inputs into a network, or networks, at another level. This kind of architecture lends itself to faster training, as each network focuses its learning, solely on its own output.

TRADING SYSTEMS
Neural networks can also be incorporated into formal trading systems in a number of ways. First, a network might be trained to generate buy, sell and stand-aside signals. This configuration is appealing, but problems arise in implementing it. This type of system requires the trader who is going to use it to play an integral role in its development. This is necessary because the network will generate its trading signals in the final application based on the buy/sell points identified by the developer in training the network, in addition to the choice of selected input data and preprocessing performed during development.

For a specific market during a given period, various traders, whether individual speculators or institutional money managers, might have entirely different trading strategies from one another and so would not necessarily have identified the same buy/sell points during the network development. Thus, if a trader with limited funds and only a limited ability to tolerate drawdown were to design and train this type of neural network, it would probably not generate signals that would be appropriate for another trader with greater capitalization or higher risk tolerance. In addition, it could be difficult to incorporate risk management considerations into a neural network-based trading system.

Another possible configuration would use a neural network as part of a hybrid trading system. The neural network would function solely as an information system that would generate predictive information used with a set of rules generating the trading signals. This approach might involve the formulation of relatively simple mathematical rules or the development of a full-blown expert system. In either case, the rules would be devised to match the trading style and objectives of the trader who would ultimately rely on the system during actual trading.

MIX AND MATCH
Neural network development as we have set forth here involves architectural decisions, input selection, preprocessing, fact selection, training, testing and implementation. We have examined each phase of neural network development in the context of the globalization of the world’s financial markets and the need for a synergistic framework, combining analysis of technical, fundamental and intermarket data to capture the market synergy, in financial markets today. While an in-depth discussion of developing an actual neural network-based information or trading system is beyond our scope here, the following is an example to help illustrate these points.

For each of four target markets (yen, Treasury bonds, Eurodollar and the Standard & Poor’s 500 index), two sets of neural networks were developed to predict changes in the high from one trading day to the next. The first set of network inputs were derived from technical market data consisting of price, volume and open interest information internal to the target market. The second set of networks utilized the same inputs as the first set, plus seven external intermarket inputs. Because the same steps and decisions listed below were applied to all four target markets, we will discuss as our example just one, the yen. But first, here is a summary of the various phases of neural network development that will be utilized on our example target market and the decisions made in each phase:

  1. Paradigm A feedforward back-propagation system was chosen, as it is one of the most common paradigms used in financial market analysis.

  2. Architecture The sigmoid transfer function was utilized along with one hidden layer consisting of five nodes, chosen based on experience and the planned size of the network.

  3. Input selection As mentioned previously, price, volume and open interest data on the target market was used as the raw input to the first set of networks. The second set used the same input data as the first, plus seven additional intermarket inputs. For the yen, the second set of nets included data from the Nikkei stock index, Treasury bonds, Swiss franc, Deutschemark, US Dollar Index, Eurodollar and British pound.

  4. Preprocessing Simple preprocessing, including differences in price data, simple and exponential moving averages and stochastic indicators, were used for both sets of nets. The second set’s intermarket input preprocessing consisted of taking spreads between the target market and each of its related inter-markets. All inputs were normalized by clipping outliers beyond two standard deviations and then linearly scaled.

  5. Fact selection Approximately 1,200 fact days spanning 1988-92 were selected. Of these, 800 were used for training and the remainder for testing.
  6. Training and testing A fully automated training testing regimen was utilized. To simplify training, the learning rate was held constant and momentum not used. Each network was trained with testing performed at set intervals, at which time the network was evaluated on five different error measures, including average error and RMS error. If the network’s performance based on and of these criteria yielded an improvement, that network was saved. Thus, at the end of training for each target market, 10 networks in all were found (five for each set), representing the best one for each error statistic. To simplify the presentation, only the results of average error are shown in Figure 2.

  7. Implementation A network like the one described above is ideal for incorporation into an information system. By predicting the high for the next trading day, it provides information useful in setting stops and is an excellent indicator of intraday resistance levels. For actual trading, a considerably more sophisticated network configuration than the one presented in this study would be used.

Figure 2 depicts the average error when predicting tomorrow’s high on the test set data. The average error is computed by first determining the absolute value of the error for each fact in the test set and then determining the mean of all of the error values. The first column on the left shows the four target markets, while the second column shows the error associated with the first set of networks that used no intermarket data during training, only the market data from the target market itself. The third column represents the error for the second set of nets that did utilize intermarket data. Finally, the fourth column indicates the percent reduction in error that results from using intermarket data during training, computed by taking the difference between the average errors in columns 2 and 3 and dividing by the value in column 2.

As evinced by these results, even minimal use of intermarket data can improve network performance. The network’s average error was reduced by between 1.9% on Treasury bonds and 6.5% on the S&P 500. With the use of more extensive input data, in addition to more sophisticated preprocessing, the altering of training parameters during training and the use of other training and testing criteria, predictive accuracy can be increased further.

LOOKING AHEAD
Neural networks are an excellent tool for combining otherwise disparate technical, fundamental and intermarket data within a quantitative framework for synergistic analysis. Hidden patterns and relationships between a target market and related inter-market can be found through the use of neural nets. In today’s global markets, it would be unwise to ignore such valuable data by focusing too narrowly on single-market analysis.

But neural network technology is just a tool. It is a means to an end, not the end itself. As traders and market analysts strive to understand the financial markets and their interrelationships through the use of various analytic tools, harnessing neural networks represents just one piece of the puzzle but other pieces are still missing.

Of course, other technologies such as expert systems and genetic algorithms will take their place alongside neural networks in financial analysis. Genetic algorithms, which mimic the characteristics associated with evolution, are well-suited to optimization problems such as optimizing neural network parameters. The same technology incorporated into genetic algorithms has also been used in classifier systems and genetic programming. Classifier systems perform a type of machine learning that generates rules from examples, while genetic programming goes even further by automatically generating a program from a set of primitive constructs. The use of these technologies could be next on the financial forecasting horizon.

The mathematics of fuzzy logic, wavelets and chaos are also being applied in a multitude of domains, including financial forecasting. While all these technologies will continue to expand, new ones will undoubtedly emerge soon. But traders should not be fooled into believing that any of these tools is the long-sought answer to trading, the ultimate artificial intelligence tool that will single-handedly produce consistent profits in global financial markets.

To implement synergistic market analysis effectively in the 1990s, various analytic technologies will have to be used. To accomplish this effectively, the strengths and weaknesses of these technologies must be understood so that they can be utilized with one another for maximum effectiveness and maximum gain.

Lou Mendelsohn, 813 973-0496, fax 813 973-2700, is president of Market Technologies Corporation, Wesley Chapel. FL. He was one of the pioneers of historical simulation and back-testing in personal computer software in the early 1980s and introduced the concept of synergistic market analysis through the application of neural networks for financial forecasting. Mr. Mendelsohn thanks James T. Lilkendey and Phillip Arcuri of the Predictive Technologies Group for their assistance in the preparation of these articles.

REFERENCES
Hecht-Nielsen, R. [1990]. Neurocomputing, Addison-Wesley Publishing Company, Inc.
Mendelsohn, Lou [1993]. “Training neural networks,” STOCKS & COMMODITIES, November.
_____ [ 1993]. “Preprocessing data for neural networks.” STOCKS & COMMODITIES, October.
_____ [1993]. “Neural network development for financial forecasting,” STOCKS & COMMODITIES, September.
_____[1991]. “The basics of developing a neural trading system.” Technical Analysis of STOCKS & COMMODITIES, Volume 9: June.
Rumelhart, D.E., and J. L. McClelland [ 1986]. Parallel Distributed Processing, Volumes I and 2, The Massachusetts Institute of Technology.

Reprinted from Technical Analysis of
Stocks & Commodities magazine. (C) 1993 Technical Analysis, Inc.,
4757 California Avenue S.W., Seattle, WA 98116-4499, (800) 832-4642.