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]


40

CPHD-IOmin NASDQ 10«e/2001

. . >,,.,

,1,/

tlm,,,.--

.........

,l,i.ini"">* ltl...>»l

tfdunef) 1342.00

lll(4luMllk

14:4D Woe il:Vo 1Z:S0 14:1» l0/09 11:1» 12:10 1320

3000.00 -2000.00

Figure 10.19. Cepheid

Source Code

The bitter and the &Mvet Come pom Uie amide. The tiardfrom within, from me& own efforts.

Aftert Einstein, Oii of Ah- Later Years

The history oftrading is apjTamid ofknowledge that has been constructed o\er the past centurj. From Liermore to Gann to Edwards and Magee, only time will teU which ofthe modem-day technicians wiU be mentioned in the same breath. The important point to remember is that trading is a collective effort in the sense that one draws inspiration from many sources. This book is a sjmthesis ofmany who have contributed to the body ofwork in technical analj-sis.

The evolution oftrading software has been a catalyst for developing new prototj-pes of technical analj-sis in a short period oftime, especially with the development ofprogramming languages designed apecifically for trading.

ofthe source code here is written in EasjLanguage, a language for technical analj-sis and trade management. The code was originally written for the TradeStation 20001 platform, but can be imported into TradeStation 6. Note the difference in signal names in Table 11.1 between the TradeStation 20001 platform and the TradeStation 6 platform:

Table 11.1. TradeStation Signal Names

TradeStation 20m

TraieStation 6

Long Entrj

Short Entry

Sell

Sell Short

Long Exit

ExitLong

Sell

Short Ent

ExitShort

Buy To Cover



11.1 Inventory

All of the EasyLanguage code is grouped by function and roughly by chapter. Start with the Money Management code because it is the foundation for the rest ofthe code. Then, choose the system(s) to build. After the files have been created, verify the entire Acme code base, selecting the appropriate signal names in Table 11.1 based on the platform.

If using the TradeStation 20001 and TradeStation 6 platforms, create the source code using the PowerEditor, verify the source, and then export all ofthe code with the Acme prefix to an ELS archive file. Finally, import the archive into TradeStation 6 for automatic conversion.

The EasyLanguage code in this chapter is based on TradeStation 2000i. If using TradeStation 6, the signal names Sell, ExitLong, and ExitShort must be replaced with the signals SellShort, Sell, and BuyToCover, respectively.

11.1.1 WebSite

A professional CD-ROM product containing the source code in this book can be purchased in EasyLanguage archive file format from the Acme Trader Web site at http: www.acmetrader.com. The product can simply be installed into TradeStation, and the trader can then open pre-defined workspaces provided on the CD-ROM.

11.1.2 Money Management

Table 11.2. Money Management Modules

11.1 Inventory 11.1.3 Geometric Trading Table 11.3. Geometric Trading Modules

Name

Type

Description

Acme Double Bottom

Indicator

Draw a line forming a double bottom

Acme Double Top

Indicator

Draw a line forming a double top

Acme R Strategy

Strategy

R Signal with the Acme Trade Manager

Acme R System

Signal

Look for rectangle breakouts

Acme Rectangle

Indicator

Draw a rectangle

Acme Triangle

Indicator

Draw a triangle

Acme Triple Bottom

Indicator

Draw a line forming a triple bottom

Acme Triple Top

Indicator

Draw a line forming a triple top

AcmeDoubleBottom

Function

Find a double bottom formation

AcmeDoubleTop

Function

Find a double top formation

AcmeRectangular

Function

Is the current region a rectangle?

AcmeTripleB ottom

Function

Find a triple bottom formation

AcmeTripleTop

Function

Find a triple top formation

11.1.4 Market Models

Name

Type

Description

Table 11.4. Market Model Modules

Acme HV

Indicator

Display the historic volatility of an instrument Set stops and profit targets

Acme Trade Manager

Signal

Name

Type

Description

AcmeEntry Targets

Function

Plot the entry points for stop and limit orders

Acme All Strategies

Strategy

Combination ofF, M, N, R, and V strategies

AcmeExitTarg ets

Function

Plot the stop loss points and profit targets

Acme Market Model

Indicator

Label market sentimentpatterns

AcmeGetShares

Function

Calculate the shares based on the risk model

Acme Market Strategy

Strategy

Market Signal with the Acme Trade Manager

AcmeLogTrades

Function

Log trades to a file for spreadsheet import

Acme Market System

Signal

Look for multiple market sentiment patterns

AcnieVolatility

Function

Calculate the historic volatility

AcmeHighLowlndex

Function

Check for an index confirmation



11.1.5 pair trading

Table 11.5. pair trading modules

Name

Type Description

acme p strategy

Strategy

p signal (does not use acme trade manager)

acme p system

signal

pair trading system

acme spread

indicator

display the spread between two instruments

11.1.6 range trading

Table 11.6. range trading modules

Name

Type

Description

acme id2 acme idnr acme n strategy acme n system acme nr acme nr% acme nr2 acme range ratio acmeinsideday2 ac melnsi ded aynr acmenarrowrange acmerang eperc ent acmerangeratio

paintbar mark an inside day within an inside day

paintbar mark inside day/narrow range combinations

strategy n signal with the acme trade manager

signal range ratio and narrow range pattem system

paintbar mark the narrowest range in n bars

paintbar mark a narrow range bar based on % of atr

paintbar mark two consecutive narrow range bars

indicator display the ratio oftwo bar ranges

function search for two consecutive inside days

function find an inside day/narrow range bar

function is the specified bar a narrow range bar?

function calculate the range percentage over n bars

function calculate the range ratio

11.1 inventory 11.1.7 Pattern Trading

Table 11.7. pattern trading modu

Name

Type

Description

acme m strategy

Strategy

M Signal with the Acme Trade Manager

acme m system

signal

look for multiple pattern combinations

acme market patterns

indicator

label bar pattems

acmecobra

function

find a cobra pattern

acmeharami

function

search for the extended harami pattem

acmehook

function

search for a hook pattern

acmeonaverage

function

is the current bar sitting on the moving average

acmepullback

function

search for a gann pullback pattern

acmeretracedown

function

identify an n-bar pullback

acmeretraceup

function

identify an n-bar upward retracement

acmetail

function

identify a tail pattem

acmetest

function

identify a test pattern

11.l.svolatility trading

Table 11.8. volatility trading modules

Name

Type

Description

acme v high zone

paintbar

mark when the v high zone is hit

acme v low zone

paintbar

mark when the v low zone is hit

acme v strategy

strategy

v signal with the acme trade manager

acme v system

signal

find v bottoms bused on linear regression

acmevhigh

function

find an inverted v high

AcmeVLow

Funton

find a v low



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