STOCKS & COMMODITIES magazine. The Traders' Magazine

Register or Log In — Traders.com and STOCKS & COMMODITIES magazine

  |  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

NOT A SUBSCRIBER?

To continue reading, sign-up for trial access to Traders.com and the S&C Archive37,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.



DEPARTMENTS: Advertising | Editorial | Circulation | Contact Us | BY PHONE: (206) 938-0570

PTSK — The Professional Traders' Starter Kit
Home — S&C Magazine | Working Money Magazine | Traders.com Advantage | Online Store | Traders’ Resource
Add a Product to Traders’ Resource | Message Boards | Subscribe/Renew | Free Trial Issue | Article Code | Search

Copyright © 1982–2024 Technical Analysis, Inc. All rights reserved. Read our disclaimer & privacy statement.