Article: Neural Networks


In May of 1999, my good friend Larry Pesavento sent me his new book, 'Profitable Patterns for Stock Trading'.  While the entire book is informative, it was the chapter on 'The Non Random Nature of Chaos Theory' that caught my attention.  In this chapter, Larry gives a brief history of his introduction to neural networks in 1992, and his subsequent consuming research with neural networks.  The neural network forecasts that Larry has shared with me over the past few years have been impressive, even down right profound.  

Neural networks have been used as an expert system in stock market forecasting with astonishingly accurate results.  We all want to have tomorrow's Wall Street Journal delivered today, and perhaps neural networks are the closest thing yet to having a crystal ball so we can see tomorrow today.  A Neural Network is a mathematical system loosely modeled on the human brain.  A neural network attempts to simulate market behavior using sophisticated software which has multiple layers of simple processing elements called neurons.  Each neuron or node is linked to other neurons with varying coefficients of connectivity that represent the strengths of these connections.  Learning (training the network) is accomplished by adjusting these strengths to cause the overall network to output useful results.

Since neural networks have a strong similarity to the human brain a great deal of the terminology is borrowed from neuroscience.  Artificial neurons are the basic unit of neural networks.  Although biological neurons are more complex than the artificial neurons, the artificial neurons simulate the four basic functions of natural neurons of accepting input, analysis, feedback, and generating output for other neurons.  The basics of an artificial neuron are shown in this figure.

In the network each neuron receives various inputs, each multiplied by a connection weight.  In the simplest case, these products are summed and processed through a transfer function to generate an output.  The neurons are interconnected and processing may pass through multiple layers of neurons before arriving at the final output.  The minimal network structure would have an input layer, a hidden center layer, and an output layer.

Neural networks can be designed in many ways, but all are constructed from the basic building blocks.  You should start with a commercial software package for creating neural networks because the mathematics involved are very complex.  Then your challenge as a researcher will be to go through a period of trial and error in the design decisions before coming up with useful results.  The design issues are complex and useful results may elude anything but a serious effort and commitment.

These design issues must be given thoughtful consideration when creating a neural network:

  1. Selecting the number of hidden layers and arranging neurons in the various layers.
  2. Deciding the type of connections among the neurons.
  3. Determining the strength of the connections within the network.
  4. Selecting what data to use as input and what will be the output.

Issues 1) and 2) are configuration parameters that are set in the neural net software program.   Issue 3) is accomplished by allowing the network to learn the appropriate connection weight values by using a training data set.  The majority of the work involved in working with neural nets will be in the preparation and maintenance of training data sets.  The biggest challenge is issue 4), the selection of inputs and outputs for the neural network.  Obviously some inputs will be more worthwhile than other inputs.  What is not obvious is knowing what those inputs should be.

The process of designing a neural network is an iterative process.  Just like the brain which learns from experience, neural networks learn by changing its connection weights until it learns the solution to a problem.  The weight-value for every neuron to neuron connection is stored or memorized so the network can process a new set of inputs to generate a predictive output.  The system needs to be retrained on a frequent basis so that connection weights can be adjusted to incorporate new knowledge.

Neural nets have the ability to generalize.  The training data sets teach the neural net to recognize more than just what has been seen in the past.  A neural net can discover characteristics about the training data sets that may elude our perception.  While market movement may at first glance appear to be random, neural nets demonstrate that markets are not totally random.  There are waves, vibrations and patterns that repeat.   The value of the neural net is its ability to digest massive amounts of data and perform hundreds of thousands of calculations to discover the market's intrinsic characteristics, and generate useful predictions.

Do I have the 'crystal ball' yet?  No.  I feel I am like Galileo who put two glass pieces on the ends of a tube and discovered with his crude telescope he could now see something he could not discern before.  Was Galileo's first telescope the 'crystal ball'?  No.  Through time and effort, telescopes evolved into better instruments with greater power, with an occasional radical new design.  Neural nets are a work in progress as new inputs are considered and more research is performed.   The end objective is greater accuracy and correlation between tomorrow's forecast and reality.  Some days the forecasts are very accurate and give the advantage of knowing in advance where and when the markets will turn.  On other days, however, the forecasts are not worth the paper they are printed on.   The goal of every neural net researcher is improved accuracy and a reduction in the frequency of occurrence of  worthless or misleading forecasts.

I won't tell you the specifics of where I am at in my personal evolution with neural nets.  I will pass on a few tips to help you get started if you are inclined to seriously investigate neural nets.

  1. Plan on spending a couple thousand dollars to buy a commercial neural set software package.  You must realize that the neural net software is just a tool, it is not the end solution.  You still have to design the neural network and then train it.
  2. Use a very fast computer with a big hard disk.  Some of the neural net models may number crunch for hours.
  3. Either program yourself or hire a good programmer to design tools that aid in the preparation of training data sets.  Most neural net program accept ASCII files or Excel files for the input, and generate the same files as the output.   As stated before, the majority of the work will be in the preparation and maintenance of training data sets.  Make the data preparation program flexible because you will want to evolve and test new ideas.
  4. Plan on an initial phase of excitement and enthusiasm, followed by several years of dedicated research as you search for a 'holier grail'.
  5. Data that might be considered as Input in your neural net design include (but not limited to):
    • - Astronomical relationships, periods of rotation and orbit
    • - Time of day, day of week, season, days to expiration
    • - Patterns and Cycles
    • - Numerology, including Gann and Fibonacci numbers and ratios
    • - Daily statistics such as Open, High, Low, Close, Net, Volume and Open-Interest
    • - Up ticks, Down ticks, and tick volumes
    • - Time and Price data points:  intra-day data would be a candidate for intra-day forecasts, and daily data for daily forecasts.
    • - Various Studies  (I have personally discounted these because they are a 2nd generation digestion of the original Time and Price data).

The chart Overlay feature in Ensign Windows can be used to display a neural net forecast with a host chart.   The forecast is an Ensign data file created from the output of a neural net.  The forecast extends into the future when plotted on the host chart.  The host chart updates in real-time and plots in proper synchronization with the forecast so both are seen simultaneously as shown in these examples.  The first chart shows a forecast for daily Live Cattle prices for last December.  The forecast was made at the end of November for the entire month of December.

The next chart shows an intra-day forecast for January 22nd, 2002.  The forecast was made in advance for the entire day.

Appreciation is expressed to Dr. John Arrington for permission to publish the two chart examples which are the result of his research over several years with neural networks.  His research is focused on the live cattle markets for his personal trading.  He does not have anything to discuss, share, or sell.  So please  respect his privacy.


In June 2002, Larry Pesavento and Ensign Software signed a cooperation agreement which began the exchange of confidential information about the proprietary neural network used by Larry to give him his timing signals.   Larry's method of trading uses one price tool (Fibonacci Levels) and one timing tool (neural net forecast).  Read more» Larry's trading style

A neural network extracts a forecast of tomorrow's price action by examining past data.  Sounds a bit mysterious and complex, and indeed it is.  We all feel that the market repeats itself, and accordingly use tools like cycles to measure repetitions in time, Fibonacci to measure repetitions in price, and Elliott waves to see repetitions in patterns.  A neural network, if designed properly, is allowed to generalize, and through an iterative process discover characteristics in the training data that contribute to a useful prediction.

The objective of the Pesavento/Ensign partnership is to design a better neural net.  In order to design a better mouse trap, one needs to thoroughly understand the design of an existing mouse trap.  Such is the case with the Pesavento neural net.  The originator of the Pesavento neural net design back in the early 1990s was Dennis Regan (deceased) .  I wish Dennis's thoughts and reasons for why certain things were done had been documented, but alas, such engineering notes apparently do not exist.  Therefore, Dr. John Arrington (PhD Stanford) and I have been spent the past couple months reverse engineering the Pesavento neural net, testing and understanding thoroughly every aspect of its unique design.  

Now I apologize in advance that I cannot divulge all that I have learned.  I have signed a non-disclosure agreement with Mr. Pesavento to protect the value of this intellectual property.  I will say that I have been totally surprised at the uniqueness of Mr. Regan's design.  It is something I would never in a month of Sundays have thought of.  In comparison to the neural nets I worked with previously, Mr. Regan's net definitely shows thinking outside of the norm.

While I cannot divulge exactly what Mr. Regan's design is, I can tell you what it is NOT.   The neural net designs that John and I were pursuing prior to our partnership with Mr. Pesavento, were based on training the neural net with several weeks of past price data and generating tomorrow's  forecast using 2-minute bars.  We started down that path three years ago because the Pesavento forecasts were overlaid on 2-minute bar charts.  Mr. Regan's design is not anything like that, and that initially really surprised both John and I.   Initially we wondered if we had the full Regan design because it did not seem like it could possibly work, yet it does.

The Arrington model was training with prices on the input nodes of the neural net.  The Regan model does no such thing.  It does not input prices, and that shocked us.  Instead it uses for input what I will describe as a pair of frequencies.  The analogy that John and I have used to get a mental handle on what is happening is that of a bat's radar.   A bat bounces a frequency off an object, and receives back a three dimensional image on its stereo receivers.  The Regan neural net is doing something similar, bouncing frequencies from two different points in time and space and detecting an image.  We know that Dennis Regan worked for the U.S. government on the top-secret Tomahawk missile guidance system.   Perhaps the design of the Pesavento neural net has its roots in technology Dennis was familiar with.  That is just one of our questions that will remain unanswered because Dennis died.

Well, we are involved in reverse engineering, researching, thinking, trying variations on the original Regan ideas.   Progress seems promising, but all new ideas must weather the test of time.  One idea is showing exceptional promise and was used to generate the following forecast for August 5th.   The blue line forecast was published in advance on the www.dacharts.com web site on Saturday, August 3rd.   I marvel at the correlation of Monday's actual price action.   I had a big smile on my face as I watched the day progress and track the forecast.  This idea just might be something great.

Not all forecasts are of this quality and usefulness.   But when a forecast like the above comes along, it is worth bragging about, particularly since it was published in advance.  Let me remind you the key use of the forecast is for TIMING.   For example, note the alignment of the top turn at 8:20, the alignment of the bottom turn at 10:42, and the alignment of the top at 13:26.  This is exceptional and exactly the trading advantage Mr. Pesavento seeks to have by using neural nets in his trading.

Article by Howard Arrington


Last modified 10/27/08 11:33 AM