Yesterday Today and Tomorrow A Trip Through Computational

  • Slides: 50
Download presentation
Yesterday, Today and Tomorrow: A Trip Through Computational Finance It’s Been a Long Journey

Yesterday, Today and Tomorrow: A Trip Through Computational Finance It’s Been a Long Journey and I’ve Had a Lot of Good Company John Bollinger, CFA, CMT R/Finance 2011, April 2011 Copyright 2011 Bollinger Capital Management

The First of a New Generation • Robert A. Levy • The Relative Strength

The First of a New Generation • Robert A. Levy • The Relative Strength Concept of Common Stock Price Forecasting • 1968 • Investors Intelligence Copyright 2011 Bollinger Capital Management 2

The Bad Old Days • Pre-1980 computing was mostly mainframes or minicomputers Copyright 2011

The Bad Old Days • Pre-1980 computing was mostly mainframes or minicomputers Copyright 2011 Bollinger Capital Management 3

Main Frames • • • Options analysis Data retrieval AOL Merlin FNN – DEC,

Main Frames • • • Options analysis Data retrieval AOL Merlin FNN – DEC, VAX, VMS, DECBasic – Tickers, Cycliphase Copyright 2011 Bollinger Capital Management 4

Microcomputers • Microcomputers – S 100, 1974 – Apple II 1977 – IBM PC

Microcomputers • Microcomputers – S 100, 1974 – Apple II 1977 – IBM PC 2001 Copyright 2011 Bollinger Capital Management 5

S 100 • A backplane or buss to which you added boards – CPU

S 100 • A backplane or buss to which you added boards – CPU – I/O – Memory – CP/M operating system Copyright 2011 Bollinger Capital Management 6

The Architecture Choice • User chooses – S 100 – Intel 8080 series (Zylog

The Architecture Choice • User chooses – S 100 – Intel 8080 series (Zylog Z 80) • Memory mapped – Apple – MOS 6502 • Port driven – IBM PC – Intel 8080 series Copyright 2011 Bollinger Capital Management 7

A Huge Benefit • Quite often one had to write one’s own i/o for

A Huge Benefit • Quite often one had to write one’s own i/o for peripherals – Machine code or Assembly language • Learning was not a choice – Logic – Octal and hex math – Register manipulations – Bitwise operations Copyright 2011 Bollinger Capital Management 8

Now you could start computing • But there were no programs • Well, there

Now you could start computing • But there were no programs • Well, there was Adventure and Missile Command. . . Copyright 2011 Bollinger Capital Management 9

A Programming Language • BASIC – Beginners All-purpose Symbolic Instructional Code – Various flavors

A Programming Language • BASIC – Beginners All-purpose Symbolic Instructional Code – Various flavors • Microsoft – Microcomputer Software – Bill Gates’ first product – MBASIC – BASIC for CP/M Copyright 2011 Bollinger Capital Management 10

A Database • • d. BASE II 1979 Aston Tate A horror, but it

A Database • • d. BASE II 1979 Aston Tate A horror, but it pointed the way Copyright 2011 Bollinger Capital Management 11

A Spreadsheet • • Super. Calc Sorcim 1980 Small, light and agile Copyright 2011

A Spreadsheet • • Super. Calc Sorcim 1980 Small, light and agile Copyright 2011 Bollinger Capital Management 12

And Then Came the PC • With those few tools we accomplished a lot

And Then Came the PC • With those few tools we accomplished a lot • But the PC really opened up the horizon • The key was its open architecture Copyright 2011 Bollinger Capital Management 13

BASIC • • MBASIC (CP/M) BASICA / GWBASIC (DOS) Quick. BASIC (Compiler) (DOS) (IDE)

BASIC • • MBASIC (CP/M) BASICA / GWBASIC (DOS) Quick. BASIC (Compiler) (DOS) (IDE) Visual. BASIC (Windows) (GUI) Copyright 2011 Bollinger Capital Management 14

A Reach Too Far • . NET was a step more than I wanted

A Reach Too Far • . NET was a step more than I wanted to take • At the time there really weren’t any good cross-platform BASIC alternatives • So Microsoft left me behind and. . . • I started searching for a new language Copyright 2011 Bollinger Capital Management 15

My Language Specs • • Open / free (gnuplot) Very high level Widely adopted

My Language Specs • • Open / free (gnuplot) Very high level Widely adopted Simple syntax / easy to read Robust interfaces / play well with others Compact Good development tools Strong community Copyright 2011 Bollinger Capital Management 16

Python • My choice was Python • A choice I have had no reason

Python • My choice was Python • A choice I have had no reason to regret • Python remains my main programming language • We also use it in production for our websites as a ‘glue’ language Copyright 2011 Bollinger Capital Management 17

Crusher • Realizing the power I now had at my beck and call I

Crusher • Realizing the power I now had at my beck and call I almost immediately set out on a new project • Crusher – Technical Analysis tools, testing and deployment – open source Copyright 2011 Bollinger Capital Management 18

Crusher • Crusher went quickly and well • Almost immediately someone suggested building Crusher

Crusher • Crusher went quickly and well • Almost immediately someone suggested building Crusher on top of R • After investigating I realized that R was developing into a powerful tool that I could easily access from Python • So, I off-loaded all Crusher’s statistics calculations to R Copyright 2011 Bollinger Capital Management 19

Crusher • I wasn’t happy leading an open source project • I wanted to

Crusher • I wasn’t happy leading an open source project • I wanted to get back to trading • So I forked Crusher and continued development in house as an adjunct to my trading / analytical process Copyright 2011 Bollinger Capital Management 20

So, My Solution Was: • Python / Pyscripter • Num. Py / Sci. Py

So, My Solution Was: • Python / Pyscripter • Num. Py / Sci. Py • R / Tinn-R (moving to RStudio. . . ) – Tinn was my light editor of choice pre-R • gnuplot • My. SQL / SQLite • Various connectors Copyright 2011 Bollinger Capital Management 21

The Next Logical Step • Write your own very-high-level language • Trade – The

The Next Logical Step • Write your own very-high-level language • Trade – The first version – open source • BBScript – Real-time interactive interpreter – Written in Action. Script to take advantage of a real-time charting environment also written in Action. Script – Fully Trade compatible Copyright 2011 Bollinger Capital Management 22

Speaking of Logic • Write your own logic • Around 1990 FNN’s chief engineer,

Speaking of Logic • Write your own logic • Around 1990 FNN’s chief engineer, Gene Stratton, and I wrote a three valued logic for traders • 1, 0, -1 • long, flat, short • This proved to be VERY useful Copyright 2011 Bollinger Capital Management 23

The Fuzzy Logical Step • Equity. Trader. com needed fuzzy logic for its modeling

The Fuzzy Logical Step • Equity. Trader. com needed fuzzy logic for its modeling approach • The problem with being an early adopter is that you have to write it. . . • And so we did. . . • That project ultimately led to a long involvement with fuzzy logic Copyright 2011 Bollinger Capital Management 24

 • Speaking of being an early adopter and having to write it. .

• Speaking of being an early adopter and having to write it. . . Copyright 2011 Bollinger Capital Management 25

Bollinger Bands • Developed on an S 100 computer – Z 80 at 1.

Bollinger Bands • Developed on an S 100 computer – Z 80 at 1. 1 megahertz – 64 kilobytes memory – Dual 180 k floppy disk drives – 10 megabyte hard disk – Lear Siegler ADM 3 a terminal Copyright 2011 Bollinger Capital Management 26

Volatility • At the time it was believed that volatility was a fixed quantity

Volatility • At the time it was believed that volatility was a fixed quantity • A property of a security • Beta – Measured once a year – Five years of weekly data – IBM’s Beta was 1. 2 Copyright 2011 Bollinger Capital Management 27

Volatility • If beta changed at all it was thought to change very gradually

Volatility • If beta changed at all it was thought to change very gradually • For example, over the life cycle of a firm • From high to low as the firm matured • This was GOSPEL Copyright 2011 Bollinger Capital Management 28

Trading Options • • • Options, rights, warrants, convertibles. . . Volatility estimates were

Trading Options • • • Options, rights, warrants, convertibles. . . Volatility estimates were key Rules of thumb Not at all efficient Loads of opportunities Copyright 2011 Bollinger Capital Management 29

Percentage Bands • A moving average plus/minus a given percent of itself • Different

Percentage Bands • A moving average plus/minus a given percent of itself • Different parameters from issue to issue • Different parameters from time to time • Setting the bands allowed emotions into the process Copyright 2011 Bollinger Capital Management 30

Bollinger Bands • There had to be a better way • One day I

Bollinger Bands • There had to be a better way • One day I copied a formula for volatility down a column in Supercalc and noticed that the values were dynamic. . . • It was one of those Aha! moments Copyright 2011 Bollinger Capital Management 31

Bollinger Bands • Russ Herrold (Trading-shim) calls BBs: • Autoscaling variance bands • An

Bollinger Bands • Russ Herrold (Trading-shim) calls BBs: • Autoscaling variance bands • An apt description Copyright 2011 Bollinger Capital Management 32

A Nobel Prize • • Economics 2003 Robert F. Engle III “for methods of

A Nobel Prize • • Economics 2003 Robert F. Engle III “for methods of analyzing economic time series with time-varying volatility (ARCH)” • Tim Bollerslev (GARCH) mentioned, but not awarded Copyright 2011 Bollinger Capital Management 33

So, what are the opportunities today? • False beliefs create opportunities for the clear

So, what are the opportunities today? • False beliefs create opportunities for the clear sighted • Much of modern finance is simply incorrect • The theories are quite nice • But, they do not model the realities well Copyright 2011 Bollinger Capital Management 34

Opportunities • • • Distributions are not normal Correlations converge on one Markets are

Opportunities • • • Distributions are not normal Correlations converge on one Markets are not efficient Investors and traders are deeply flawed There is no such thing as a rational investor • There are many anomalies Copyright 2011 Bollinger Capital Management 35

Opportunities • Volatility is not mean reverting • Using volatility for position sizing is

Opportunities • Volatility is not mean reverting • Using volatility for position sizing is a mistake Copyright 2011 Bollinger Capital Management 36

Technical Analysis • A numerical approach to the markets • All the way back

Technical Analysis • A numerical approach to the markets • All the way back to Robert Levy technicians and quants have been of a piece Copyright 2011 Bollinger Capital Management 37

A Bridge • R-SIG-Finance • https: //stat. ethz. ch/mailman/listinfo/r-sigfinance • The Markets list •

A Bridge • R-SIG-Finance • https: //stat. ethz. ch/mailman/listinfo/r-sigfinance • The Markets list • http: //mailman. bollingerbands. com/mailma n/listinfo/markets Copyright 2011 Bollinger Capital Management 38

The Markets List • • • A very old technical analysis forum Started in

The Markets List • • • A very old technical analysis forum Started in 1985 by Curt Kyhl Many homes over the years Just won’t die I have been hosting the Markets list since September 2003 Copyright 2011 Bollinger Capital Management 39

A Giveaway! • • “R Cookbook” Paul Teetor O’Reilly 2011 Copyright 2011 Bollinger Capital

A Giveaway! • • “R Cookbook” Paul Teetor O’Reilly 2011 Copyright 2011 Bollinger Capital Management 40

First Copy • • • Who wrote S? And. . . In what year?

First Copy • • • Who wrote S? And. . . In what year? And. . . Where? Copyright 2011 Bollinger Capital Management 41

First Copy • John Chambers • 1975/6 • Bell Labs – Murray Hill, New

First Copy • John Chambers • 1975/6 • Bell Labs – Murray Hill, New Jersey Copyright 2011 Bollinger Capital Management 42

Second Copy • Who was Nicolaus II Bernoulli • And. . . • Why

Second Copy • Who was Nicolaus II Bernoulli • And. . . • Why do we care? Copyright 2011 Bollinger Capital Management 43

Second Copy • A Swiss mathematician living in St. Petersburg • St. Petersburg Paradox

Second Copy • A Swiss mathematician living in St. Petersburg • St. Petersburg Paradox • Maximize the geometric growth rate – This is still heretical in some circles • Leads to modern position sizing (Kelly) Copyright 2011 Bollinger Capital Management 44

Third Copy • • • Who wrote R? And. . . In what year?

Third Copy • • • Who wrote R? And. . . In what year? And. . . Where? Copyright 2011 Bollinger Capital Management 45

Third Copy • Ross Ihaka and Robert Gentleman • 1976 • University of Auckland,

Third Copy • Ross Ihaka and Robert Gentleman • 1976 • University of Auckland, New Zealand Copyright 2011 Bollinger Capital Management 46

Fourth Copy • • What was the first spreadsheet program? And. . . Who

Fourth Copy • • What was the first spreadsheet program? And. . . Who wrote it? And. . . In what year? And. . . For what platform? Copyright 2011 Bollinger Capital Management 47

Fourth Copy • • Visi. Calc Dan Bricklin and Bob Frankston 1979 Apple ][

Fourth Copy • • Visi. Calc Dan Bricklin and Bob Frankston 1979 Apple ][ Copyright 2011 Bollinger Capital Management 48

Correspondence • BBands@BBands. com Copyright 2011 Bollinger Capital Management 49

Correspondence • BBands@BBands. com Copyright 2011 Bollinger Capital Management 49

Bollinger Band Websites www. Bollinger. Bands. com www. BBForex. com Copyright 2011 Bollinger Capital

Bollinger Band Websites www. Bollinger. Bands. com www. BBForex. com Copyright 2011 Bollinger Capital Management 50