[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 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.

March 2003
CSI Technical Journal
Volume XXI, Number 3
Page 1

Topics discussed in this month's journal:
  Exploring Development Opportunities for Profit
  Notice about Government Data
  Notice to Options Users
  Tech Talk

Exploring Development Opportunities for Profit
Back testing on historical data is the backbone of technical analysis, but the complexities of the many and diverse markets make a systematic evaluation of historical data a formidable task. Unfair Advantage® (UA) includes a facility called the Application Programmer's Interface (API) that can greatly simplify the process of reaching data while simultaneously cutting across all levels of relevant information. The UA API is not for computer novices. Instead, it is offered for CSI users who are programmers, and for third-party software companies who wish to develop and market new state-of-the-art trading tools fueled by CSI's peerless database. A few software companies have already made use of the UA API for their development needs.

It is an honor and a privilege to supply market data to traders who use a host of excellent trading systems. The software developers who regularly refer customers to CSI wisely use valid analytical techniques that include network and cycle analysis, forward-looking one-day-at-a-time methods, breakout methods, limited- parameter approaches, intermarket analysis and more. Use of the API is an option that is available to these developers as an alternative to the current UA data processing methods - perhaps in future products. A transition to the API interface is not required for continued good results with any UA-compatible system.

The API (currently named API2) is an interface between UA and any third-party software product. Simply put, this interface provides a way for the client software to request market data for its unique analytical needs. UA responds to such requests by checking licensing information, retrieving the data and copying the data onto the clipboard and exposed data members such as factsheets of market information.

OLE Automation code is then used to control everything that Unfair Advantage does. As Microsoft tells us, OLE Automation enables you to work with objects in another application's object model, allowing the integration of the two to appear seamless. Just as one might use Microsoft Excel's® built-in mathematical functions to process Microsoft Access® data via OLE Automation, so too could you use your own software to analyze CSI data within UA. Throughout the application, the programmer sets and retrieves the object's properties and applies its methods.

In this case, the OLE Automation object has certain properties, such as commodity symbol, data date, delivery month, opening price, and actions, such as retrieving futures contract(s), copying price data to the clipboard, and looking up other market information. All of the properties can be read and modified by the client application. When the client application wants UA to take an action such as retrieving some data, the client application accesses one of the interface's functions.

Before getting started with a trading program that you might wish to write or have written, it is important to have an understanding of the mechanics of updating the Unfair Advantage database. This requires either starting UA and clicking the telephone (update) icon for a normal retrieval session, or using the programming code listed in the UA User's Manual to execute a download. (See "Initiating an update remotely" in the Third-Party Software chapter.) Either way, no further interaction with the UA application is required of the user. Once the UA software is installed and the User ID and Customer Number are inserted, UA can function automatically for the duration of your analysis. There are no portfolios to build, no roll-forward months to specify, no export formats to define. Market data retrieved through the API can still be tailored to the user's specifications, such as rolling rules based upon date, volume, open interest, etc. with the same flexibility offered through the portfolio system.

As an example of how the API might be used by system developers, we are currently developing a trading system called the Probable Direction Index (PDI). Although we had intended to release this program as part of Unfair Advantage, it seemed more appropriate for CSI, which is primarily a data vendor, to refrain from selling stand-alone trading systems. PDI may be made available through a third-party firm at some point. Regardless of the ultimate availability of the program, its reliance on UA's API makes it illustrative of how both end users and software developers might capitalize on the API's capabilities.

PDI is strictly a heuristic tool that learns how to trade based upon the market’s historical movement. Like an expert mountain climber examining the slopes ahead, it can read current conditions and, based upon previous experience with similar conditions, prescribe the route with the greatest probability for success. The more history you supply, the better should be the result.

This program uses several time-coincident series that are independent of the single dependent series, which is the market you would like to predict. PDI can take the gathered independent statistics and collectively remember all of the market pre-conditions that were in effect before each market turn. If those conditions can be found to have predictive properties, then the program can refer to the statistics captured over time and react with an appropriate response.

For futures market analysis, this program will use any number of independent variables to identify key market conditions that help to determine the direction of the dependent variable. A sampling of candidates for other independent variables that are easily accessible through the API are listed below:

1) The unbiased forward-generated seasonal wave form of the dependent variable,
2) Econometric data,
3) One or more high positively correlated and/or high negatively correlated complementary market(s),
4) The RSI index, Stochastic Index, MACD index, moving average cross over, or a combination of any one or two over time,
5) The relative movement of the dependent variable's volume and open interest over time,
6) The serial correlation of the dependent variable's price,
7) Any other markets on which there is a large positive or negative correlation, and
8) Option statistics for the dependent variable.

Obviously, many of these values are not immediately available from the database itself; they are calculated with supplied software that uses the extensive repository of UA data. The software developer could create similar lists of independent variables to test for predictive abilities and also perform studies on raw market data. Sample formulae for many basic indicators are included in UA's study library. In the course of analyzing a particular market with a set of inputs, the software developer will have made extensive use of the supplied factors, and will be in a position to rate, rank, and evaluate the importance of each. The above represents a protocol inclusive of several suggested techniques for any API-using developer to try. The data and tools are all within easy reach.

The future profitability of a given market is reinforced into steady state stability as independent variables prove to positively and consistently contribute to overall performance. Non-contributing independent variable(s) may be all but excluded from prominence in the trade selection process, as more and more historical information is supplied.

Unlike many traditional approaches, the methodology described here would use no market movement information that is later than the date of the proposed trade. This allows PDI to avoid adding hindsight bias and the resulting loss of statistical freedom that accompanies approaches that look backward in time over known trading perils. Such a flaw would be inherent in a trading system that is derived from known historical information. The simulated trading process in a desirable trading model should move in a forward direction only, consuming perhaps a single degree of freedom. There should be absolutely no peeking forward in time that could make the development process prone to weaknesses arising from a hindsight perspective. This infrequently explored fresh perspective could be a major source of any development tool’s inherent strength.

There is a substantial benefit in giving the trading system extensive independently derived historical information. This is because a forward-looking design helps the model to learn to appropriately apply factors of importance in the trade selection process.

No model can return flawless perfection, however, so some sort of a safety rope would likely be helpful should a bad cue be followed. Perhaps an experience I had while working in an Advanced Analytical Methods Unit within The General Electric Company will shed some light on safety gear that might be applied.

I was associated with a proposal for a project we called FABMDS, an acronym for Field Artillery Ballistic Missile Defense System when I learned that the Kalman Filter was a highly successful tool for tracking an incoming target. Our goal at the time was to intercept the target at some projected future position and disable it in flight. If the idea sounds familiar, it may be because Raytheon beat out GE for the job, and renamed the project "Patriot Missile Defense System." These were the missiles that shot down Scuds during the 1991 Gulf War. I don't know the nature of the technology adopted by Raytheon, but the Kalman filtration tool was considered to be a viable statistical procedure advanced by GE's development team.

In my view, if the Kalman filter could assist in aiming a disabling rocket into the path of a moving target, that methodology could also be used as the basis for discovering the likely point of significance where a market has confirmed a new direction. This analytical tool became the basis for a method that one might use to impose market stops. A stop that would be positioned below (above) a target market would register a tolerable level of loss before a sale (purchase) would register a reversal of the market’s direction.

The mathematics for the Kalman filter should be able to identify a likely point of significance where a forward-looking technical market-tracking device would confirm that a reversal in direction was probable. This filter and a tool that forecasts future price behavior without penalty of freedom loss could form or bolster the performance of a unique and profitable trading system. I believe that the Kalman filter can provide valuable protection against incurring excessive losses in uncooperative markets. It will likely be included in PDI, and could be included in independently developed trading systems that rely on data retrieved through UA's API. An API example is planned which will show potential developers how an independent charting interface can be used to combine data, bar charts and study indicators.

In summary, UA's API is a tool for gathering CSI data that allows software developers to utilize the CSI database downloaded by UA while bypassing the portfolio system. PDI is a simple indicator that is presented here as an example of how a developer might use UA's API and CSI's UA data base seamlessly with his or her own products. Although the API and PDI are viewed as possible alternatives for expanded service, the fundamental technical capability of PDI does not in any way rival the substantive material scope of the many products that developers provide through UA's data delivery system.

Bob Pelletier

Editor's note: The author's early analytical background was in the measurement, forecasting, simulation and reliability testing of defense systems. Working for the General Electric Company, which was under contract to the U.S. government, Mr. Pelletier also participated in proposals for building and implementing defensive systems for the U.S. military.

This article includes information found in the Microsoft Office Developer Web Forum and in the Unfair Advantage API (API2) Functional Specification by Steven Davis. Please see both of these references for more information.

Notice about Government Data:

Due to an unacceptable level of fluctuations in reported values, CSI will no longer quote "preliminary" data for such government reports as PPI, GNP, etc. These values will be now be reported only when they are released as "official" from the U.S. government.

Notice to Options Users:

A serious (now corrected) problem with our server caused options customers to miss several days of data in mid February. This must be corrected with a new CD from CSI. Any option subscriber who is missing data should call or e-mail CSI immediately to request a replacement CD. There will be no charge for this disk, which will include the latest version of UA. We regret and apologize for this problem.

Tech Talk
Each month in this column, the CSI technical support staff addresses issues that may be of interest to many subscribers though this question-and-answer forum. This month they discuss making sure you have the latest version of Unfair Advantage, searching past Technical Journals on the CSI website, an error message related to the additions to the stock factsheet, installing the Borland Database Engine, interpreting UA's COT data and saving studies.

Q. The Unfair Advantage (UA) factsheets show the start date for International Business Machines (IBM) as January 2, 1962. My charts don't go back nearly that far. How can I view the rest of the history?

A. You must have opened a "Personal and Private Use" account, which provides a ten-year database upon subscription. This database expands with every daily update, so after a year of daily updates, your visible history will have increased from ten to eleven years. To view data farther back in time, you can purchase additional historical access from CSI. The cost is $20 per year to extend historical data for stocks and indices. This can be arranged with a simple telephone call to Technical Support and a credit card transaction. New software is not required. An alternative would be to upgrade to a "Professional Edition" account. Professional subscribers have access to the full history of all selected markets except options. Please see our website at www.csidata.com for full details.

Q. I like the way UA displays stock data with adjustments for splits so that my long-term charts show a true picture of price progression. While the charts of stocks in my portfolio are adjusted for splits, the charts I make through the "New Chart" icon aren't. How can I get split adjustments in these charts?

A. This was a minor glitch in UA version 2.5.4. To see a split-adjusted chart with that software, simply add the stock to your portfolio and then chart from there. A permanent solution is to download a fresh copy of UA from our website. This problem, along with a few others, has been corrected in the latest version.

Q. My Unfair Advantage charts show about a year of history, regardless of the quantity of available data. How can I see a more detailed view of a shorter time period?

A. Click the "Expand Date Range in Chart" button above the UA chart (it's fifth from the right and shows arrows pointing out). This will increase bar spacing, thus zooming in on data over a reduced time period. Click the button multiple times to further increase spacing. You can save the current setting by right-clicking your mouse and then selecting "Save Current Zoom Level" from the popup menu. Alternatively, you can set the number of days that will display initially by adjusting the "Default Zoom Level" on the General tab of Non-Portfolio Chart Options from the Options menu. A lower value such as 50 would display only about two months of data in the charting window, but would still allow you to scroll to view more data or use the "Expand Date Range" and "Compress Date Range" buttons to modify the view.

Q. I have been unable to download with UA since I installed Norton Internet Security® (NIS) on my computer. This doesn't make sense to me because I elected to have the program allow Unfair Advantage to access the Internet. UA appears to download and distribute data, but in the end, nothing is updated. What's going on?

A. There's more to filtering data than simply allowing UA to access the Internet. Your security program is corrupting the UA download to the point that the file is unrecognizable. We recommend you disable NIS for the duration of the download and re-enable it when complete. An alternative is to remove web filtering from Port 80. See Troubleshooting - Downloading Issues in the UA manual for details.

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