Mean Reversion Trading Systems — Programs

This page contains links to the code for the listings in the book.
All the files are plain-text files. They can all be opened with any text editor.

Because some computer systems worry about files with strange file extensions, each file has been renamed from “” to “filename.txt”

When you have downloaded the file and copied it to the directory of your choice, change the extension from “.txt” to “.afl”

Each file is associated with a single listing in the book.
File Figure_7_1.txt corresponds to Figure 7.1 in the book.

All programs have been tested. They compile without error and produce the results shown in the book (or at least reasonably close).

There may be errors. When errors are reported, corrections will be made and revised listing posted in place of the erroneous ones.  Read the Errata file.
Beyond correcting errors in the code, there is no support for these programs.

Please read and understand the disclaimer.
These programs are intended to be educational.
This is definitely Not investment advice.


Click any of the links to download that program.

Listing 3.1

Listing 3.2

Listing 4.1

Listing 5.1

Listing 5.2

Listing 5.3

Listing 5.4

Listing 5.5

Listing 5.6

Listing 5.7

Listing 5.8

Listing 5.9

Listing 5.10

Listing 5.11

Listing 5.12

Listing 5.13

Listing 5.14

Listing 5.15

Listing 6.1

Listing 6.2

Listing 6.3

Listing 6.4

Listing 6.5

Listing 6.6

Listing 6.7

Listing 6.8

Listing 7.1

Listing 7.2

Listing 7.3

Listing 7.4

Listing 7.5

Listing 7.6

Listing 7.7

Listing 8.1

Listing 8.2

Listing 8.2A

Listing 8.3

Listing 9.1

Listing 9.2

Listing 9.3

Listing 9.4A

Listing 9.5A

Listing 9.6

Listing 9.7

Listing 9.8

Listing 9.9