back start next


[start] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [ 20 ] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54]


20

5 Geometric Trading

Inspiration is needed in geometry, jmt as much as in poetry.

Aleksandr Pushkin, Liechtenstein

Geometric analysis is the interpretation of lines on charts, ranging from a single line segment to a Gann square with intersecting angles [18]. Horizontal lines are drawn at support and resistance levels: double bottoms and double tops, and triple bottoms and triple tops. Lines also enclose patterns such as rectangles and triangles. Much has been written about these chart pattems [2, 11, 15, 25, 26]. Here, we present a simple but effective daily and intraday trading system based on a unique definition of a rectangle. Further, we explore variations of other geometric patterns, e.g., the encapsulated triangle.

Geometric chart patterns are notoriously hard to trade because every trader in the world is looking for them. The days ofthe clean breakout are long gone, so the trader must use techniques such as double confirmation, as demonstrated in our definition of encapsulated triangles. Trading off of the traditional chart patterns is dangerous to ones portfoho because in the minds eye one can detect a head-and-shoulders pattern in a blanket of cumulus clouds.

The Rectangle Trading System (Acme R) simply computes the ratio of a consolidation range to a trending range. This system can be traded on any time frame, and it is equally useful on an intraday time frame because many stocks consohdate during the middle of the day and then continue in the direction of the morning trend until the closing bell, or they reverse around 2:30 pm EST. The system does not need any trading filters - the only requirement is that the stockhas some degree ofvolatility.

The R system works well in conjunction with other systems. For example, suppose an opening range breakout system goes long or short sixty minutes after the opening bell, holding the position until the end of the day. The breakout system triggers a short entry, and the stock falls until mid-day, where it consolidates in a tight range. If the stock reverses in the afternoon, then the breakout system would give back more ofthe profit using a traditional stop strategy than



with the Acme R sjstem. A breakout sjstem that exits a trade on a moe out of a rectangle gives back aprofit equal only to the height ofthe rectangle.

5.1 Rectangle

The Hectangle is two sohd parallel hnes that boimd the high and low ofa trading range (Figure 5.1). The dimensions ofthe rectangle are its length (,inbars), its height (high minus low), audits aspect ratio: itsheight divided by the height of a lareceding range known as the rcnige. In order to quahfy as a rectangle, the aspect ratio must be less than or equal to a maximum aspect ratio. Further, the height ofthe rectangle must be less than a specified multiple ofthe ATR, or RangeFactor.

AEOSLAST-Dariy I

(4,12,1.0.0.31

41 00 40.000 30.000 33.000 37.000 33.000 35.000 34.000 33.000 32.000

Fure5.1. Reaangle

For example, suppose our rectangles are four bars in length. The highest high of the current range is 42, and the lowest low of this range is 40. Therefore, the rectangles height is 42 - 40 = 2. The length ofthe reference range is twelve, so next we calculate the height offhe range preceding the rectangle The highest high ofthe reference range is 43, and the lowest low offhe reference range is 35, so the reference rane height is 43 - 35 = 8.

Now, we must qualify the current range as a rectangle. We specify a maxi-nun aspect ratio of 0.3, i.e., the rectangles height must be 3Wo of the reference

ranges height. Fust, divide the rectangle height (2) by the reference range height (8) to get the aspect ratio of 2 / 8 = 0.25, which quahfies this range as a rectangle (=: 0.3). Next, we confirm the rectangle using a RangeFactor of 1.0. The rectangles height can be no greater than the stocks ATR multiphed by the RangeFactor. Ifthe ATR ofthe stock is 1.9, then the current range does not quahfy as a rectangle because the height (2) is not less than the RangeFactor (1.0) multiphed by the ATR (1.9). Ifthe ATR is 2.1, then the current range quahfies as arectangle because the height (2) is less than the RangeFactor (1.0) multiphed by the ATR (2.1)

The EasjLanguage function code in Example 5.1 determines whether or not a specified range is arectangle-

Ecample 5-1. Function AcmeReclaitguIar

AcmeRectangular: Determine whether the region Is a rectangle

Inputs:

RectangleLength(Numeric), RangeLength(Numeric), RangeFactor(Numeric), RangeRatio(Numeric);

Variables: ATR(O.O), VLength(30), RectangleHigh(O.O), RectangleLow(o.O), RectangleHeight(o.o), RangeHigh(o.O), RangeLow(O.O), RangeHeight(O.O);

AcmeRectangular = False;

ATR = Average(Range, VLength);

RectangleHigh = Highest(High, RectangleLength); RectangleLow = Lowest(Low, RectangleLength); BectangleHeight = RectangleHigh - RectangleLow;

BangeHigh = Highe5t(high, RangeLength)[RectangleLength]; RangeLow = Lowest(Low, RangeLength)[RectangleLength]; RangeHeight = RangeHigh - RangeLow;

if RcctanglcHeight > 0 and RangeHeight > 0 Thon

IF (RrctanglrHfight / R-inufHrighl) < R.inj-rR.il in .iiid R<><l.inglHI(-i.hl < .1 1-1.1(1<> AIR llii-n A(.....Kii l.iiit:iil.ii I.....,



5 Geometric Trading

5.2F--ta le Trading S-,-t3[[ (J-[ieRl

The code for the Boolean function is divided into two sections. After computing the ATR, we calculate the height of both the rectangle and the reference range. Then, we test both of our conditions: whether or not the rectangle height divided by the reference range height is less than the maximum RaiigeRatio and whether the rectangle height is less than or equal to the RaiigeFcwtormTMAieA by the ATR. If both conditions are true, then a rectangle has been foimd. An indicator calling this function can test e\erj bar for the existence of a rectangle. Some code for drawh rectangles is shown in Esample 5.2.

Ecample 5.2. Indicator Rectangle

Inputs:

RectangleLength(4), RangeLength(l2), RangeFactor(1.0), RangeRatioLimit(0.3);

Variables:

RectangleHigti(o.o), RectangleLow(o.o), UpperLine(-l), LowerLine(-l);

RectangleHigh = Highest(High, RectangleLength); RectangleLow = Lowest(Low, RectangleLength); If AcmeRectangular(RectangleLength, RangeLength, RangeFactor, RangeRatioLimit) Then Begin

UpperLine = TL Hew(Date[RectangleLength-l], Time[RectangleLength-l], RectangleHigh, Date[0], Time[o], RectangleHigh); If UpperLine >= 0 Then Begir

If CetBackCroundColor = Black Then TL SetColor(UpperLine, Yellow) Else

TL SetColor(UpperLine, Black); TL SetSize(UpperLine, 1); End;

LowerLine = TL Hew(Date[RectargleLength-l], Tinie[RectangleLength-l], RectangleLow, Datefo], Tinie[o], RectangleLow); If LowerLine >= 0 Then Begin

If CetBackCroundColor = Black Then TL SetColOT(LoweTLine. Yellow)

Else

Tl SHriihir(liiw.Ml im-, Rl.nk); II S.-ISi/.(..wil ll..-. I);

The code in Esample 5.2 is a template for other geometric pattems m the sense that the current bar is tested for the pattern, and ifthe pattem exists, then the lines are drawn. Here, the indicator calls {heAcmeReckaigfdarhmc\ion, which returns trae or false. Iftrue, then two trend lines are drawn, one across the top of the rectangle (the high ofthe bar range) and one across the bottom ofthe rectangle (the low ofthe bar range).

5.2 Rectangle Trading System (Acme R)

The Acme R sj-stem is simple. If a rectangle is identified, then a stop order is placed on either side ofthe rectangle. As with ell other Acme sj-stems, the parameters can be austed to fit the traders selection criteria. The brackets [] reference historical bars, e.g., [4] meansfourb

Calculations

1. Calculate the Average True Range for the past 30 bars (ATR30).

2. Get the Highest High ofthe last 4 bars (HH4).

3. Get the Lowest Low ofthe last 4 bars (LL4).

4. Get the Highest High ofthe 12 bars preceding HH, (HH,2[4]).

5. Get the Lowest Low ofthe 12 bars preceding LL4 (LLi2[4]).

5.2.1 Long Signal

[Entry

Rules

1. (HH4 - Lb) / (HH,2[4] - LLi2[4]) <= 0.3

2. (HH4 - LL4) <= 1.0 * ATR30

3. Buy the next bar at or above HH4 + (EntryFactor * ATR30)

I Exit Rules: Profit Target

1. Sell halfofthe position at or above the High + (ProfitFactor* ATR:,,,)

2. Sell half nf the p<i.4itii>ii iit or above tin-1 ligli of Pr.iritllnrs ago + (2*l»r.>niFiiit.>i*ArR,<,)



[start] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [ 20 ] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54]