SlideShare a Scribd company logo
1 of 12
Download to read offline
The Strategic Analysis of
Financial Markets
Volume 2
Trading System Analytics
Steven D. Moffitt, Ph.D.
2013-12-29
©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced
or distributed without express written permission.
ii
Contents
I Cash Flows 621
12 Cash Flow Analysis: Statics 623
12.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
12.2 Cash Flow Streams . . . . . . . . . . . . . . . . . . . . . . . . 624
12.3 Interest Rate Conventions . . . . . . . . . . . . . . . . . . . . 625
12.4 Flat Rate Valuation . . . . . . . . . . . . . . . . . . . . . . . 627
12.5 Duration and Convexity . . . . . . . . . . . . . . . . . . . . . 629
12.6 Bond Valuation . . . . . . . . . . . . . . . . . . . . . . . . . . 631
12.7 Yield Curve and Term Structure . . . . . . . . . . . . . . . . 632
12.8 Term Structure Modelling . . . . . . . . . . . . . . . . . . . . 633
12.8.1 Brief History of the Yield Curve . . . . . . . . . . . . 633
12.8.2 Spline Fitting . . . . . . . . . . . . . . . . . . . . . . . 634
12.8.3 Parametric Methods . . . . . . . . . . . . . . . . . . . 635
12.9 Theories of the Yield Curve . . . . . . . . . . . . . . . . . . . 638
12.10U.S. Treasury Markets and the Federal Reserve . . . . . . . . 640
12.11Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
13 Cash Flow Analysis: Dynamics 643
13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
13.2 PCA on the Yield Curve . . . . . . . . . . . . . . . . . . . . . 644
13.2.1 Eigenvalue Decomposition of the Covariance Matrix . 644
13.2.2 PCA Decomposition of the Covariance Matrix . . . . . 645
13.2.3 PCA for the Yield Curve . . . . . . . . . . . . . . . . 648
13.3 ICA for the Yield Curve . . . . . . . . . . . . . . . . . . . . . 650
13.3.1 A Simple Example of ICA . . . . . . . . . . . . . . . . 650
13.3.2 Generalizing ICA to Mixed Random Variables . . . . . 652
13.3.3 Why Non-Gaussianity? . . . . . . . . . . . . . . . . . . 654
13.3.4 An Algorithm for ICA Estimation . . . . . . . . . . . 655
13.3.5 Using the ICA Algorithm on Yield Curve Data . . . . 659
iii
©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced
or distributed without express written permission.
13.3.6 Discussion of ICA on the Yield Curve . . . . . . . . . 662
13.4 PCA and ICA on Yield Curve Differences . . . . . . . . . . . 667
13.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
14 Trading Systems for the Yield Curve 673
14.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673
14.2 The Dataset - Interest Rate Futures:
1981 - 2008 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674
14.2.1 The Eurodollar Market . . . . . . . . . . . . . . . . . 674
14.2.2 Eurodollar Futures . . . . . . . . . . . . . . . . . . . . 674
14.2.3 The Eurodollar Dataset . . . . . . . . . . . . . . . . . 677
14.3 ICA Analysis of Constant Maturity Prices . . . . . . . . . . . 682
14.3.1 Formal ICA Analysis . . . . . . . . . . . . . . . . . . . 682
14.3.2 Can these Constant Maturity Signals be Traded? . . . 687
14.3.3 Conclusions on the Constant Maturity Method . . . . 689
14.4 Modifying the Constant Maturity Method . . . . . . . . . . . 690
14.5 Causes of Regular Patterns in Eurodollar Futures . . . . . . . 693
14.5.1 Source of Arbitrage: The Federal Reserve System and
the Spirit of the Times . . . . . . . . . . . . . . . . . . 693
14.5.2 Source of Arbitrage: Segmentation that Causes Yield
Curve Patterns . . . . . . . . . . . . . . . . . . . . . . 698
14.5.3 Source of Arbitrage: Event Plays . . . . . . . . . . . . 699
14.5.4 Source of Arbitrage: Inefficient Forward Markets . . . 699
14.6 Analysis of Eurodollar Rolls . . . . . . . . . . . . . . . . . . . 700
14.6.1 Constructing a Dataset for Event Analysis . . . . . . . 700
14.6.2 The Eurodollar Expiration Event Dataset . . . . . . . 701
14.6.3 Statistical Analysis of the Event Dataset EFEED . . . 703
14.7 Analysis of Eurodollar Expirations . . . . . . . . . . . . . . . 719
14.7.1 Analysis of the Eurodollar EFEED-3 Dataset . . . . . 719
14.7.2 Returns from Quarterly Rolls . . . . . . . . . . . . . . 721
14.7.3 Analysis of the EFEED-3 Strategy 2 and the Eurodol-
lar Roll Strategy . . . . . . . . . . . . . . . . . . . . . 722
14.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
II Trading System Tools 729
15 Regression and Prediction for Trading System Development731
15.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
15.2 On Statistical Methods for Financial Data . . . . . . . . . . . 732
iv
©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced
or distributed without express written permission.
15.2.1 Are Standard Statistical Models Appropriate for Fi-
nancial Time Series? . . . . . . . . . . . . . . . . . . . 732
15.3 Parametric Linear and Nonlinear Models . . . . . . . . . . . . 733
15.4 Justification of this Book’s Approach to Data Modeling . . . 734
15.5 Smoothing Methods . . . . . . . . . . . . . . . . . . . . . . . 735
15.5.1 Example Data for Smoothers . . . . . . . . . . . . . . 738
15.5.2 Smoothing Splines . . . . . . . . . . . . . . . . . . . . 738
15.5.3 Kernel Smoothers . . . . . . . . . . . . . . . . . . . . . 739
15.5.4 k-Nearest Neighbors . . . . . . . . . . . . . . . . . . . 740
15.5.5 Loess . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
15.5.6 Friedman’s Supersmoother . . . . . . . . . . . . . . . . 742
15.5.7 Conclusions on Smoothers . . . . . . . . . . . . . . . . 744
15.6 Nonlinear and Semiparametric Regression Methods . . . . . . 744
15.6.1 The World Equity Dataset . . . . . . . . . . . . . . . . 744
15.6.2 ACE Models . . . . . . . . . . . . . . . . . . . . . . . 745
15.6.3 AVAS Models . . . . . . . . . . . . . . . . . . . . . . . 749
15.6.4 Projection Pursuit Regression . . . . . . . . . . . . . . 751
15.6.5 Generalized Additive Models (GAM) . . . . . . . . . . 752
15.7 Prediction for Financial Time Series . . . . . . . . . . . . . . 756
15.7.1 Simple and Exponential Moving Average Prediction . . 758
15.7.2 Classical Time Series Prediction . . . . . . . . . . . . 759
15.7.3 Nearest Neighbor Prediction . . . . . . . . . . . . . . . 759
15.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760
16 Mechanical Methods For Trading Systems Testing and Im-
provement 763
16.1 Introduction to Trading Systems Testing and Improvement . 763
16.2 The Nuts and Bolts of Trading Systems . . . . . . . . . . . . 764
16.2.1 Trading Systems for Single Financial Instruments . . . 764
16.2.2 Orders, Transactions, Fees & Slippage . . . . . . . . . 765
16.2.3 Transactional Format . . . . . . . . . . . . . . . . . . 766
16.2.4 Positional Format . . . . . . . . . . . . . . . . . . . . 766
16.2.5 Trade & Transaction Histories . . . . . . . . . . . . . . 767
16.2.6 Trading System Summaries . . . . . . . . . . . . . . . 768
16.3 Trading System Examples . . . . . . . . . . . . . . . . . . . . 770
16.3.1 Trading System A . . . . . . . . . . . . . . . . . . . . 770
16.3.2 Trading System B . . . . . . . . . . . . . . . . . . . . 772
16.4 Basics of Trade Sizing . . . . . . . . . . . . . . . . . . . . . . 773
16.4.1 Uncorrelated Returns . . . . . . . . . . . . . . . . . . 773
16.4.2 Return-predicting Covariates . . . . . . . . . . . . . . 774
v
©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced
or distributed without express written permission.
16.5 Principles and Methods for Backtesting . . . . . . . . . . . . 776
16.5.1 Trading System Homogeneity . . . . . . . . . . . . . . 777
16.5.2 Trading System Predictability . . . . . . . . . . . . . . 790
16.5.3 Trading System Robustness . . . . . . . . . . . . . . . 794
16.6 Mechanical Choices for Trading System Improvement . . . . . 796
16.6.1 Trading System Improvement: Stop-Loss Orders . . . 798
16.6.2 Trading System Improvement: Covariables . . . . . . . 803
16.6.3 Trading System Improvement: Leverage . . . . . . . . 804
16.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808
17 The Mean-Variance World 811
17.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811
17.2 Portfolio Analysis using Means and Variances . . . . . . . . . 812
17.2.1 One-Period Portfolio Analysis . . . . . . . . . . . . . . 812
17.2.2 Portfolio Distributions . . . . . . . . . . . . . . . . . . 814
17.2.3 Extending One Time Period to Multiple Periods . . . 815
17.3 The Mean-Variance World . . . . . . . . . . . . . . . . . . . . 815
17.4 Mean-Variance Portfolio Analysis . . . . . . . . . . . . . . . . 816
17.4.1 Efficient Frontier . . . . . . . . . . . . . . . . . . . . . 816
17.4.2 Mean Variance Analysis with Non-negativity
Constraints . . . . . . . . . . . . . . . . . . . . . . . . 817
17.4.3 Setting up MVPT Problems for Computer Solution . . 819
17.4.4 The Two Fund Theorem . . . . . . . . . . . . . . . . . 820
17.4.5 Inclusion of a Risk-Free Asset And the One Fund The-
orem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 821
17.5 The Capital Asset Pricing Model . . . . . . . . . . . . . . . . 823
17.5.1 CAPM Assumptions . . . . . . . . . . . . . . . . . . . 823
17.5.2 The Argument for CAPM . . . . . . . . . . . . . . . . 825
17.6 Critique of MVPT and CAPM . . . . . . . . . . . . . . . . . 828
17.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830
18 APT and Factor Models 831
18.1 Arbitrage Pricing Theory and Factor Models . . . . . . . . . 831
18.2 Part 1: A One Period Factor Model . . . . . . . . . . . . . . . 833
18.3 Factor Models with Unobserved Factors . . . . . . . . . . . . 835
18.3.1 Uncorrelated Factors . . . . . . . . . . . . . . . . . . . 835
18.4 Unobserved Factor Estimation . . . . . . . . . . . . . . . . . . 836
18.4.1 Uncorrelated Factors . . . . . . . . . . . . . . . . . . . 836
18.5 Multiperiod Factor Models with Observed Factors . . . . . . . 842
18.5.1 Estimation for Observed Factor Models . . . . . . . . 844
vi
©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced
or distributed without express written permission.
18.6 Selecting Factors in Unobserved Factor Models . . . . . . . . 845
18.6.1 Interpreting Unobserved Factor Models . . . . . . . . 848
18.6.2 Factor Model Portfolios . . . . . . . . . . . . . . . . . 853
18.7 Part 2: Multiperiod Factor Models . . . . . . . . . . . . . . . 854
18.7.1 Review of the One Period Factor Models . . . . . . . . 854
18.7.2 The Basic Multiperiod Factor Model . . . . . . . . . . 855
18.7.3 Three Versions of the Basic Multiperiod Model . . . . 857
18.7.4 Factor Models in Applied Finance . . . . . . . . . . . 858
18.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 864
19 Active Portfolio Management 867
19.1 Active vs. Passive Portfolio Management . . . . . . . . . . . . 867
19.1.1 Portfolio Managers and Benchmarks . . . . . . . . . . 868
19.1.2 Portfolio Management Methods . . . . . . . . . . . . . 868
19.1.3 Evidence for Superior Returns . . . . . . . . . . . . . . 870
19.1.4 How To Earn Superior Returns . . . . . . . . . . . . . 871
19.1.5 The Investment Domain . . . . . . . . . . . . . . . . . 873
19.2 Mean-Variance Active Management . . . . . . . . . . . . . . . 874
19.2.1 Portfolio Analysis . . . . . . . . . . . . . . . . . . . . . 874
19.2.2 One-Period Portfolio Analysis . . . . . . . . . . . . . . 875
19.2.3 The Mean-Variance and Capital Asset Pricing Models
of Return and Risk . . . . . . . . . . . . . . . . . . . . 876
19.2.4 Benchmarks: The Yardsticks of Performance . . . . . . 879
19.2.5 Active Management: The “Science” of Alpha . . . . . . 879
19.2.6 G&K Compensation for TM’s and MoM’s . . . . . . . 881
19.2.7 Active Management for Portfolios . . . . . . . . . . . . 882
19.2.8 Active Management Using a Utility Function . . . . . 884
19.2.9 Active Management: Value Added with the Active
Portfolio . . . . . . . . . . . . . . . . . . . . . . . . . . 885
19.2.10Residual Risk and Return: The Information Ratio . . 885
19.2.11Value Added for Active Management . . . . . . . . . . 887
19.2.12The Fundamental G&K Law of Active Management . 888
19.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 889
19.4 Critique . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891
19.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892
III Profitable Trading Systems 895
20 Break-Out Trend Following 897
vii
©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced
or distributed without express written permission.
20.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 897
20.2 Market Concepts and Terminology . . . . . . . . . . . . . . . 898
20.2.1 Data Description . . . . . . . . . . . . . . . . . . . . . 898
20.3 iRecent History of Break-out Systems . . . . . . . . . . . . . 899
20.4 Break-Outs: Why do they happen? . . . . . . . . . . . . . . . 901
20.5 Creating Break-out Trend Indicators . . . . . . . . . . . . . . 903
20.6 Creating a Training Variable . . . . . . . . . . . . . . . . . . . 906
20.7 Finding Market Patterns . . . . . . . . . . . . . . . . . . . . . 909
20.7.1 Creating a Break-Out Dataset . . . . . . . . . . . . . . 909
20.7.2 A PPR Trading System . . . . . . . . . . . . . . . . . 911
20.7.3 An ACE Trading System . . . . . . . . . . . . . . . . 921
20.7.4 An AVAS Trading System . . . . . . . . . . . . . . . . 924
20.7.5 An ICA Trading System . . . . . . . . . . . . . . . . . 925
20.8 Critique of Systems . . . . . . . . . . . . . . . . . . . . . . . . 929
20.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 931
21 The Family of Trend Anomalies 933
21.1 The Trending Agenda . . . . . . . . . . . . . . . . . . . . . . 933
21.2 Do Tradable Trends Exist? . . . . . . . . . . . . . . . . . . . 934
21.2.1 What is the Difference between Trending and Momen-
tum? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 934
21.2.2 Evidence that Profitable Trends Exist . . . . . . . . . 934
21.2.3 Defining Trends . . . . . . . . . . . . . . . . . . . . . . 935
21.2.4 Detecting Trends . . . . . . . . . . . . . . . . . . . . . 936
21.3 Background on Trends and “Trend Anomalies” . . . . . . . . . 937
21.3.1 Examples of Trends . . . . . . . . . . . . . . . . . . . 937
21.3.2 Trend-Inducing Distorters . . . . . . . . . . . . . . . . 940
21.4 Strategic Causes of Herding . . . . . . . . . . . . . . . . . . . 946
21.4.1 Herding among Individual Investors . . . . . . . . . . 948
21.4.2 Herding among Institutions and Mutual Funds . . . . 949
21.4.3 Herding among Analysts . . . . . . . . . . . . . . . . . 950
21.5 Strategic Causes of Momentum and the Disposition Effect . . 952
21.5.1 A Trader’s View of Momentum . . . . . . . . . . . . . 952
21.5.2 Empirical Findings on Relationships of Momentum to
Herding, Positive Feedback and the Disposition Effect 953
21.5.3 The Grinblatt & Han Model for Momentum . . . . . . 955
21.5.4 The Frazzini Mutual Fund Model . . . . . . . . . . . . 961
21.5.5 The Frazzini-Lamont Dumb Money Model . . . . . . . 965
21.5.6 Momentum Crashes . . . . . . . . . . . . . . . . . . . 970
viii
©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced
or distributed without express written permission.
21.5.7 Conclusions on Strategic Causes of Momentum and
the Disposition Effect . . . . . . . . . . . . . . . . . . 972
21.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973
21.6.1 The Significance of Herding . . . . . . . . . . . . . . . 973
21.6.2 What about Over/Underreaction? . . . . . . . . . . . 975
21.6.3 What is the Role of the Disposition Effect? . . . . . . 976
21.6.4 What about Momentum? . . . . . . . . . . . . . . . . 976
22 Volatility Arbitrage and Pairs Trading 977
22.1 Origins of Excess Volatility . . . . . . . . . . . . . . . . . . . 977
22.2 Short-term Excess Volatility . . . . . . . . . . . . . . . . . . . 979
22.3 Capturing Excess Volatility . . . . . . . . . . . . . . . . . . . 984
22.4 Effects of Pairs Strategies on a Market . . . . . . . . . . . . . 985
22.5 More on Excess Volatility . . . . . . . . . . . . . . . . . . . . 988
22.6 Physical Analogies to Market Crashes . . . . . . . . . . . . . 990
22.7 Volatility in the 1987 Stock Market Crash . . . . . . . . . . . 990
22.8 Implementing a Volatility Capture Strategy . . . . . . . . . . 993
22.8.1 Introduction: What are Pairs Strategies and Market-
Neutral Strategies? . . . . . . . . . . . . . . . . . . . . 993
22.9 A Simple Pairs Strategy . . . . . . . . . . . . . . . . . . . . . 994
22.9.1 Acquisition of Historical Prices, Volumes, Splits and
Dividends . . . . . . . . . . . . . . . . . . . . . . . . . 994
22.9.2 Developing a Measure of Overbought and Oversold Pairs996
22.9.3 Determining the Measure m(S1, S2) . . . . . . . . . . 998
22.9.4 Generating Entry and Exit Trades . . . . . . . . . . . 1000
22.9.5 Calculating Profits and Losses . . . . . . . . . . . . . . 1001
22.10An R-language Script for an Equity Pairs System . . . . . . . 1003
22.10.1Evaluation of Cumulative P&L for the Bollinger Pairs
System . . . . . . . . . . . . . . . . . . . . . . . . . . . 1008
22.11Discussion of the Bollinger Pairs System . . . . . . . . . . . . 1011
22.12Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1014
23 Epilogue 1015
23.1 The Logic of Markets and the Importance of Strategies . . . . 1015
23.2 Humans and Trading . . . . . . . . . . . . . . . . . . . . . . . 1016
23.3 Developing Trading Systems . . . . . . . . . . . . . . . . . . . 1018
23.4 Example Systems . . . . . . . . . . . . . . . . . . . . . . . . . 1019
23.4.1 The Tax Day Trade. . . . . . . . . . . . . . . . . . . . 1019
23.4.2 Eurodollar Expiration Trades. . . . . . . . . . . . . . . 1020
23.4.3 Breakout Trend Following. . . . . . . . . . . . . . . . . 1020
ix
©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced
or distributed without express written permission.
23.4.4 Pairs Trading. . . . . . . . . . . . . . . . . . . . . . . . 1020
23.5 Wrapping Up . . . . . . . . . . . . . . . . . . . . . . . . . . . 1021
A Linear Algebra And Quadratic Forms 1023
A.1 General Remarks . . . . . . . . . . . . . . . . . . . . . . . . . 1023
A.2 Vectors, Matrices and Normal Forms . . . . . . . . . . . . . . 1023
A.3 Quadratic Forms . . . . . . . . . . . . . . . . . . . . . . . . . 1031
A.4 Vector and Matrix Derivatives . . . . . . . . . . . . . . . . . . 1032
A.5 Optimization Problems . . . . . . . . . . . . . . . . . . . . . . 1033
B Statistical Tests for Financial Analysis 1035
B.1 A Note on Nonparametric Tests . . . . . . . . . . . . . . . . . 1036
B.2 Statistical Tests for Gaussianity . . . . . . . . . . . . . . . . . 1037
B.3 Testing for Randomness . . . . . . . . . . . . . . . . . . . . . 1046
B.3.1 Nonparametric Tests for Randomness: Runs Tests . . 1046
B.3.2 Nonparametric Tests for Randomness: Trend Tests . . 1049
B.4 Parametric Tests of Random Walks . . . . . . . . . . . . . . . 1052
B.5 Nonparametric Tests for Comparing Distributions . . . . . . . 1054
B.6 Time Series Tests . . . . . . . . . . . . . . . . . . . . . . . . . 1061
B.6.1 General Tests . . . . . . . . . . . . . . . . . . . . . . . 1061
B.6.2 Variance-Ratio Tests . . . . . . . . . . . . . . . . . . . 1064
C The R-Language Environment Used in this Book 1071
C.1 The R-Language . . . . . . . . . . . . . . . . . . . . . . . . . 1071
C.1.1 The CRAN Heading . . . . . . . . . . . . . . . . . . . 1072
C.1.2 The ’About R’ heading . . . . . . . . . . . . . . . . . 1073
C.1.3 The ’Software’ heading . . . . . . . . . . . . . . . . . . 1074
C.1.4 The ’Documentation’ heading . . . . . . . . . . . . . . 1074
C.2 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1075
C.3 Tutorials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1076
C.4 R Language Usage in the Book’s Example Datasets . . . . . . 1076
C.4.1 Dataset Naming . . . . . . . . . . . . . . . . . . . . . 1076
Glossary 1077
x
Preface
This is a book I wish I’d had when I learned finance.
Before I knew anything about financial markets, I’d already been a pro-
grammer for the Apollo lunar missions 8-14, had earned a M.S. in Math-
ematics, a Ph.D. in statistics and had worked as a biostatistician for the
better part of a decade. Especially from my work as an applied statistician,
I’d become skeptical of classical parametric statistical methods. The reason
was that I pretty much never found data that appeared to satisfy its dis-
tributional assumptions and because those methods had been developed in
a pre-computer era, where only the most primitive calculations were possi-
ble. You see, I was one of the vanguards of the computer revolution. With
all that additional computing power, I thought, certainly there were better
methods than ones based only on means and variances.
But I also had a parallel career as an amateur games player and gambler.
I’d become a competent chess player, winning titles in two states. For a while,
I was a top-ranked backgammon player. I went to “school” as an evening
gambler, and learned what it takes to win at games of chance. Gambling
was also great preparation for my later work in the financial markets.
Given this background, I entered the financial arena as an options floor
trader on the Philadelphia Options Exchange, still without any real knowl-
edge of theoretical or practical finance. But I taught myself what I needed
to know about options modelling. When I saw how options were traded in
the pits, I realized that “theoretical values” were a just a convenient bench-
mark; all good traders knew that options prices were often forecasting hidden
information about their underlyings. In the case of stocks, the hidden infor-
mation could be considerable — insiders could know the day and hour of a
significant announcement about a specific stock. But it was hard to imag-
ine that they could know the same about the S&P 500 stock index, so not
all tradable securities were created equal. Thus things that lay outside any
model could confer a great edge, things like unusual buying of an out-of-the
xi
©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced
or distributed without express written permission.
money put just before expiration, small orders delivered by Merrill Lynch
brokers, probably representing the uninformed trade of a retail client, large
orders delivered by a “cheater’s” broker, probably representing an informed
institutional client, and unusual call buying in a “take-over” stock.
So I entered the financial world with scientist/statistician/gambler bi-
ases. As I became acquainted with financial theory, with its rational actors
and efficient markets, I realized immediately how misguided it was. Games
players are not rational — they do not try to maximize some hypothetical
utility function. There are good players, mediocre players and bad players.
Any good game player knows that to win you do not need to be great, you
only need to play better than your competitors. Given these beliefs, how
could I accept that markets are efficient? It just made no sense.
This is the second volume of a two volume series, which discusses finan-
cial theory and methods from a gambler’s viewpoint. It is intended for a
sophisticated reader who already knows basic finance, calculus, linear alge-
bra and statistics. In my view, anyone who aspires to be a quantitative
analyst in financial markets will find this book helpful.
The first volume in the series, “The Strategic Analysis of Financial Mar-
kets: A Gambler’s Guide,” offered a “gambling-theoretical” perspective on
financial markets. The flesh-and-blood gambler who wished to apply the
principles from Volume 1 needs quantitative techniques for his or her quest.
This, the second volume describes methods that have demonstrated value in
that quest without any claim of completeness.
While the first volume critiques mainstream finance and offers a per-
spective that I believe mirrors the views of many financial practitioners —
the second shows how that perspective leads to modifications of standard
financial methods and has produced winning trading systems.
I’d like to thank many people who have had some part in shaping my
ideas about markets. A few of my colleagues in the academic world have
been influential: Mike Kutner, Mike Lynn, John Bilson, Russell Wojick and
Bruce Rawlings. A few games-players and gamblers deserve mention: Dan
Harrington, Andy Glazer, the Shores brothers and Harry Pace. And of
course, traders: Howard Ring, Alvin Dodek, Will Hobert and several of the
Susquehanna partners. Apologies to the many I neglected to include. Spe-
cial thanks to my wife Patty, whose forebearance during the writing was
essential.
Steven D. Moffitt, Ph.D.
December 29, 2013.
xii

More Related Content

What's hot

What's hot (16)

Engineering symbology-prints-and-drawings-handbook
Engineering symbology-prints-and-drawings-handbookEngineering symbology-prints-and-drawings-handbook
Engineering symbology-prints-and-drawings-handbook
 
Lecturenotesstatistics
LecturenotesstatisticsLecturenotesstatistics
Lecturenotesstatistics
 
Ibm spss direct_marketing
Ibm spss direct_marketingIbm spss direct_marketing
Ibm spss direct_marketing
 
Thesis
ThesisThesis
Thesis
 
Fixed income securities_and_derivatives_handbook_analysis_and_valuation
Fixed income securities_and_derivatives_handbook_analysis_and_valuationFixed income securities_and_derivatives_handbook_analysis_and_valuation
Fixed income securities_and_derivatives_handbook_analysis_and_valuation
 
Offshore wind-development-program-offshore-wind-roadmap-for-vietnam
Offshore wind-development-program-offshore-wind-roadmap-for-vietnamOffshore wind-development-program-offshore-wind-roadmap-for-vietnam
Offshore wind-development-program-offshore-wind-roadmap-for-vietnam
 
Direct Current (DC)
Direct Current (DC)Direct Current (DC)
Direct Current (DC)
 
Alternating Current (AC)
Alternating Current (AC)Alternating Current (AC)
Alternating Current (AC)
 
Dc
DcDc
Dc
 
Joints manual
Joints manualJoints manual
Joints manual
 
Dc
DcDc
Dc
 
AdvFS 1024 ACLs
AdvFS 1024 ACLsAdvFS 1024 ACLs
AdvFS 1024 ACLs
 
Math for programmers
Math for programmersMath for programmers
Math for programmers
 
Final
FinalFinal
Final
 
Abs maneuverability
Abs   maneuverabilityAbs   maneuverability
Abs maneuverability
 
AdvFS ACLs and Property Lists
AdvFS ACLs and Property ListsAdvFS ACLs and Property Lists
AdvFS ACLs and Property Lists
 

Similar to TSAOFMv2.TableOfContents

R data mining_clear
R data mining_clearR data mining_clear
R data mining_clear
sinanspoon
 
vdoc.pub_static-timing-analysis-for-nanometer-designs-a-practical-approach-.pdf
vdoc.pub_static-timing-analysis-for-nanometer-designs-a-practical-approach-.pdfvdoc.pub_static-timing-analysis-for-nanometer-designs-a-practical-approach-.pdf
vdoc.pub_static-timing-analysis-for-nanometer-designs-a-practical-approach-.pdf
quandao25
 
Team Omni L2 Requirements Revised
Team Omni L2 Requirements RevisedTeam Omni L2 Requirements Revised
Team Omni L2 Requirements Revised
Andrew Daws
 
Virtual Environments as Driving Schools for Deep Learning Vision-Based Sensor...
Virtual Environments as Driving Schools for Deep Learning Vision-Based Sensor...Virtual Environments as Driving Schools for Deep Learning Vision-Based Sensor...
Virtual Environments as Driving Schools for Deep Learning Vision-Based Sensor...
Artur Filipowicz
 
Methods for Applied Macroeconomic Research.pdf
Methods for Applied Macroeconomic Research.pdfMethods for Applied Macroeconomic Research.pdf
Methods for Applied Macroeconomic Research.pdf
Comrade15
 

Similar to TSAOFMv2.TableOfContents (20)

Dm
DmDm
Dm
 
book.pdf
book.pdfbook.pdf
book.pdf
 
R data mining_clear
R data mining_clearR data mining_clear
R data mining_clear
 
vdoc.pub_static-timing-analysis-for-nanometer-designs-a-practical-approach-.pdf
vdoc.pub_static-timing-analysis-for-nanometer-designs-a-practical-approach-.pdfvdoc.pub_static-timing-analysis-for-nanometer-designs-a-practical-approach-.pdf
vdoc.pub_static-timing-analysis-for-nanometer-designs-a-practical-approach-.pdf
 
Team Omni L2 Requirements Revised
Team Omni L2 Requirements RevisedTeam Omni L2 Requirements Revised
Team Omni L2 Requirements Revised
 
Master_Thesis
Master_ThesisMaster_Thesis
Master_Thesis
 
Smart Grid.pdf
Smart Grid.pdfSmart Grid.pdf
Smart Grid.pdf
 
Deep learning_ adaptive computation and machine learning ( PDFDrive ).pdf
Deep learning_ adaptive computation and machine learning ( PDFDrive ).pdfDeep learning_ adaptive computation and machine learning ( PDFDrive ).pdf
Deep learning_ adaptive computation and machine learning ( PDFDrive ).pdf
 
Applied Statistics With R
Applied Statistics With RApplied Statistics With R
Applied Statistics With R
 
Design of a regional aircaft
Design of a regional aircaftDesign of a regional aircaft
Design of a regional aircaft
 
Dimensional modelling sg247138
Dimensional modelling sg247138Dimensional modelling sg247138
Dimensional modelling sg247138
 
Virtual Environments as Driving Schools for Deep Learning Vision-Based Sensor...
Virtual Environments as Driving Schools for Deep Learning Vision-Based Sensor...Virtual Environments as Driving Schools for Deep Learning Vision-Based Sensor...
Virtual Environments as Driving Schools for Deep Learning Vision-Based Sensor...
 
Methods for Applied Macroeconomic Research.pdf
Methods for Applied Macroeconomic Research.pdfMethods for Applied Macroeconomic Research.pdf
Methods for Applied Macroeconomic Research.pdf
 
MSc_Dissertation
MSc_DissertationMSc_Dissertation
MSc_Dissertation
 
Introductory Statistics Explained.pdf
Introductory Statistics Explained.pdfIntroductory Statistics Explained.pdf
Introductory Statistics Explained.pdf
 
Thats How We C
Thats How We CThats How We C
Thats How We C
 
probabilidades.pdf
probabilidades.pdfprobabilidades.pdf
probabilidades.pdf
 
Pentest standard
Pentest standardPentest standard
Pentest standard
 
bachelor
bachelorbachelor
bachelor
 
python learn basic tutorial learn easy..
python learn basic tutorial learn easy..python learn basic tutorial learn easy..
python learn basic tutorial learn easy..
 

TSAOFMv2.TableOfContents

  • 1. The Strategic Analysis of Financial Markets Volume 2 Trading System Analytics Steven D. Moffitt, Ph.D. 2013-12-29
  • 2. ©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced or distributed without express written permission. ii
  • 3. Contents I Cash Flows 621 12 Cash Flow Analysis: Statics 623 12.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623 12.2 Cash Flow Streams . . . . . . . . . . . . . . . . . . . . . . . . 624 12.3 Interest Rate Conventions . . . . . . . . . . . . . . . . . . . . 625 12.4 Flat Rate Valuation . . . . . . . . . . . . . . . . . . . . . . . 627 12.5 Duration and Convexity . . . . . . . . . . . . . . . . . . . . . 629 12.6 Bond Valuation . . . . . . . . . . . . . . . . . . . . . . . . . . 631 12.7 Yield Curve and Term Structure . . . . . . . . . . . . . . . . 632 12.8 Term Structure Modelling . . . . . . . . . . . . . . . . . . . . 633 12.8.1 Brief History of the Yield Curve . . . . . . . . . . . . 633 12.8.2 Spline Fitting . . . . . . . . . . . . . . . . . . . . . . . 634 12.8.3 Parametric Methods . . . . . . . . . . . . . . . . . . . 635 12.9 Theories of the Yield Curve . . . . . . . . . . . . . . . . . . . 638 12.10U.S. Treasury Markets and the Federal Reserve . . . . . . . . 640 12.11Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641 13 Cash Flow Analysis: Dynamics 643 13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643 13.2 PCA on the Yield Curve . . . . . . . . . . . . . . . . . . . . . 644 13.2.1 Eigenvalue Decomposition of the Covariance Matrix . 644 13.2.2 PCA Decomposition of the Covariance Matrix . . . . . 645 13.2.3 PCA for the Yield Curve . . . . . . . . . . . . . . . . 648 13.3 ICA for the Yield Curve . . . . . . . . . . . . . . . . . . . . . 650 13.3.1 A Simple Example of ICA . . . . . . . . . . . . . . . . 650 13.3.2 Generalizing ICA to Mixed Random Variables . . . . . 652 13.3.3 Why Non-Gaussianity? . . . . . . . . . . . . . . . . . . 654 13.3.4 An Algorithm for ICA Estimation . . . . . . . . . . . 655 13.3.5 Using the ICA Algorithm on Yield Curve Data . . . . 659 iii
  • 4. ©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced or distributed without express written permission. 13.3.6 Discussion of ICA on the Yield Curve . . . . . . . . . 662 13.4 PCA and ICA on Yield Curve Differences . . . . . . . . . . . 667 13.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671 14 Trading Systems for the Yield Curve 673 14.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673 14.2 The Dataset - Interest Rate Futures: 1981 - 2008 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674 14.2.1 The Eurodollar Market . . . . . . . . . . . . . . . . . 674 14.2.2 Eurodollar Futures . . . . . . . . . . . . . . . . . . . . 674 14.2.3 The Eurodollar Dataset . . . . . . . . . . . . . . . . . 677 14.3 ICA Analysis of Constant Maturity Prices . . . . . . . . . . . 682 14.3.1 Formal ICA Analysis . . . . . . . . . . . . . . . . . . . 682 14.3.2 Can these Constant Maturity Signals be Traded? . . . 687 14.3.3 Conclusions on the Constant Maturity Method . . . . 689 14.4 Modifying the Constant Maturity Method . . . . . . . . . . . 690 14.5 Causes of Regular Patterns in Eurodollar Futures . . . . . . . 693 14.5.1 Source of Arbitrage: The Federal Reserve System and the Spirit of the Times . . . . . . . . . . . . . . . . . . 693 14.5.2 Source of Arbitrage: Segmentation that Causes Yield Curve Patterns . . . . . . . . . . . . . . . . . . . . . . 698 14.5.3 Source of Arbitrage: Event Plays . . . . . . . . . . . . 699 14.5.4 Source of Arbitrage: Inefficient Forward Markets . . . 699 14.6 Analysis of Eurodollar Rolls . . . . . . . . . . . . . . . . . . . 700 14.6.1 Constructing a Dataset for Event Analysis . . . . . . . 700 14.6.2 The Eurodollar Expiration Event Dataset . . . . . . . 701 14.6.3 Statistical Analysis of the Event Dataset EFEED . . . 703 14.7 Analysis of Eurodollar Expirations . . . . . . . . . . . . . . . 719 14.7.1 Analysis of the Eurodollar EFEED-3 Dataset . . . . . 719 14.7.2 Returns from Quarterly Rolls . . . . . . . . . . . . . . 721 14.7.3 Analysis of the EFEED-3 Strategy 2 and the Eurodol- lar Roll Strategy . . . . . . . . . . . . . . . . . . . . . 722 14.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724 II Trading System Tools 729 15 Regression and Prediction for Trading System Development731 15.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731 15.2 On Statistical Methods for Financial Data . . . . . . . . . . . 732 iv
  • 5. ©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced or distributed without express written permission. 15.2.1 Are Standard Statistical Models Appropriate for Fi- nancial Time Series? . . . . . . . . . . . . . . . . . . . 732 15.3 Parametric Linear and Nonlinear Models . . . . . . . . . . . . 733 15.4 Justification of this Book’s Approach to Data Modeling . . . 734 15.5 Smoothing Methods . . . . . . . . . . . . . . . . . . . . . . . 735 15.5.1 Example Data for Smoothers . . . . . . . . . . . . . . 738 15.5.2 Smoothing Splines . . . . . . . . . . . . . . . . . . . . 738 15.5.3 Kernel Smoothers . . . . . . . . . . . . . . . . . . . . . 739 15.5.4 k-Nearest Neighbors . . . . . . . . . . . . . . . . . . . 740 15.5.5 Loess . . . . . . . . . . . . . . . . . . . . . . . . . . . 741 15.5.6 Friedman’s Supersmoother . . . . . . . . . . . . . . . . 742 15.5.7 Conclusions on Smoothers . . . . . . . . . . . . . . . . 744 15.6 Nonlinear and Semiparametric Regression Methods . . . . . . 744 15.6.1 The World Equity Dataset . . . . . . . . . . . . . . . . 744 15.6.2 ACE Models . . . . . . . . . . . . . . . . . . . . . . . 745 15.6.3 AVAS Models . . . . . . . . . . . . . . . . . . . . . . . 749 15.6.4 Projection Pursuit Regression . . . . . . . . . . . . . . 751 15.6.5 Generalized Additive Models (GAM) . . . . . . . . . . 752 15.7 Prediction for Financial Time Series . . . . . . . . . . . . . . 756 15.7.1 Simple and Exponential Moving Average Prediction . . 758 15.7.2 Classical Time Series Prediction . . . . . . . . . . . . 759 15.7.3 Nearest Neighbor Prediction . . . . . . . . . . . . . . . 759 15.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760 16 Mechanical Methods For Trading Systems Testing and Im- provement 763 16.1 Introduction to Trading Systems Testing and Improvement . 763 16.2 The Nuts and Bolts of Trading Systems . . . . . . . . . . . . 764 16.2.1 Trading Systems for Single Financial Instruments . . . 764 16.2.2 Orders, Transactions, Fees & Slippage . . . . . . . . . 765 16.2.3 Transactional Format . . . . . . . . . . . . . . . . . . 766 16.2.4 Positional Format . . . . . . . . . . . . . . . . . . . . 766 16.2.5 Trade & Transaction Histories . . . . . . . . . . . . . . 767 16.2.6 Trading System Summaries . . . . . . . . . . . . . . . 768 16.3 Trading System Examples . . . . . . . . . . . . . . . . . . . . 770 16.3.1 Trading System A . . . . . . . . . . . . . . . . . . . . 770 16.3.2 Trading System B . . . . . . . . . . . . . . . . . . . . 772 16.4 Basics of Trade Sizing . . . . . . . . . . . . . . . . . . . . . . 773 16.4.1 Uncorrelated Returns . . . . . . . . . . . . . . . . . . 773 16.4.2 Return-predicting Covariates . . . . . . . . . . . . . . 774 v
  • 6. ©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced or distributed without express written permission. 16.5 Principles and Methods for Backtesting . . . . . . . . . . . . 776 16.5.1 Trading System Homogeneity . . . . . . . . . . . . . . 777 16.5.2 Trading System Predictability . . . . . . . . . . . . . . 790 16.5.3 Trading System Robustness . . . . . . . . . . . . . . . 794 16.6 Mechanical Choices for Trading System Improvement . . . . . 796 16.6.1 Trading System Improvement: Stop-Loss Orders . . . 798 16.6.2 Trading System Improvement: Covariables . . . . . . . 803 16.6.3 Trading System Improvement: Leverage . . . . . . . . 804 16.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808 17 The Mean-Variance World 811 17.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811 17.2 Portfolio Analysis using Means and Variances . . . . . . . . . 812 17.2.1 One-Period Portfolio Analysis . . . . . . . . . . . . . . 812 17.2.2 Portfolio Distributions . . . . . . . . . . . . . . . . . . 814 17.2.3 Extending One Time Period to Multiple Periods . . . 815 17.3 The Mean-Variance World . . . . . . . . . . . . . . . . . . . . 815 17.4 Mean-Variance Portfolio Analysis . . . . . . . . . . . . . . . . 816 17.4.1 Efficient Frontier . . . . . . . . . . . . . . . . . . . . . 816 17.4.2 Mean Variance Analysis with Non-negativity Constraints . . . . . . . . . . . . . . . . . . . . . . . . 817 17.4.3 Setting up MVPT Problems for Computer Solution . . 819 17.4.4 The Two Fund Theorem . . . . . . . . . . . . . . . . . 820 17.4.5 Inclusion of a Risk-Free Asset And the One Fund The- orem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 821 17.5 The Capital Asset Pricing Model . . . . . . . . . . . . . . . . 823 17.5.1 CAPM Assumptions . . . . . . . . . . . . . . . . . . . 823 17.5.2 The Argument for CAPM . . . . . . . . . . . . . . . . 825 17.6 Critique of MVPT and CAPM . . . . . . . . . . . . . . . . . 828 17.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830 18 APT and Factor Models 831 18.1 Arbitrage Pricing Theory and Factor Models . . . . . . . . . 831 18.2 Part 1: A One Period Factor Model . . . . . . . . . . . . . . . 833 18.3 Factor Models with Unobserved Factors . . . . . . . . . . . . 835 18.3.1 Uncorrelated Factors . . . . . . . . . . . . . . . . . . . 835 18.4 Unobserved Factor Estimation . . . . . . . . . . . . . . . . . . 836 18.4.1 Uncorrelated Factors . . . . . . . . . . . . . . . . . . . 836 18.5 Multiperiod Factor Models with Observed Factors . . . . . . . 842 18.5.1 Estimation for Observed Factor Models . . . . . . . . 844 vi
  • 7. ©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced or distributed without express written permission. 18.6 Selecting Factors in Unobserved Factor Models . . . . . . . . 845 18.6.1 Interpreting Unobserved Factor Models . . . . . . . . 848 18.6.2 Factor Model Portfolios . . . . . . . . . . . . . . . . . 853 18.7 Part 2: Multiperiod Factor Models . . . . . . . . . . . . . . . 854 18.7.1 Review of the One Period Factor Models . . . . . . . . 854 18.7.2 The Basic Multiperiod Factor Model . . . . . . . . . . 855 18.7.3 Three Versions of the Basic Multiperiod Model . . . . 857 18.7.4 Factor Models in Applied Finance . . . . . . . . . . . 858 18.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 864 19 Active Portfolio Management 867 19.1 Active vs. Passive Portfolio Management . . . . . . . . . . . . 867 19.1.1 Portfolio Managers and Benchmarks . . . . . . . . . . 868 19.1.2 Portfolio Management Methods . . . . . . . . . . . . . 868 19.1.3 Evidence for Superior Returns . . . . . . . . . . . . . . 870 19.1.4 How To Earn Superior Returns . . . . . . . . . . . . . 871 19.1.5 The Investment Domain . . . . . . . . . . . . . . . . . 873 19.2 Mean-Variance Active Management . . . . . . . . . . . . . . . 874 19.2.1 Portfolio Analysis . . . . . . . . . . . . . . . . . . . . . 874 19.2.2 One-Period Portfolio Analysis . . . . . . . . . . . . . . 875 19.2.3 The Mean-Variance and Capital Asset Pricing Models of Return and Risk . . . . . . . . . . . . . . . . . . . . 876 19.2.4 Benchmarks: The Yardsticks of Performance . . . . . . 879 19.2.5 Active Management: The “Science” of Alpha . . . . . . 879 19.2.6 G&K Compensation for TM’s and MoM’s . . . . . . . 881 19.2.7 Active Management for Portfolios . . . . . . . . . . . . 882 19.2.8 Active Management Using a Utility Function . . . . . 884 19.2.9 Active Management: Value Added with the Active Portfolio . . . . . . . . . . . . . . . . . . . . . . . . . . 885 19.2.10Residual Risk and Return: The Information Ratio . . 885 19.2.11Value Added for Active Management . . . . . . . . . . 887 19.2.12The Fundamental G&K Law of Active Management . 888 19.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 889 19.4 Critique . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891 19.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892 III Profitable Trading Systems 895 20 Break-Out Trend Following 897 vii
  • 8. ©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced or distributed without express written permission. 20.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 897 20.2 Market Concepts and Terminology . . . . . . . . . . . . . . . 898 20.2.1 Data Description . . . . . . . . . . . . . . . . . . . . . 898 20.3 iRecent History of Break-out Systems . . . . . . . . . . . . . 899 20.4 Break-Outs: Why do they happen? . . . . . . . . . . . . . . . 901 20.5 Creating Break-out Trend Indicators . . . . . . . . . . . . . . 903 20.6 Creating a Training Variable . . . . . . . . . . . . . . . . . . . 906 20.7 Finding Market Patterns . . . . . . . . . . . . . . . . . . . . . 909 20.7.1 Creating a Break-Out Dataset . . . . . . . . . . . . . . 909 20.7.2 A PPR Trading System . . . . . . . . . . . . . . . . . 911 20.7.3 An ACE Trading System . . . . . . . . . . . . . . . . 921 20.7.4 An AVAS Trading System . . . . . . . . . . . . . . . . 924 20.7.5 An ICA Trading System . . . . . . . . . . . . . . . . . 925 20.8 Critique of Systems . . . . . . . . . . . . . . . . . . . . . . . . 929 20.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 931 21 The Family of Trend Anomalies 933 21.1 The Trending Agenda . . . . . . . . . . . . . . . . . . . . . . 933 21.2 Do Tradable Trends Exist? . . . . . . . . . . . . . . . . . . . 934 21.2.1 What is the Difference between Trending and Momen- tum? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 934 21.2.2 Evidence that Profitable Trends Exist . . . . . . . . . 934 21.2.3 Defining Trends . . . . . . . . . . . . . . . . . . . . . . 935 21.2.4 Detecting Trends . . . . . . . . . . . . . . . . . . . . . 936 21.3 Background on Trends and “Trend Anomalies” . . . . . . . . . 937 21.3.1 Examples of Trends . . . . . . . . . . . . . . . . . . . 937 21.3.2 Trend-Inducing Distorters . . . . . . . . . . . . . . . . 940 21.4 Strategic Causes of Herding . . . . . . . . . . . . . . . . . . . 946 21.4.1 Herding among Individual Investors . . . . . . . . . . 948 21.4.2 Herding among Institutions and Mutual Funds . . . . 949 21.4.3 Herding among Analysts . . . . . . . . . . . . . . . . . 950 21.5 Strategic Causes of Momentum and the Disposition Effect . . 952 21.5.1 A Trader’s View of Momentum . . . . . . . . . . . . . 952 21.5.2 Empirical Findings on Relationships of Momentum to Herding, Positive Feedback and the Disposition Effect 953 21.5.3 The Grinblatt & Han Model for Momentum . . . . . . 955 21.5.4 The Frazzini Mutual Fund Model . . . . . . . . . . . . 961 21.5.5 The Frazzini-Lamont Dumb Money Model . . . . . . . 965 21.5.6 Momentum Crashes . . . . . . . . . . . . . . . . . . . 970 viii
  • 9. ©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced or distributed without express written permission. 21.5.7 Conclusions on Strategic Causes of Momentum and the Disposition Effect . . . . . . . . . . . . . . . . . . 972 21.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973 21.6.1 The Significance of Herding . . . . . . . . . . . . . . . 973 21.6.2 What about Over/Underreaction? . . . . . . . . . . . 975 21.6.3 What is the Role of the Disposition Effect? . . . . . . 976 21.6.4 What about Momentum? . . . . . . . . . . . . . . . . 976 22 Volatility Arbitrage and Pairs Trading 977 22.1 Origins of Excess Volatility . . . . . . . . . . . . . . . . . . . 977 22.2 Short-term Excess Volatility . . . . . . . . . . . . . . . . . . . 979 22.3 Capturing Excess Volatility . . . . . . . . . . . . . . . . . . . 984 22.4 Effects of Pairs Strategies on a Market . . . . . . . . . . . . . 985 22.5 More on Excess Volatility . . . . . . . . . . . . . . . . . . . . 988 22.6 Physical Analogies to Market Crashes . . . . . . . . . . . . . 990 22.7 Volatility in the 1987 Stock Market Crash . . . . . . . . . . . 990 22.8 Implementing a Volatility Capture Strategy . . . . . . . . . . 993 22.8.1 Introduction: What are Pairs Strategies and Market- Neutral Strategies? . . . . . . . . . . . . . . . . . . . . 993 22.9 A Simple Pairs Strategy . . . . . . . . . . . . . . . . . . . . . 994 22.9.1 Acquisition of Historical Prices, Volumes, Splits and Dividends . . . . . . . . . . . . . . . . . . . . . . . . . 994 22.9.2 Developing a Measure of Overbought and Oversold Pairs996 22.9.3 Determining the Measure m(S1, S2) . . . . . . . . . . 998 22.9.4 Generating Entry and Exit Trades . . . . . . . . . . . 1000 22.9.5 Calculating Profits and Losses . . . . . . . . . . . . . . 1001 22.10An R-language Script for an Equity Pairs System . . . . . . . 1003 22.10.1Evaluation of Cumulative P&L for the Bollinger Pairs System . . . . . . . . . . . . . . . . . . . . . . . . . . . 1008 22.11Discussion of the Bollinger Pairs System . . . . . . . . . . . . 1011 22.12Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1014 23 Epilogue 1015 23.1 The Logic of Markets and the Importance of Strategies . . . . 1015 23.2 Humans and Trading . . . . . . . . . . . . . . . . . . . . . . . 1016 23.3 Developing Trading Systems . . . . . . . . . . . . . . . . . . . 1018 23.4 Example Systems . . . . . . . . . . . . . . . . . . . . . . . . . 1019 23.4.1 The Tax Day Trade. . . . . . . . . . . . . . . . . . . . 1019 23.4.2 Eurodollar Expiration Trades. . . . . . . . . . . . . . . 1020 23.4.3 Breakout Trend Following. . . . . . . . . . . . . . . . . 1020 ix
  • 10. ©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced or distributed without express written permission. 23.4.4 Pairs Trading. . . . . . . . . . . . . . . . . . . . . . . . 1020 23.5 Wrapping Up . . . . . . . . . . . . . . . . . . . . . . . . . . . 1021 A Linear Algebra And Quadratic Forms 1023 A.1 General Remarks . . . . . . . . . . . . . . . . . . . . . . . . . 1023 A.2 Vectors, Matrices and Normal Forms . . . . . . . . . . . . . . 1023 A.3 Quadratic Forms . . . . . . . . . . . . . . . . . . . . . . . . . 1031 A.4 Vector and Matrix Derivatives . . . . . . . . . . . . . . . . . . 1032 A.5 Optimization Problems . . . . . . . . . . . . . . . . . . . . . . 1033 B Statistical Tests for Financial Analysis 1035 B.1 A Note on Nonparametric Tests . . . . . . . . . . . . . . . . . 1036 B.2 Statistical Tests for Gaussianity . . . . . . . . . . . . . . . . . 1037 B.3 Testing for Randomness . . . . . . . . . . . . . . . . . . . . . 1046 B.3.1 Nonparametric Tests for Randomness: Runs Tests . . 1046 B.3.2 Nonparametric Tests for Randomness: Trend Tests . . 1049 B.4 Parametric Tests of Random Walks . . . . . . . . . . . . . . . 1052 B.5 Nonparametric Tests for Comparing Distributions . . . . . . . 1054 B.6 Time Series Tests . . . . . . . . . . . . . . . . . . . . . . . . . 1061 B.6.1 General Tests . . . . . . . . . . . . . . . . . . . . . . . 1061 B.6.2 Variance-Ratio Tests . . . . . . . . . . . . . . . . . . . 1064 C The R-Language Environment Used in this Book 1071 C.1 The R-Language . . . . . . . . . . . . . . . . . . . . . . . . . 1071 C.1.1 The CRAN Heading . . . . . . . . . . . . . . . . . . . 1072 C.1.2 The ’About R’ heading . . . . . . . . . . . . . . . . . 1073 C.1.3 The ’Software’ heading . . . . . . . . . . . . . . . . . . 1074 C.1.4 The ’Documentation’ heading . . . . . . . . . . . . . . 1074 C.2 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1075 C.3 Tutorials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1076 C.4 R Language Usage in the Book’s Example Datasets . . . . . . 1076 C.4.1 Dataset Naming . . . . . . . . . . . . . . . . . . . . . 1076 Glossary 1077 x
  • 11. Preface This is a book I wish I’d had when I learned finance. Before I knew anything about financial markets, I’d already been a pro- grammer for the Apollo lunar missions 8-14, had earned a M.S. in Math- ematics, a Ph.D. in statistics and had worked as a biostatistician for the better part of a decade. Especially from my work as an applied statistician, I’d become skeptical of classical parametric statistical methods. The reason was that I pretty much never found data that appeared to satisfy its dis- tributional assumptions and because those methods had been developed in a pre-computer era, where only the most primitive calculations were possi- ble. You see, I was one of the vanguards of the computer revolution. With all that additional computing power, I thought, certainly there were better methods than ones based only on means and variances. But I also had a parallel career as an amateur games player and gambler. I’d become a competent chess player, winning titles in two states. For a while, I was a top-ranked backgammon player. I went to “school” as an evening gambler, and learned what it takes to win at games of chance. Gambling was also great preparation for my later work in the financial markets. Given this background, I entered the financial arena as an options floor trader on the Philadelphia Options Exchange, still without any real knowl- edge of theoretical or practical finance. But I taught myself what I needed to know about options modelling. When I saw how options were traded in the pits, I realized that “theoretical values” were a just a convenient bench- mark; all good traders knew that options prices were often forecasting hidden information about their underlyings. In the case of stocks, the hidden infor- mation could be considerable — insiders could know the day and hour of a significant announcement about a specific stock. But it was hard to imag- ine that they could know the same about the S&P 500 stock index, so not all tradable securities were created equal. Thus things that lay outside any model could confer a great edge, things like unusual buying of an out-of-the xi
  • 12. ©2013, Steven D. Moffitt, Ph.D. Not to be cited, reproduced or distributed without express written permission. money put just before expiration, small orders delivered by Merrill Lynch brokers, probably representing the uninformed trade of a retail client, large orders delivered by a “cheater’s” broker, probably representing an informed institutional client, and unusual call buying in a “take-over” stock. So I entered the financial world with scientist/statistician/gambler bi- ases. As I became acquainted with financial theory, with its rational actors and efficient markets, I realized immediately how misguided it was. Games players are not rational — they do not try to maximize some hypothetical utility function. There are good players, mediocre players and bad players. Any good game player knows that to win you do not need to be great, you only need to play better than your competitors. Given these beliefs, how could I accept that markets are efficient? It just made no sense. This is the second volume of a two volume series, which discusses finan- cial theory and methods from a gambler’s viewpoint. It is intended for a sophisticated reader who already knows basic finance, calculus, linear alge- bra and statistics. In my view, anyone who aspires to be a quantitative analyst in financial markets will find this book helpful. The first volume in the series, “The Strategic Analysis of Financial Mar- kets: A Gambler’s Guide,” offered a “gambling-theoretical” perspective on financial markets. The flesh-and-blood gambler who wished to apply the principles from Volume 1 needs quantitative techniques for his or her quest. This, the second volume describes methods that have demonstrated value in that quest without any claim of completeness. While the first volume critiques mainstream finance and offers a per- spective that I believe mirrors the views of many financial practitioners — the second shows how that perspective leads to modifications of standard financial methods and has produced winning trading systems. I’d like to thank many people who have had some part in shaping my ideas about markets. A few of my colleagues in the academic world have been influential: Mike Kutner, Mike Lynn, John Bilson, Russell Wojick and Bruce Rawlings. A few games-players and gamblers deserve mention: Dan Harrington, Andy Glazer, the Shores brothers and Harry Pace. And of course, traders: Howard Ring, Alvin Dodek, Will Hobert and several of the Susquehanna partners. Apologies to the many I neglected to include. Spe- cial thanks to my wife Patty, whose forebearance during the writing was essential. Steven D. Moffitt, Ph.D. December 29, 2013. xii