STOCKS & COMMODITIES magazine. The Traders' Magazine
Request Information
From Advertisers
Traders.com
Stocks &
Commodities

  • Subscribers' Area
  • Current Issue

  •    - Opening Position
       - Letters to S&C
       - Traders' Tips
       - Futures Liquidity
       - News & Products
       - Books
       - Cover Art

  • Free Articles
  • Article Abstracts
    1996-Present
  • Complete Articles
    1982-Present
  • Novice Traders' Notebook
  • Glossary
  • Subscribe
  • Renew
  • Free Trial
  • Search
  • Working
    Money
    Traders.com
    Advantage
    Traders'
    Resource
    Online Store
    Message Boards
    Article Code
    Free Newsletter
    Products
    Search
    Help
    Subscribe
    Renew
    Contact Us
    Home

    Enter search terms:


    Products
    Small Book Image for Store.Traders.comStore.Traders.com
    Purchase past articles on hundreds of topics, along with software, books, and magazine subscriptions over a secure web connection. Click Here

     
    Search Products:

    @ Online Store!
    S&C Magazine Subscriber Login
    S&C Free Trial Issue
    S&C Volume Books
    S&C Magazine
    S&C on DVD
    Software
    Articles
    FREE ARTICLES! (while they last)
    Suri Duddella Notes
    Elwave 9.0
    Bennett McDowell
    VisualTrader 4.0
    Forex Volatility Patterns
    Stock Trading Success
    Market Dynamics
    Bill And Justine Williams
    StrategyDesk
    Profiting From The Gartley
    Elwave 8
    Steve Nison's Profiting In ...
    Best Choice Software
    High Growth Stock Investor
    Daytrading With TheStockBandit ...
    The Trading Plan
    Support & Resistance ...
    eSignal 10 and Advanced GET ...
    Buying Straddles
    NeuroShell Trader 5
    GTS Pro
    Between Price And Volume
    Point & Figure for Forex
    Direct Pro
    A Window to Our Workshop
    Profitunity Home Study Course
    Adrienne Toghraie
    MultiCharts 2 (Part 2)
    MESA8
    MultiCharts 2 (Part 1)
    C. Kirk of TheKirkReport.com
    StrataSearch 3.0
    IBFX-GPS
    Random Walk Trading
    OmniTrader
    Traders' Resource
    Advisory Services
    Books
    Brokerage
    Consultants
    Courses & Seminars
    Data Services
    Exchanges
    Hardware
    Mutual Funds
    Online Trading Services
    Publications & Newsletters
    Software
    Trading Systems

    Information Directory
    S&C Tour
    S&C Magazine
    Resources
    Products
    Subscribe
    This Month's Issue
    Home | S&C Magazine | Working Money | Traders' Resource | Message-Boards | Store

    SYSTEM DESIGN


    Simplifying Your Life

    Moving Average Computations, Made Easier

    by John F. Ehlers


    Presenting programming tricks to simplify coding indicators and strategies.

    A simple moving average of length N is computed by adding N values and dividing the sum by N. The process is repeated on a bar-by-bar basis. What could be easier? While conceptually simple, coding for long moving averages can quickly become wearisome because there are so many terms.

    This tedium can be reduced by putting the summation in a loop, but looping is difficult to achieve in some applications, such as Excel. Another simplifying approach is to drop off the oldest value and add a new value to the moving average. However, this requires computing the initial value of the long moving average at least once. Here are two ways to compute the simple moving average (SMA) with ease.

    In Z-transform notation, a unit delay is represented by Z-1. The transfer response is the output of the filter divided by its input. Thus, the transfer response of an eight-bar simple moving average would be written as:

    (Equation 1)
    H(z) = (1 + Z-1 + Z-2 + Z-3 + Z-4 + Z-5 + Z-6 + Z-7)/8

      ...Continued in the December 2003 issue of Technical Analysis of STOCKS & COMMODITIES


    Excerpted from an article originally published in the December 2003 issue of Technical Analysis of STOCKS & COMMODITIES magazine. All rights reserved. © Copyright 2003, Technical Analysis, Inc.



    Return to December 2003 Contents

    Technical Analysis, Inc.

    [Home | Working Money Magazine | S&C Magazine | Traders.com Advantage | Online Store]
    [Traders' Resource | Add a Product to Traders' Resource | Message Boards]
    [Subscribe/Renew | Free Trial Issue | Article Code | Search | Help Files]
    Departments: [Advertising | Editorial | Circulation | Employment | Contact Us]

    Copyright © 1996-2008 Technical Analysis, Inc. All rights reserved. Read our privacy statement.

    Technical Analysis, Inc.
    Subscribe! Free E-mail Newsletter.
    First: Last:
    E-mail: