| APR 1990
Optimizing moving averages by Charles J. McGuinness
Optimizing moving averages by Charles J. McGuinness One of the first techniques you'll come across in almost any book on technical analysis is moving averages. Moving averages are amazingly handy in predicting the movement of securities. By themselves, they offer a simple means of generating reliable buy/sell signals—many people monitor a 200-day moving average to catch long-term trends. Moving averages can be used in conjunction with other indicators, helping to filter out the rapid buy-sell signals that minor fluctuations in price often generate. Perhaps the most alluring thing about moving averages is that they are easy to compute and easy to apply. Hardly a market timing indicator exists that doesn't incorporate them. This simplicity can be deceptive when it is time to apply moving averages. A straightforward translation of a moving average algorithm into program code can produce an application that generates its results slowly. The first time I wrote a charting program I did nothing intricate in implementing the moving average subroutines; when I plotted the first moving average it was drawn across the screen at a snail's pace. It was so slow I assumed I had made some sort of drastic error in my coding! The problem was that the moving average algorithms on which I had based my code were designed to express the algorithms' concepts as simply as possible and designed without taking into account efficiency and real-world implementation issues. If you use a lot of moving averages—for example, in a charting program—this slowness can limit your ability to perform the kind of analysis you want to do. Here are some techniques for producing fast and efficient moving average routines. Whether you're experimenting with some simple programs in BASIC or writing complex optimization programs in C, these techniques can help turn a sluggish number cruncher into a speedy tool.
by Charles J. McGuinness
Technical Analysis of STOCKS & COMMODITIES
The Traders’ Magazine since 1982
has had over 1,226,237 subscribers from 174 different countries.
37,000 Page Traders’ Archive for $89.99
To continue reading, sign-up for trial access to Traders.com and the S&C Archive — 37,000 pages of trading ideas!
After verifying your email address, you will have limited access to the S&C Archive, as well as access to a Digital Edition of S&C, and access to Traders.com Advantage and Working Money for 30 days.
Not a subscriber to Technical Analysis of
STOCKS & COMMODITIES magazine?
Click
here to subscribe, or request
a trial subscription.
Log-in now to view articles from the S&C Archive.
Your Subscriber ID is located at the top of your magazine label, highlighted here in red.
Your last name can be found on the second line, highlighted here in blue.
*If you have a company name on the label, that can also be used. It will appear below your name on the label.
If you do not have a Subscriber ID on your label, you can find it on your statement or renewal form.
For help locating your Subscriber ID number, please call us at 1-800-832-4642 or send an email to Survey@Traders.com. If sending an email, please include your name and mailing address.