About the Author |
|
xv | |
About the Technical Reviewers |
|
xvii | |
Acknowledgments |
|
xix | |
Introduction |
|
xxi | |
|
|
|
Chapter 1 Fundamentals of Automated Trading |
|
|
1 | (20) |
|
Equity Curve and Return Series 3 |
|
|
3 | (3) |
|
Characteristics of the Equity Curve |
|
|
5 | (1) |
|
Characteristics of the Return Series |
|
|
5 | (1) |
|
|
6 | (2) |
|
Characteristics of Risk-Return Metrics |
|
|
8 | (12) |
|
|
10 | (2) |
|
|
12 | (2) |
|
|
14 | (2) |
|
Regression-Based Performance Metrics |
|
|
16 | (4) |
|
Optimizing Performance Metrics |
|
|
20 | (1) |
|
Part 2 Building the Platform |
|
|
21 | (132) |
|
Chapter 2 Networking Part I |
|
|
23 | (14) |
|
|
24 | (5) |
|
|
25 | (1) |
|
|
25 | (1) |
|
|
26 | (1) |
|
|
27 | (1) |
|
|
28 | (1) |
|
|
29 | (4) |
|
|
30 | (3) |
|
|
33 | (1) |
|
|
33 | (1) |
|
|
33 | (1) |
|
Organizing as Date-Uniform zoo Object |
|
|
34 | (3) |
|
|
35 | (2) |
|
Chapter 3 Data Preparation |
|
|
37 | (14) |
|
|
37 | (6) |
|
|
37 | (1) |
|
IPOs and Additions to S&P 500 |
|
|
37 | (2) |
|
Merging to the Uniform Date Template |
|
|
39 | (1) |
|
|
40 | (1) |
|
Linearly Smoothed Replacement |
|
|
41 | (1) |
|
Volume-Weighted Smoothed Replacement |
|
|
42 | (1) |
|
Discussion of Replacement Methods |
|
|
43 | (1) |
|
|
43 | (1) |
|
Influence on Volatility Metrics |
|
|
43 | (1) |
|
Influence on Trading Decisions |
|
|
44 | (1) |
|
|
44 | (1) |
|
Closing Price and Adjusted Close |
|
|
44 | (3) |
|
Adjusting for Stock Splits |
|
|
45 | (1) |
|
Adjusting for Cash Dividends |
|
|
45 | (1) |
|
Efficient Updating and Adjusted Close |
|
|
46 | (1) |
|
|
47 | (1) |
|
Test for and Correct Inactive Symbols |
|
|
47 | (1) |
|
Computing the Return Matrix |
|
|
48 | (3) |
|
|
51 | (8) |
|
|
51 | (1) |
|
|
51 | (1) |
|
|
51 | (1) |
|
|
52 | (1) |
|
|
52 | (1) |
|
Machine Learning/Nonvisual/Black Box |
|
|
52 | (1) |
|
|
52 | (5) |
|
|
52 | (1) |
|
Moving Average Convergence Divergence Oscillator (MACD) |
|
|
53 | (1) |
|
|
54 | (1) |
|
Custom Indicator Using Correlation and Slope |
|
|
55 | (1) |
|
Indicators Utilizing Multiple Data Sets |
|
|
56 | (1) |
|
|
57 | (2) |
|
|
59 | (6) |
|
Our Process Flow as Nested Functions |
|
|
59 | (1) |
|
|
59 | (2) |
|
|
61 | (1) |
|
|
61 | (1) |
|
|
61 | (1) |
|
|
61 | (1) |
|
Filters, Triggers, and Quantifications of Favor |
|
|
62 | (3) |
|
Chapter 6 High-Performance Computing |
|
|
65 | (18) |
|
|
65 | (9) |
|
|
65 | (1) |
|
|
65 | (1) |
|
|
66 | (1) |
|
|
67 | (1) |
|
|
68 | (1) |
|
Random Access Memory (RAM) |
|
|
68 | (1) |
|
|
68 | (1) |
|
|
68 | (1) |
|
|
69 | (1) |
|
|
69 | (1) |
|
|
70 | (1) |
|
|
70 | (1) |
|
|
71 | (1) |
|
For Loops vs. apply Functions |
|
|
71 | (1) |
|
For Loops and Memory Allocation |
|
|
72 | (1) |
|
|
73 | (1) |
|
|
73 | (1) |
|
Note on Measuring Compute Time |
|
|
74 | (1) |
|
|
74 | (3) |
|
Embarrassingly Parallel Processes |
|
|
75 | (1) |
|
|
75 | (1) |
|
|
76 | (1) |
|
The foreach Package in Practice |
|
|
77 | (6) |
|
|
77 | (1) |
|
Computing the Return Matrix with foreach |
|
|
78 | (1) |
|
Computing Indicators with foreach |
|
|
79 | (4) |
|
Chapter 7 Simulation and Backtesting |
|
|
83 | (18) |
|
|
83 | (2) |
|
|
85 | (8) |
|
|
85 | (1) |
|
Listing 7-1 Explanation of Inputs and User Guide |
|
|
86 | (6) |
|
|
92 | (1) |
|
Implementing Example Strategies |
|
|
93 | (4) |
|
Summary Statistics and Performance Metrics |
|
|
97 | (2) |
|
|
99 | (2) |
|
|
101 | (30) |
|
Cross Validation in Time Series |
|
|
101 | (1) |
|
Numerical vs. Analytical Optimization |
|
|
102 | (1) |
|
Numerical Optimization Overview |
|
|
103 | (2) |
|
Parameter Transform for Unbounded Search Algorithms |
|
|
104 | (1) |
|
|
105 | (5) |
|
|
105 | (1) |
|
Listing 8-1 Explanation of Inputs and User Guide |
|
|
106 | (4) |
|
Exhaustive Search Optimization |
|
|
110 | (4) |
|
Pattern Search Optimization |
|
|
114 | (6) |
|
Generalized Pattern Search Optimization |
|
|
114 | (6) |
|
|
120 | (7) |
|
Nelder-Mead with Random Initialization |
|
|
120 | (7) |
|
Projecting Trading Performance |
|
|
127 | (3) |
|
|
130 | (1) |
|
Chapter 9 Networking Part II |
|
|
131 | (22) |
|
Market Overview: Brokerage APIs |
|
|
131 | (2) |
|
|
133 | (2) |
|
Establishing SSL Connections |
|
|
133 | (1) |
|
Proprietary SSL Connections |
|
|
134 | (1) |
|
|
135 | (1) |
|
|
135 | (1) |
|
Feasibility Analysis for Trading APIs |
|
|
135 | (1) |
|
Feasibility of Custom R Packages |
|
|
135 | (1) |
|
HTTPS + OAuth Through Existing R Packages |
|
|
136 | (1) |
|
|
136 | (1) |
|
Exporting Directions to a Supported Language |
|
|
136 | (1) |
|
Planning and Executing Trades |
|
|
136 | (4) |
|
|
137 | (2) |
|
|
139 | (1) |
|
|
140 | (12) |
|
|
140 | (6) |
|
|
146 | (1) |
|
|
147 | (1) |
|
The Financial Information exchange Protocol |
|
|
148 | (1) |
|
The FIX extensible Markup Language |
|
|
149 | (1) |
|
|
150 | (2) |
|
|
152 | (1) |
|
Part 3 Production Trading |
|
|
153 | (14) |
|
Chapter 10 Organizing and Automating Scripts |
|
|
155 | (6) |
|
Organizing Scripts into Jobs |
|
|
155 | (1) |
|
Calling Jobs with the Source Function |
|
|
155 | (1) |
|
Calling Jobs via Sourcing |
|
|
156 | (1) |
|
Task Scheduling in Windows |
|
|
156 | (3) |
|
Running R from the Command Line in Windows |
|
|
156 | (2) |
|
Setting Up and Managing the Task Scheduler |
|
|
158 | (1) |
|
|
159 | (1) |
|
|
160 | (1) |
|
Chapter 11 Looking Forward |
|
|
161 | (6) |
|
|
161 | (1) |
|
|
161 | (1) |
|
|
161 | (1) |
|
Hardware Description Languages |
|
|
162 | (1) |
|
Retail Brokerages and Right to Refuse |
|
|
162 | (1) |
|
Right to Refuse in the Swiss Currency Crisis |
|
|
163 | (1) |
|
|
163 | (1) |
|
|
163 | (1) |
|
|
164 | (1) |
|
|
164 | (1) |
|
Digesting News and Fundamentals |
|
|
165 | (1) |
|
|
165 | (2) |
|
|
167 | (28) |
|
|
167 | (1) |
|
|
168 | (10) |
|
|
168 | (1) |
|
|
169 | (1) |
|
Platform/functions/yahoo. R |
|
|
170 | (1) |
|
|
170 | (1) |
|
Platform/load/loadToMemory.R |
|
|
171 | (1) |
|
Platform/load/updateStocks.R |
|
|
172 | (4) |
|
|
176 | (1) |
|
|
177 | (1) |
|
Platform/load/adjustClose.R |
|
|
177 | (1) |
|
|
177 | (1) |
|
Platform/load/filllnactive.R |
|
|
178 | (1) |
|
|
178 | (6) |
|
Platform/compute/MCinit.R |
|
|
178 | (1) |
|
Platform/compute/functions.R |
|
|
178 | (6) |
|
|
184 | (5) |
|
|
184 | (1) |
|
Platform/plan/decisionGen.R |
|
|
185 | (4) |
|
|
189 | (1) |
|
|
169 | (20) |
|
|
189 | (6) |
|
|
189 | (1) |
|
Platform/model/optimize.R |
|
|
190 | (1) |
|
Platform/model/evaluateFunc.R |
|
|
190 | (2) |
|
Platform/model/optimizeFunc.R |
|
|
192 | (3) |
|
Appendix B Scoping in Multicore R |
|
|
195 | (8) |
|
|
195 | (2) |
|
|
195 | (1) |
|
|
196 | (1) |
|
The UNIX fork System Call |
|
|
197 | (2) |
|
The fork Call and Memory Management |
|
|
197 | (1) |
|
Scoping Implications for R |
|
|
197 | (2) |
|
Instance Replication in Windows |
|
|
199 | (4) |
|
Instance Replication and Memory Management |
|
|
199 | (1) |
|
Scoping Implications for R |
|
|
200 | (3) |
Index |
|
203 | |