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
       - Websites for Traders
       - 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

    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)
    Trading The Pristine Method Course
    Neural Network Pair Trading
    Profitunity Home Study Course
    Looking Forward With Jeff Parent
    John Wang - AbleSys Corp.
    BestChoice Software
    Window To Our Workshop
    Stock Trading Success
    Support & Resistance ...
    The Danger Zone With ...
    Forex Volatility Patterns
    Track N Trade Live Futures
    eSignal 10 and Advanced GET ...
    Elwave 9.0
    VisualTrader 4.0
    FXEducator's Ed Ponsi
    MadScan
    Using Binary Options In Forex
    CrimsonMind.com
    The 21st-Century Technician
    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

    QUANTITATIVE METHODS

    The Future And The Filter

    Predicting Market Data Using The Kalman Filter
    Part 2

    by Rick Martinelli and Neil Rhoads

    Can the Kalman filter be used to predict future price movement? In this second part of this series we answer this question.

    Previously, we discussed the Kalman filter and the alpha indicator. This time, we study the accumulation of profit/loss through the fortune chart. We also backtest the filter and analyze the results. The profit/loss on day k may be written as

    Image 1

    where the quantity in parentheses is the relative price-change, or return, on day k, A is the trade amount in dollars, and Wk = 1 if αk > C, Wk = -1 if αk < -C and Wk = zero otherwise (W for wager). Note that Wk = 0 corresponds to no trade on day k and so Pk = zero as well. Further, note that A is the same for every trade. For the Ford data, C was found to be 0.38, and Figure 1 shows its Pk values, where the trade amount A was set to $1.00 (zero values are not shown). The red point at November 28, 2008, represents the trade having the largest profit. The reason for the large profit can be seen in Figure 2, Part 1, where the red point in Figure 1 corresponds to point 8 in Figure 2. The prediction of 1.84 was nowhere near the actual at 2.47, but it was in the correct direction, up from 1.72, resulting in a 0.436 profit. The fortune sequence is the accumulation of the Pks:

    Image 1

    Its last value, FN, is called the last-day fortune (Ldf) and represents the amount of profit/loss realized at the end of the simulation. A graph of Fn versus day n, corresponding to the Pk data in Figure 1, is shown in Figure 3. The Ldf is 1.37 on 124 trades, or about 1.1% average profit per trade. This is, of course, an idealized fortune in which there are no trade commissions, and trades can be transacted at the prescribed buy/sell prices (no slippage). It is used here primarily to evaluate the Kalman filter’s ability to predict the direction a stock price will take.

    Image 1

    Figure 1: profit/loss. Here you see the Pk values for the Ford data from Figure 1 in Part 1: T = 1.86, C = 0.36, A = 1. The red point at 11/28/08 represents the trade having the largest profit.

    Image 1

    Figure 2: data and predictions. Here you see the Kalman predictions for a portion of the data from 11/18/08–12/09/09 (green) together with the data. The red point in Figure 1 corresponds to point 8 in Figure 2, Part 1.

    The fortune plot is one indicator of that ability, and so is the profit ratio, defined as the ratio of number of profitable trades to total trades. In the Ford simulation that we discussed in Part 1, it was 0.59. The profit ratio can be roughly visualized as the ratio of number of points above the zero line to total points.

    ...Continued in the February issue of Technical Analysis of Stocks & Commodities

    Return to 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-2010 Technical Analysis, Inc. All rights reserved. Read our privacy statement.

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