[Click here to return to journal index]

Notice: The views and information expressed in this document reflect the opinions and experience of the author Robert C. Pelletier. Neither CSI nor the author undertake or intend to provide tax advice or trading advice in any market or endorse any outside individual or firm. All recommendations are provided for their informational value only. Readers should consult competent financial advisors or outside counsel before making any software purchase or investment decision. CSI does not stand behind or endorse the products of any outside firms.

© Copyright 2003-2004 by Commodity Systems Inc. (CSI). All rights are reserved.

Website Links: This CSI website and Unfair Advantage system contain hyperlinks and automatic links to websites operated by parties other than CSI. No association with or endorsement of third-party websites should be inferred through these links. They are provided for your convenience and reference only. CSI is not responsible for and has no control over the content of third-party websites.

The CSI Team - At your service:

Andy, Betty, Bob, Debbie, Denise, Fran, Heather, Jason, Jeanean, Jose, Josh, Kathy, Ken, Kurt, Linda, Mike, Nassrin, Patti, Ron, Rosie, Rudi, Sabrina, Sean, Steven and Terry.




November 2004
CSI Technical Journal
Volume XXII, Number 11
Page 1

Topics discussed in this month's journal:
  De-Mystifying Analysis Code With Unfair Advantage's® "AnyLanguage"
  Tech Talk

This edition of the CSI Technical Journal is dedicated to Kurt Wagner, Rudi Cabral, Mike Feran, Steven Davis, Jeanean Savage, Kathy Snyder, Ron Franz, Ken Arneaz, Sierra Vavra and Andy Pelletier for unselfish efforts beyond the call of duty.

Holiday Schedule
CSI will be closed for voice communication on Thursday, November 25th for the Thanksgiving Holiday. The CSI host computer will be accessible as usual, and data from world exchanges that are open on this day will be available at normal posting times.

Notice:
A popular U.S. commodity exchange has contacted CSI with a request for steep redistribution fees for their data. We maintain that the statistics we compile and supply to our customers have already entered the public domain, and are therefore exempt from exchange fees. We have supplied the exchange with their own written acknowledgement of our right to redistribute these statistics, so we anticipate that the matter will soon be closed without adverse effects. However, should we be unable to avoid these added fees, CSI and other data vendors will likely be forced to impose surcharges of up to $5 per month. Watch this newsletter for updated information.


De-Mystifying Analysis Code With Unfair Advantage's® "AnyLanguage"

What is it about trading software that makes it so mysterious, esoteric and sometimes downright mystifying? The cryptic design is no accident, of course. Trading system developers often keep their cards "close to their vests" to assure continued income from software sales. Who can blame them for guarding their secrets and their livelihoods by compiling their code and producing what are called "black box" systems?

The tremendous success of some black box systems speaks for itself, and fortunate are those who benefit financially by trading with such software. It is our honor and privilege to be a preferred data supplier for many of these products. What works, works. That said, I am intrigued by the burgeoning trend of system designers sharing their work and making it available through books or the Internet to computer users everywhere at little or no cost. This trend creates many interesting new ideas and ways for investors to utilize the CSI database and Unfair Advantage (UA) software.

You may not know it, but UA is remarkably well suited for this type of exercise — that is, processing and testing user-supplied or third-party-supplied computer code. This combination of an in-depth, immaculate database and state-of-the-art interpretive software that can process such external programming code has been in place within UA for several years. These ever-expanding programming capabilities continue to keep the Unfair Advantage system moving forward as a truly unique and powerful tool.

CSI's Interpreted Studies feature (part of Unfair Advantage's standard charting module and also accessible as part of MarketScanner™) handles all processing of external code. It is incredibly useful for both single-market technical analysis on end-of-day data, and for fundamental or technical scanning and screening of large portfolios. Once you find a trading algorithm, no matter what the source, that looks promising, you can simply cut and paste it into Unfair Advantage for testing with quality CSI data. Unfair Advantage's Interpreted Studies feature reads imported code developed with popular toolkit programs, as well as analysis routines written in Perl, VisualBasic and JavaScript.

Where do free and low-cost studies come from? We don't recommend, endorse or stand behind programs offered by any outside firm, but a good place to find a variety of code from many different sources is Stocks & Commodities Magazine's "Traders' Tips" column. It's available in their printed version or, for a small fee, online at www.traders.com. The code you acquire from outside sources may need a small amount of tweaking for full compatibility. You can easily model your new input on our examples to reconcile differences.

The use of imported code just might lead to enhanced operations due to the availability of the CSI database for your analysis. An investor who is currently using software that is linked to a less accurate data firm than CSI could reduce monthly data costs and improve quality.


Upgrade to Unfair Advantage 2.8.2 for the features discussed here. The anticipated release date is early November. Check our website at www.csidata.com for details.


One important aspect of the CSI Data Retrieval Service is the end-of-day perspective it lends to your analysis. I find that slowing down the pace of data input to once daily offers several advantages. First, it allows time for thoughtful, thorough analysis while the exchanges are closed and urgency is removed from the equation. Second, it allows the use of crucial volume and open interest data, which are not available intraday, in the analysis paradigm. Third, once-daily trading decisions for entry and exit points can reduce the pace of snowballing losses, should the markets turn against your chosen system.

Another distinct advantage to Unfair Advantage customers is the broad base of world markets available for study. Traders are not limited to investigating one market at a time to solve their trading objectives. No market exists in a vacuum, and Unfair Advantage lets you see the world before you settle on a single investment vehicle. The markets are complex, so we do not suggest that any study will always be successful, even if you take the time to investigate the alternative and supporting related market possibilities.

For illustrative purposes, please consider the example below of a simple moving average crossover study that analyzes the relationship between current and recent prices. This code will be functional using UA version 2.8.2, due for release in early November. The AnyLanguage translator used here is involved in an extended Beta Testing period, and will be released as such in November. We encourage our customers with programming experience to use it and provide feedback. Your efforts will help speed the fully tested release in the near future.

Step 1) Join me in creating a Perpetual Contract® data series on NYMEX Crude Oil. Start by clicking UA's Chart Tools menu and selecting "New." Next make sure the Market Type selection is "Futures" and then enter the symbol CL (or the commodity number 188) into the "Symbols" box. Click the "Perpetual" tab and then click [OK]. A long-term Crude Oil chart will display.



2) To begin the study, click the Chart Tools menu again, and then click "Study Toolbar." When the toolbar displays, click [Add Study].

3) From the "Select Study" box, click the [Interpreted] button.

4) When the "Code Editor" screen displays, you'll want to first select the desired language. Do this by clicking the File menu, and then choosing "Change Language Mode." From the list provided, select "AnyLanguage." This is our flexible interpreter that attempts to translate code from outside sources.

5) Disregarding whatever text is on the Code Editor screen, use the scroll bar at right to reach the bottom of the lower code box. (Note: if your Code Editor is not split into two windows, click the [More] button to expand the screen.) Click your mouse after the final entry to make sure that your cursor location is below the last entry in the file, as shown.



6) Enter the code listed in the example which, depending upon your experience, may be in a familiar form. You may copy and paste this code from the online newsletter on the CSI website at www.csidata.com. Be sure the corresponding code in the top box is as shown. This includes the function name, as well as the parameters for the moving averages, which will be three and five day indicators. Note that there are no spaces between the function name and the parameters.


function MACross2
inputs: p1(3), p2(5);
variables: ma1, ma2;
ma1 = Average(Close,p1);
ma2 = Average(Close,p2);
MACross2 = 100*(ma1-ma2)



7) Click [OK]. This enters your code into the Study Library and introduces it on the Study Toolbar menu, where it will be saved for use now and in the future.

8) In the Study Toolbar, click on the "MACross2" title and drag it into an empty pane in the charting window. Wait briefly while UA interprets the new code and then displays the results of your new study.


Step 8: Apply the study to your chart.

What's going on?

The "AnyLanguage" processor within Unfair Advantage takes the code given to it and evaluates the various functions and calls, allowing the user to introduce his or her own ideas or ideas from a third-party source into the mix. It then produces charts or tables showing how the function relates to the data. See the graphic presentation of this study below.



This example shows a moving average crossover study, which is an oscillator that rises when the period 1 moving average (shorter period) is higher than the period 2 moving average (longer period), indicating a generally rising market. Conversely, it falls when the longer-term average is higher than the shorter term. This study allows you to easily see the relationship between the current price and the prevailing trend. Refer to the code itself (above) for a specific description of the algorithm. Keep in mind that AnyLanguage's optimization feature is also available here.

UA includes an extensive sample/test library of technical indicators that may be used as they are, or modified to provide a level of custom analysis. Code written in Perl, JavaScript or Visual Basic, and even some written through toolkit programs and some competitive platforms can be evaluated directly through the UA tools with the data supplied.

If you design a novel trading system through our software that you would like to share with others, consider sending it to us for possible inclusion in an upcoming version. If it's among the few chosen for publication, we'll let you select the name. It can be anything from a description to a self-promoting moniker such as, "John Smith's Holy Grail." Not a bad way to introduce your name and/or idea to the investment community.

If you're interested in investigating software that's fully disclosed and transparent in its reasoning, or if you're intrigued by the possibility of writing your own programming code, then these evolving Unfair Advantage tools are for you. They're included in your Unfair Advantage software at no extra cost, so why not give them a try? After all, what works, works. We encourage our customers to explore the many features included in Unfair Advantage to take the mystery out of CSI's amazing database and revolutionary software.

Experience the power!

Bob Pelletier





Tech Talk

Each month in this column the CSI Technical Support Staff addresses topics of interest to many subscribers in a question-and-answer format. This month they discuss confusion about the correlation coefficients of various debt instruments on CSI’s website, the pros and cons of skipping redundant updates using a time-saving bypass and handling contract-to-contract gaps in historical data.

Q. This question refers to the correlation comparisons in the Online Newspaper on the CSI website (www.csidata.com): I was looking at a 12-year study of Ten-Year T. Notes-Day (TY2) compared to all commodities. Several similar commodities (such as the Eurodollar, LIBOR and Fed Funds) appear to have both strong positive and negative correlations, respectively. Here are some examples: Eurodollar ED, ED2, UD +0.83 vs. FFO -0.75, FF1 -0.78, FF6 -0.83. Maybe I do not understand the study, but could this be correct?

A. Yes, the correlations are correct, and the confusion is understandable. People often think of debt instrument quotes as annual percentage rates; but that isn’t necessarily the case. While some are quoted as interest rates, for example, a 3.2% CD, others, like T. Notes and Bonds, are quoted as discount rates. For example, a no-coupon one-year bond might cost $980 to purchase today and have a par value (payout) of $1,000 on maturity. Today’s quote would appear as 98.0, and today’s effective interest rate would be 2.04% ((1000-980)/980 = 2.04%). As the quoted price rises closer to 100, the lower the effective interest rate becomes. This is why notes, bonds and the like are said to be inversely correlated to interest rates.

Q. Why is it that on my second data download during the course of a given day, Unfair Advantage re-downloads and reprocesses everything a second time? Shouldn’t UA recognize that it has already been updated once and process only markets that have changed since my last update session?

A. In theory, the idea of processing only the latest set of closed markets might work, if the database were stagnant and not subject to corrections and revisions over the course of the day. However, in the real world, market reports sometimes come in late, exchanges send revisions before our “final copy,” and errors or omissions may be detected and corrected. Flawless database integrity requires that UA repeat the last successful download before proceeding to accommodate up-to-the-minute revisions that may occur. Although other services do not take this step, the superiority of our database speaks for its self as to the value of this CSI practice.

If you are in a hurry, you may force UA to only update a selected group of exchanges. When this feature is activated through the “Download/Distribution Selection” screen, UA will still download all available markets, but it will only write to files and process portfolios for those markets in your chosen list. If you opt to process only certain markets, please be sure to run a complete data distribution at least once per day to restore your database to top form.

Q. I am using your back-adjusted futures data with the C++ adjuster and the date method of rolling contracts. I have found a great variance between the "close old contract, close new contract" and using the "open old contract, open new contract" choices for handling the gap in testing results. This leaves me wondering which representative price choice is most accurate for simulating real time trading for splicing contracts to simulate rolls that occur between contract months in the data stream. Please advise me on which one of the five representative pricing choices you feel is the closest to giving real time accurate results in system testing using back-adjusted data.

A. Although our printed manual shows a preference for the “Close-Open with New Gap Introduced,” which is the most recent addition, that will be changed in the next online manual. We have no evidence that this method is any better or worse than the alternatives. There’s an example on our website at http://www.csidata.com/ua/backadj.htm showing how the various gaps are used and resulting values.

We generally favor our CSI Perpetual Contract® data over any of the back-adjusted alternatives because it does not have the aberrations caused by abruptly switching from one contract to another. By using a constant forward time perspective, the Perpetual Contract Data offers much greater stability. This is especially true when comparing one market with another. Users frequently want to see current prices developed from those back-adjusted series, which appears to be the principal reason why back-adjusted series are used.


All information and data on this website are © Copyright 2002-2004 by Commodity Systems Inc. (CSI) All rights are reserved.
800-274-4727 | 561-392-8663 | 561-392-1379 (Fax)