An Explanation of Neural Networks in VantagePoint with Darrel Jobman
Neural Networks: Taking the fuzzy out of market analysis
Neural networks remain a mystery to many traders, but several software platforms have made this data-mining tool more user friendly. Find out how neural networks work and how they can aid your trade decisions.
By Darrell Jobman
When you hear terms such as “neural networks,” “artificial intelligence,” “fuzzy logic,” and “chaos theory,” do your eyes start to glaze over?
That’s the reaction many traders have to these buzzwords, even though these same traders have no problem comprehending visions of trading success that promotional materials sometimes promise.
Originally used for endeavors involving extensive amounts of data and modeling applications, neural networks came to the financial markets in the 80s. With increasing amounts of data being tossed at traders, neural networks can be excellent analytical tools. However, they are not the end-all, be-all answer for technical analysis.
No Holy Grail “Neural networks are not an advantage unless you have the expertise to design and implement them correctly,” says Louis Mendelsohn, president and CEO of Market Technologies LLC (), developer of VantagePoint Intermarket Analysis end-of-day software, introduced in 1991.
A neural network is not a silver bullet,” agrees Steve Ward, CEO and chief technical officer of Ward Systems Group, Inc. (), which sold artificial intelligence software for corporate and scientific uses for a number of years before launching its NeuroShell Trader programs in 1997. “It is only as good as what you feed it.”
So what exactly do you get with a neural network, and why should traders be interested in spending thousands of dollars for this kind of analytical help?
“A neural network is a computer program that can recognize patterns in a collection of data and produce a model for that data,” says Gary Lynn, vice president of sales and marketing for NeuroDimensions, Inc. (), which offers NeuroSolutions and TradingSolutions software. (For a detailed review of TradingSolutions, see “TradingSolutions 3.0,” Active Trader, April 2005.)
In some ways, a neural network is like a souped-up brain. First, it can recognize patterns in vast amounts of data as it acquires knowledge through a trial-and-error learning process, but without the emotional baggage that often messes up human analysis. It then uses what are known as “synaptic weights” to store that knowledge.
The process is similar to when a child touches something hot, is burned, and learns not to touch it again.
“Neural networks are excellent at sorting through enormous amounts of seemingly unrelated market data and finding repetitive patterns that could never be perceived just by looking at price charts or by comparing two markets to one another,” Mendelsohn says. “Through a mathematical error minimization process known as ‘learning’ or ‘training,’ neural networks, if designed properly, can be trained to make highly accurate market forecasts based upon these patterns.”
The most common neural network has three types of layers: input, hidden, and output (see Figure 1).
Figure 1: HOW A NEURAL NETWORK WORKS A typical neural network has three layers that test and retest data to arrive at a model that minimizes the error between predicted and actual output.
Source:
Input layer Like the familiar “garbage in, garbage out” slogan applied to many computer applications, the data fed into the neural network is critical. The data may go far beyond price toinclude technical indicators or combinations of these studies, and could even include fundamental information. Once the raw data has been selected, it is processed using various algebraic and statistical methods.
VantagePoint, for example, focuses on intermarket relationships so its inputs include the daily open, high, low and close prices plus volume and open interest for 10 related markets to produce its predicted highs, lows and moving averages for a target market.
However, this raw data is first preprocessed into various forms that help to expedite the neural network analysis process. NeuroShell’s Ward also stays away from raw price data because he says price patterns at $6 are different than patterns at $60. Like VantagePoint’s Mendelsohn, he prefers indicators such as stochastics or the relative strength index because their values oscillate between zero and 100, regardless of price. Neuroshell Trader provides 800 different indicators traders can choose as inputs.
Algorithms are used to optimize the indicators, making an searching all possible parameters and combinations to produce the best data for inputting.
Hidden layer(s) Here is where the under-the-hood action occurs. In a “supervised” neural network, the output is already known and the learning algorithm churns through the input data to find the patterns that led to the output. In simple terms, the neural network knows the outcome– the price at the end of a period– and tries to find the best way to get there. Ideally, the “map” that is provided to reach the known goal can be used successfully when the goal is unknown.
A common way a neural network learns is by using an algorithm called back-propagation. It’s a trial-and-error type of analysis in which the input data is presented to the neural network repeatedly until the neural network’s output comes as close as possible to the desired or known result. To reach that point, the neural network may make many “errors” and have to adjust input weights as it learns the best route to its goal.
NeuroShell Trader avoids back-propagation. Ward believes traders should be spending time on what to feed the neural network, not the neural network structure itself. If you find an indicator that is leading the market but have no idea what the trading rules should be for a trading system, let the neural network find the rules internally, he suggests.
In an “unsupervised” setting the neural network does not know the answer in advance but mines the input data to extract patterns.
One thing that should be avoided in a neural net-based trading program is over-training, similar to curve-fitting or over-optimization in trading systems. If a network is presented with too many preprocesses variables, it begins to memorize patterns in the training data and fails to make generalizations on the new data that lead to discovering underlying relationships.
Figure 2: MODELING A MOVING AVERAGE This daily chart of continuous gold futures shows how a predicted 10-day moving average (blue line), forecasted four days into the future, tends to turn a day or two before the actual 10-day moving average (black line) does. Source:
Output layer A neural network’s ultimate goal is to have the predicted output match the actual output (or vice versa). But such a perfect record is unlikely when it comes to markets.
Neural networks usually that predict price, but this depends on the program and how deeply you want to be involved in structuring it. NeuroSolutions and NeuroShell Trader both use neural net analysis to forecast more specific price points that can be traded by a system on either an end-of-day or real-time basis. They are not “black-box” programs, however, as users still have control over the indicators and models used, although they are advised not to add their own tweaks. The key is input selection, which can vary from market to market.
VantagePoint uses five neural networks to predict the next day’s high, the next day’s low, the five-day moving average for two days out, the 10-day moving average four days into the future, and a neural index that combines the other four varables and can serve as a filter. Figure 2 (p.23) shows a daily chart of continuous Gold futures (GC) and compares its 10-day simple moving average to a predicted 10-day average four days in the future.
Instead of letting traders pick inputs from a list of indicatirs, Mendelsohn says VantagePoint’s programmers control this step and present the resulting analysis in tables or charts. The key is for users to augment this analysis with technical skills they already have to make trading decisions, which gives you more confidence because you’ll have a good idea about the trend based on forecasted moving averages and the predicted highs and lows.
In addition to having sound input data, all three of the neural network-based programs mentioned here emphasize the importance of testing the nets over out-of-sample data and retraining them using a representative data series covering a variety of market conditions. For example, Lynn says NeuroSolutions sets aside 60 percent of the data in a given period as the training set, 20 percent of the data for cross-validation to be sure the neural net hasn’t been over-trained and the remaining 20 percent for accuracy testing on out-of-sample data.
Bottom Line Neural networks won’t turn an inexperienced trader or analyst into a brilliant one. In fact, you’ll most likely need above average insight and trading skills even with a neural network. But they might help you “see” patterns in data that your eyes and brain can’t, which could lead to trading rules you might never have been able to create on your own.
Darrell Jobman is an acknowledged authority on the financial markets and has been writing about them for over 35 years. Mr. Jobman is Senior Market Analyst for . He has authored and/or edited six books including The Handbook of Technical Analysis as well as trading courses for both the Chicago Mercantile Exchange and the Chicago Board of Trade.