SYSTEM DESIGN



Unlock Your Coding Potential

Finding Key Reversals

by Massimiliano Scorpio


Running this statistical test before creating a system can prove to be helpful.

After spending several years analyzing traditional indicators and developing moving averages and oscillator-based systems, I have found that nothing works better in forecasting price movements than price itself. This discovery led me to focus my efforts into searching for and studying price configurations that could be useful in predicting the next movements in price. I started creating systems in 1996 using what was then Omega Research's EasyLanguage and tried to test several strategies, writing numerous programs and solving many problems that popped up before I could translate my ideas into a single mechanical strategy. A couple of years ago, I decided to build a library of my favorite patterns and setups to use as a basis for creating a system, and to statistically test if there was indeed something to work on. This preparatory exercise turned out to be very useful, and I would like to share it with my fellow traders.

THE STEPS

Before designing a system, you need to write down what pattern you wish to write a program for. Describe your inputs and outputs, and the conditions that would be valid if you were trading that pattern. Once you have created a system, you will need to test it on historical data to determine if it would have been successful in the past. When testing the system, you can select charts of any market, but testing it on at least 10 to 15 noncorrelated markets will make your results more reliable and valid.

The first step to writing an EasyLanguage function is to list all the patterns you want to test. As an example, I will show you how to write a function for a key reversal up day. The EasyLanguage code for the function can be seen in sidebar 1. A key reversal up day is represented by a bar where the low is lower than the previous low and the close is higher than the previous close. You need to add the condition the actual close must also be lower than the high, as displayed in Figure 1.

FIGURE 1: KEY REVERSAL UP. This is a key reversal up, visually stated.

Next, you need to create a signal program, including the function, using the "print" statement as can be seen in sidebar 2. If there is a key reversal up, my objective is to determine how many times the high of the next bar will be equal to or greater than the previous high. If I find the results satisfactory, next I need to build a system where I would buy the key reversal bar at the close and sell the position at the next bar at the previous high for a profit (Figure 2). (See Traders' Tips on page 98.)

FIGURE 2: KEY REVERSAL SETUP. If the setup works, it is possible to buy on close and sell next bar at today's high.

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


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



Return to December 2001 Contents