ABSTRACT From the Publisher: Many research articles have appeared on applying neural network techniques to prediction in the various financial markets, but few publications offer practical guidance for implementing these techniques in the real world. This book provides a step-by-step system for setting up and trading a market using a neural network as the prediction engine. The techniques and methods presented in this book can be applied to any market, anywhere in the world, so this book will appeal to anyone who wants to trade or predict financial markets, specifically institutional traders (futures, commodities, stock, bonds, currencies, etc.), private investors and brokerage houses. It should also be of interest to students of financial market timing and Artificial Intelligence.
Table of Contents Preface vi Acknowledgments viii PART ONE FOUNDATION FOR FINANCIAL PREDICTION USING NEURAL NETWORKS 1 1 Review of Neural Networks 2 1.1 The Perceptron 2 1.2 Multi-Layer Perceptrons 6 1.3 The Back-Propagation Learning Algorithm 6 1.4 Kohonen Self Organizing Maps 10 1.5 Why Neural Nets are Suited for Financial Prediction 15 2 Introduction to the Futures Markets 17 2.1 The Futures Contract 17 2.2 Long and Short Positions 19 2.3 Speculators 19 2.4 Hedgers 20 3 Introduction to Technical Analysis 21 3.1 Technical Analysis versus Fundamental Analysis 21 3.2 Support and Resistance 23 3.3 Indicators and Oscillators 24 3.4 Market Patterns 25 3.5 Trading Systems 28 PART TWO TREND PREDICTION TECHNIQUES 32 4 Basic Strategy for Trend Prediction 33 4.1 Feature Extraction 33 4.2 Neural Net Configuration 38 4.3 Training the Net 41 4.4 Signal Generation 42 4.5 Walk-Forward Testing 45 5 A Mechanical Neural Net Position Trading System 47 5.1 Trading Signals 47 5.2 Money Management 48 5.3 Risk Management 50 6 Advanced Feature Extraction Techniques for Trend Prediction 52 6.1 Exponential Averaging 52 6.2 Fibonacci Averaging 55 6.3 Using Logarithms 57 6.4 Pattern Recognition 59 6.5 Integrating Technical Indicators 64 6.6 Integrating Related Markets 65 7 Other Trend Prediction Strategies 66 7.1 Sigmoid Target Calculation Method 66 7.2 Selecting the Optimum Net Configuration 69 7.3 Tailoring Training to Periodic Data 72 7.4 When is it Time to Retrain? 72 PART THREE PRICE PREDICTION TECHNIQUES 74 8 Basic Strategy for Price Prediction 75 8.1 Feature Extraction 75 8.2 Neural Net Configuration 77 8.3 Day Trading Algorithm 79 8.4 Training The Net 80 8.5 Walk-Forward Testing 80 8.6 Review of the Basic Strategy 81 9 Advanced Feature Extraction Techniques for Price Prediction 85 9.1 Range Compression 85 9.2 Using Logarithms 85 9.3 Pattern Recognition 85 9.4 Integrating Other Data 86 9.5 Multiple Period Integration 86 10 Other Price Prediction Strategies 88 10.1 Using a SOM for Price Prediction 88 10.2 Combining Position Trading with Day Trading 90 10.3 Intraday Neural Net Strategies 92 PART FOUR THE FUTURE OF NEURAL NETS FOR FINANCIAL PREDICTION 95 11 Integrating With Other Branches of Artificial Intelligence 96 11.1 Expert Systems 96 11.2 Genetic Algorithms 97 12 Getting Started 99 12.1 Selecting an Approach 99 12.2 Acquiring Market Data 99 12.3 Sticking to Your System 100 12.4 Conclusions 100 APPENDIX A Back Propagation Algorithm Details 102 REFERENCES 105 INDEX 107 List of Figures 1 Biological neuron 3 2 Artificial neuron 3 3 Three types of nonlinearities 4 4 Perceptron classification 4 5 Exclusive-OR solution 5 6 Feed-forward neural network 6 7 Example of a Kohonen SOM 10 8 SOM unsupervised training algorithm 11 9 SOM supervised training algorithm 13 10 SOM supervised training algorithm with verification vector 14 11 Neural net architecture for predicting stock prices 15 12 Neural net architecture for predicting daily gold prices based on a five day pattern 16 13 Support and resistance 24 14 Using trend lines to detect trend reversals 24 15 Stochastic oscillator 25 16 Major reversal patterns 26 17 Major continuation patterns 27 18 Moving average system example 29 19 Breakout system example 30 20 RSI system example 31 21 Percent change technique for generating ideal signals 37 22 Ideal signals for 1990 37 23 Neural net configuration for trend prediction test case 40 24 Graph of tss error for the test case training period (1990) 42 25 Neural net oscillator for the parameter set period (1991) 43 26 Drawdown calculation 44 27 Probability of impacting prediction 53 28 Exponential averaging 54 29 Fibonacci averaging 56 30 Logarithm example 57 31 Logarithm input normalization 58 32 Distributed pattern recognition 59 33 Shape extraction 61 34 Integrated pattern recognition 63 35 Linear target 67 36 Sigmoid target 68 37 Signal transformation function 68 38 Two neuron output layer 69 39 Pruning example 71 40 Signal frequency histogram 72 List of Figures (Continued) 41 Neural net configuration for price prediction test case 41 42 Trading algorithm for price prediction 79 43 Graph of tss error for the test case training period (1990) 82 44 Graph of pss error/pattern for the test case training period (1990) 82 45 Results of 1991 parameter phase 83 46 Results of 1992 walk-forward testing 83 47 SOM for price prediction (supervised) 88 48 Example graphs of supervised SOM results 89 49 SOM for price prediction (unsupervised) 91 50 Using a trend predictor as input to a price predictor 92 51 Expert system 96 List of Tables 1 Input/target pairs (patterns) example 8 2 Example price data 35 3 Probable volatility vector calculations 36 4 Calculation of first pattern 36 5 Complete set of patterns for example price data 36 6 Excerpt from a pattern file (1990) 38 7 Test results from parameter set (1991) 45 8 Money management example trading results 48 9 Progressive money management example 49 10 Regressive money management example 49 11 Exponential averaging range compression 55 12 Fibonacci averaging range compression 56 13 Price prediction input pattern 76 14 Excerpt from a price prediction pattern file (1990) 81 15 Price prediction input pattern using log(ratios)
Preface Ever since there were markets to trade, there were speculators attempting to predict their direction. In this book, I will present to you a host of methods that will help you predict financial markets. These methods are all based on years of research with an exciting technique called Artificial Neural Networks. An artificial neural network is an emulation of the neural networks in our brain. I will show you how the brain’s architecture is modeled by connecting artificial neurons into a matrix of neurons and how these neural networks can be taught to predict the future with surprising accuracy. Two basic approaches to financial prediction are presented in this book, they are Trend Prediction and Price Prediction. The trend prediction approach is used to determine when the trend is going to change direction and the price prediction approach is used to determine what the price will be during a given time frame, normally the next day. Trend prediction is used for longer-term analysis (weeks or months) while price prediction is used for shorter-term analysis (hours or days). A trend prediction net can be used to develop a position trading system. A price prediction net can be used to develop a day trading system. The terms position trading and day trading are used by speculators in the futures markets. Loosely defined, day trading is when a trade is opened and closed, all in the same day, while position trading is when a trade is opened and held, possibly for many days or weeks, until it is determined it is time to close the trade. Futures data was used to verify the techniques in this book, although, any time series data such as stocks, stock indexes (Dow Jones Industrial Average), Mutual Funds, Options, etc., can be used. I will also show you how to construct a mechanical trading system. A mechanical system is one that generates all of the information you need to trade a market. These systems will tell you when to buy and when to sell. The real challenge in using neural networks for financial prediction is not the construction of the nets themselves, but rather the transformations used to feed data into the net and the methods used to interpret the results that come out of the net. These methods will be described in great detail so that you can apply them to your financial prediction application. You will soon realize that this aspect of using neural nets for financial prediction, or for any application, is the key to success. In essence you will be developing a good teacher for the net. Just like us, a neural net can learn if the information is presented in a format that is easy to comprehend. The book is divided in four parts. Part One provides an introduction to all of the key areas necessary for understanding how to apply neural networks to financial prediction. This includes a review of neural networks, an introduction to the futures markets and an introduction to technical analysis. Part Two details trend prediction techniques. A basic strategy for trend prediction containing all of the building blocks necessary to perform trend prediction with a multi-layered, feed-forward neural net is presented. The entire process is explained using one basic technique in each of the various steps of the process and then, other variations on this process are discussed. A clear, comprehensive description of what you need to develop a complete mechanical neural net system is presented. A discussion of why a mechanical system is important and the pit-falls of deviating from your system are presented. Part Three, price prediction strategies, is organized in a format similar to Part Two. Basic strategies are presented using a specific example, then a mechanical neural net system is presented, followed by other price prediction techniques. Part Four provides a starting point for further research by discussing how other branches of artificial intelligence can be integrated with neural nets to enhance your financial prediction strategies. Expert Systems, Fuzzy Logic and Genetic Algorithms are discussed and suggestions as to how they can be used in conjunction with other techniques presented in the book is presented. There are many hurdles, most very tedious, that one must overcome in order to successfully develop a neural net based trading system. A chapter is provided that assists the reader in taking those first steps and provide some pointers along the way. A short discussion of various areas that warrant further research is discussed, as well as a summary and some general guidelines for moving forward. The trend prediction techniques in this book were used to develop the BrainTrader trading software. For more information on BrainTrader, visit WWW.MJFUTURES.COM. Acknowledgments The writing of this book required the integration of two distinct sets of disciplines. The first of these is artificial intelligence and neural networks. I would like to thank Dr. Richard Mammone for his support and for introducing me to neural nets many years ago. Many of the methods and techniques presented were first developed under his guidance at Rutgers University. The second set of disciplines is market analysis and trading. I was first introduced to trading the futures market using technical analysis by Mr. Pascal Mossa. Mr. Mossa presented me with literature and expert training in all phases of trading and technical analysis, without which I could have never written this book. My biggest supporter, by far, is my lovely wife, Gail. Thank you for your undying support and understanding and for the sacrifices you made throughout the writing of this book. To my children, Mary Grace and Joey, thank you for letting me use the computer once in a while. In memory of my parents, Joseph and Angeline, thank you for teaching me the value of a strong work ethic and for providing me with the resources to meet my goals. Part One Foundation for Financial Prediction Using Neural Networks In recent years, researchers and developers, with the use of the Back Propagation Training Algorithm, have been able to show that neural networks can be used to solve "real-life" problems. One such real-life problem is financial prediction. Knowing when the stock market has reached its high or when interest rates have reached a low is obviously extremely valuable information. This book will show you that a Neural Network can be used to predict when a trend is going to change. Our financial markets have clearly demonstrated through the years that they trend in cycles. The timing of the tops and bottom of these cycles has been studied time and time again. This book takes a fresh look at this problem, with the application of neural networks. Part One provides the foundation for the remainder of the book. The background necessary for the comprehension of the techniques presented is provided in this section. 1 Review of Neural Networks Researchers, in hopes of achieving human-like performance from computers, developed the concept of the artificial neuron [17]. The artificial neuron emulates what we know about how the neurons in the human brain work. These simple neurons can then be connected into a complex network, whereby the synapses of one are connected to others and the relative strength and weakness of these connections can be modified. The process of modifying these connections based on some external stimulus is how the neural net learns. Neural networks consist of a large number of very simple neuron-like processing elements (artificial neurons) linked together by a large number of weighted connections which encode the net's knowledge [14]. This architecture lends itself to a parallel processing environment with distributed control. Many of the neurons can process their information independently of others, although, some critical dependencies exist which hamper a totally parallel implementation. The emphasis of neural networks is on automatically learning the internal representations (weights). There are two classes of training methods used for determining the optimum weights of a net: supervised and unsupervised. The core difference between supervised and unsupervised learning is that a supervised learning algorithm requires a desired solution to be known a priori, while an unsupervised training algorithm does not. A supervised training algorithm will normally begin learning by setting all of the weight to random values and then iteratively modify the weights until the desired solution is achieved. Unsupervised training algorithms allow the neurons to compete with each other until winners emerge. The resulting values of the neurons determine the class that a particular data set belongs to. 1.1 The Perceptron …eBook at www.mjfutures.com 2 Introduction to the Futures Markets If you tell someone you are going to invest in commodities, the next statement will normally be something along the lines of "Are you crazy!" Many people are afraid of commodities because they simply do not understand them. The commodities markets and their diversity have become quite overwhelming, but, once you understand why the markets exist and what they are used for, many (but not all) of your fears can be eliminated. The following introduction to the futures markets is by no means comprehensive. It is intended to give you an overall understanding of the markets and the terminologies surrounding them. This chapter will assist you during the remainder of this book, since these neural net techniques were first applied to the S&P-500 Futures Contract. You may have noticed that I sometimes use the terms "commodities" and "futures" interchangeably. The broader term, and the one I prefer is, futures. When futures contracts were first established, they were used for actual commodities, such as wheat and corn, for example. Later on, futures contacts were used for such things as treasury bonds and the stock indexes, which are not commodities in the classic sense of the term. 2.1 The Futures Contract …eBook at www.mjfutures.com 3 Introduction to Technical Analysis All of the prediction techniques presented in this book can be classified as technical analysis. We will be taking historical time series data and using it to predict the future. When I was first presented with this concept I had serious doubts that it could work with a reasonable level of accuracy. With the help of a friend and many hours at the computer running technical analysis software over and over again, I slowly became a believer. I soon learned that technical analysis was a very important tool that could significantly improve my trading. I also quickly learned that the plethora of technical indicators and oscillators, and the parameters used to generate them, were overwhelming. The most significant obstacle to effectively using technical analysis for predicting markets is determining the right mix. By that I mean, which indicators and oscillators are best for the market you want to trade, and which parameters work the best over time. The truth is, no one knows the answer to this question. I always felt like I was very close to the answer, but my testing always found situations that made the technical analysis come to a screeching halt. The I was introduced to neural networks while attending Rutgers University in pursuit of my Masters degree. I became very excited with the capabilities neural networks had for classifying, generalizing and especially for finding nuances in data. Their ability to uncover hidden relationships in data encouraged me the most. Could neural networks be the key to technical analysis that had been so elusive to me? I bought a copy of Exploration in Parallel Distributed Processing (PDP) by McClelland and Rummelhart [18] which came with neural network software. I took some German Mark historical data I had and let a neural network learn it and the results were very promising. The effort that followed was not easy, but, like anything else in this world, what is worth having requires hard work and dedication. It is important that you have a good understanding of technical analysis and its components in order to properly apply this book to your specific application. The following provides an overview of technical analysis, but I suggest you get your hands on one of the referenced books and broaden your knowledge. 3.1 Technical Analysis versus Fundamental Analysis …eBook at www.mjfutures.com Part Two Trend Prediction Techniques 4 Basic Strategy for Trend Prediction This chapter provides all of the basic building blocks necessary to perform trend prediction with a multi-layered, feed-forward neural net [1, 8, 15, 19, 22, 29]. The entire process is explained using a test case and a selected technique in each of the various steps of the process. Subsequent chapters will present other improvements and variations on this process. The following are the five basic processes that must be performed in order to establish a neural net that can predict trends: Feature Extraction Neural Net Configuration Training the Net Signal Generation Walk-Forward Testing Each of these five steps are explained, followed by the results obtained using the example test case. 4.1 Feature Extraction …eBook at www.mjfutures.com 5 A Mechanical Neural Net Position Trading System The term mechanical is used to describe a trading system that has all of the human decision process eliminated [19, 20, 22]. A mechanical trading system must account for every detail, especially those that can adversely affect the bottom line. The first process that must be defined is signal generation, when to buy and sell. Although I will not diminish its importance of signal generation, you will soon see that many other factors are just as important and many beginners leave them unattended. Experienced traders will use a mechanical system as a frame of reference. If factors not used in the development of the system confirm or deny the signals generated by the system, an experienced trader will use this information to augment the trades. The temptation to think you know better than the system must be avoided. Mechanical systems will have drawdowns and you must suffer through these periods. It is common to override the signals during a losing period when you see potential profits left on the table. As long as your actual drawdown has not significantly exceeded the drawdown experienced during testing, you must stick with the system. In order to round out the basic techniques given in Chapter 5, certain other real-world factors must be considered. The factors can be grouped into the following major categories: Trading Signals Money Management Risk Management 5.1 Trading Signals …eBook at www.mjfutures.com 6 Advanced Feature Extraction Techniques for Trend Prediction The techniques described in the previous chapters can be viewed as a starting point for myriad a of different ways the feature extraction process can be performed. In this chapter, some variations are presented that have been found to enhance the performance of the net in some circumstances. The best way to measure the effect of these feature extraction enhancements is to compare results on the markets you are analyzing. This can be a very time consuming process, but, with the use of some common sense and experience with the process, you will be able to shorten the time it takes to determine the best feature extraction technique for your application. 6.1 Exponential Averaging …eBook at www.mjfutures.com 7 Other Trend Prediction Strategies The more help you can give a neural net, the better job it will do predicting the future. This chapter describes some techniques which will help you help your neural nets. Sometimes, small variations to a particular method can produce significantly better results. Other times, performance can be adversely affected or improvements are negligible. After you have been successful in developing a working neural net, you may want to experiment with the variations presented in this chapter. When conducting your experiments, it is important that you establish an analysis plan and carefully document you results. Your analysis plan should be based on incrementally adding, removing and combining various changes. This is especially important because you don’t know exactly where all the pieces will fit together to make the optimal neural net trading system. The adding of a particular enhancement may have no affect on your results until you combine it with one or more other variations. Patience and good record keeping will go a long way towards finding a successful solution. 7.1 Sigmoid Target Calculation Method …eBook at www.mjfutures.com Part Three Price Prediction Techniques 8 Basic Strategy for Price Prediction The objective of the price prediction approach is to accurately predict the next day's price range for the purpose of day trading. With this information, you can quickly profit from small, or sometimes large, daily fluctuation of a particular market. Day trading eliminates the overnight risk and is therefore a very desirable approach to trading. Overnight risk is the risk assumed by the investor when the market is closed (overnight, weekends and holidays). Major events that occur when the market is closed can significantly effect the opening price of the next day's trading session, causing a gap in the price data. A gap offers no opportunity to exit a position at the prices skipped over, which can cause greater than expected losses. By using a day trading approach, you are in and out of a trade in the same day and overnight risk is eliminated. The major disadvantage of a day trading approach is that you must be right a high percentage of the time, or have a very good money management system, in order to be profitable. A neural network can be used to increase your accuracy and overcome this disadvantage. This chapter describes each of the steps required to build a price prediction system, as follows: Step 1: Feature Extraction Step 2: Neural Net Configuration Step 3: Day Trading Algorithm Step 4: Training the Net Step 5: Walk-Forward Testing 8.1 Feature Extraction …eBook at www.mjfutures.com 9 Advanced Feature Extraction Techniques for Price Prediction Many of the techniques described in this chapter are similar to the ones presented in Chapter 6 for trend prediction. I will point out the differences in their application, but the implementation details are the same as presented in Chapter 6 so they will not be repeated here. 9.1 Range Compression 9.2 Using Logarithms 9.3 Pattern Recognition …eBook at www.mjfutures.com 10 Other Price Prediction Strategies 10.1 Using a SOM for Price Prediction The qualities of a SOM make it ideally suited for price prediction strategies [4, 10]. Two approaches are provided, one based on using supervised training and the other based on unsupervised training. 10.1.1 Supervised SOM for Price Prediction … 10.3 Intraday Neural Net Strategies The Day Trading strategies presented in previous chapters all concentrated on predicting a "trading range" each day and then using that information to make one trade that day. This approach may be applicable to some traders, but other full time traders will want to take advantage of the numerous intraday fluctuations in a market. The first hurdle that must be overcome is the acquisition of the data. In order to trade multiple times within a single day, you must have real-time data and be able to react quickly. Data providers will transmit every tick and can usually draw a chart in front of you, in real-time, based on the chart parameters you select. For our discussions, we will use five minute bars. Five minute bars look just like a daily open-high-low-close bar, but the data used to generate it is only for the last five minutes of trading. What you will quickly realize is that the five minute chart looks very similar to the daily chart, only the time horizon has changed. We can therefore use a neural net in the same way we used it for position trading, but with some modifications in the training process and the trading algorithm. …eBook at www.mjfutures.com Part Four The Future of Neural Nets for Financial Prediction 11 Integrating With Other Branches of Artificial Intelligence All of the discussions in this book have intentionally focused on one branch of AI, Neural Networks. Much research has been done using other AI techniques such as Expert Systems, Fuzzy Logic and Genetic Algorithms. This chapter explores how neural nets can be used in conjunction with these other techniques to increase the performance of a trading system. 11.1 Expert Systems 11.2 Genetic Algorithms …eBook at www.mjfutures.com 12 Getting Started There are many hurdles, most very tedious, that one must overcome in order to get off the ground towards developing a neural net based trading system. This chapter will assist the reader in taking those first steps and provide some pointers along the way. 12.1 Selecting An Approach 12.2 Acquiring Market Data 12.3 Sticking to Your System 12.4 Conclusions
WLD论坛对这本书的评价: theres really not much useful on the web that I've come across in a lot of searching. If you are wanting to start from the basics, try books... probably the best starting one is 'Financial Prediction using Neural Networks' by Joseph S. Zirilli - Its getting a bit old now (1997), but it steps through developing simple neural nets - I have tried most of the suggestions at one time or another, in the main they work reasonably well.
Cybernetic Trading Strategies 是97年出版的,内容会不会老了点?请hardwood点评一下。 该作者的其它书: http://www.amazon.com/s/ref=sr_st?r...ipbooks,p_27:Murray+A.+Ruggiero&sort=daterank