Consulting | Custom Trading Systems
Built-In Indicators | Custom Indicators

November 2006 Stocks and Commodities Traders Tips

A Computerized Approach To A Fundamental Analysis Tool: Building Automatic Trendlines

Original article by Giorgos E. Siligardos, Ph.D.
AIQ Code by Richard Denning

The AIQ code for a portion of Giorgos E. Siligardos’ article on automatic trendlines is shown below. The first part of the code finds pivot points based on the number of bars surrounding the pivot point. The number of bars on either side of a high pivot that have lower highs than the pivot define the strength of a high pivot. Similarly, number of bars on either side of a low pivot that have higher lows than the pivot define the strength of a low pivot. Changing the variable called “strength” in the pivot code below sets this strength parameter. To illustrate how these pivots can be used in a trading system, I created a divergence trading system, also included in the code below, where I used the pivots to establish a divergence between the price and the MACD oscillator. A cross over on the %K-%D stochastic indicator is used to trigger the entries. Table 1 shows the summary results of testing the long and short side of the system on the NASDAQ 100 list of stocks. The long side outperformed the NASDAQ 100 index during the recent bullish period from 9/12/02 to 9/12/06 but racked up large losses during the bearish period from 9/12/00 to 9/12/02. The short side out performed the NASDAQ 100 index during the bearish period but showed flat performance during the bullish period. Before trading this system on stocks, it appears that a market-timing filter should be added and additional test-runs performed including a portfolio simulation.

EDS Code for Automatic Trendlines Pivot Finder
Pivot Finder.EDS

















Disclaimer | Privacy Policy | Contact Us | Spam Blocker | ©2009 Traders Edge Systems