Upload
adam-parker
View
215
Download
0
Embed Size (px)
Citation preview
1
What does genetic programming teach us about the foreign exchange market ?
Chris Neely*
Paul Weller †
Rob Dittmar**
December 1-2, 1998
* Economist, Federal Reserve Bank of St. Louis
† Professor, Department of Finance, University of Iowa
** Scientific Programmer, Federal Reserve Bank of St. Louis
2
Disclaimer
The views expressed are my own and do not necessarily reflect official positions of the Federal Reserve Bank of St. Louis, or the Federal Reserve System.
3
What does genetic programming teach us about foreign exchange markets?
I) Broad overview of an ongoing project
II) Foreign exchange market efficiency and technical
analysis
III) What is genetic programming?
IV) Results from dollar exchange rates
V) Results from the European Monetary System
VI) Results using Federal Reserve Intervention
VII) Work in Progress
4
II) Foreign exchange market efficiency and technical analysis
A) Foreign exchange market efficiency
1) Exchange rates reflect information to the point where the potential excess returns do not exceed the transactions costs of acting (trading) on that information (Jensen, 1978).
2) Borrowing in one currency to lend in another should not profit you, except to the extent that this is risky strategy.
5
6
B) The puzzle of technical analysis
1) Technical analysis is the use of past prices to guide trading decisions.
2) For about 15 years, people have been finding that technical trading rules make excess returns in the foreign exchange market. (Sweeney, 1986; 1988)
(a) Moving average rules and filter rules.
3) The success of technical trading rules seems to contradict the efficient markets hypothesis.
7
C) Explanations for the success of technical analysis
1) Data mining
2) The returns to technical analysis are compensation for bearing risk
(a) Measures of risk: Sharpe ratios, CAPM betas
3) Central bank intervention
8
III) What is genetic programming?
A) GP is a variation of genetic algorithms
1) GA are due to Holland (1975)
2) Genetic algorithms are computer search procedures
based on the principles of natural selection as originally
expounded in Darwin's theory of evolution.
B) GP is a similar search algorithm for spaces
that consist of decision trees. 1) GP was developed by Koza (1992).
2) We can think of trading rules as decision trees.
9
IV) “Is Technical Analysis in the Foreign Exchange Market Profitable? A Genetic Programming Approach”
Neely, Weller and Dittmar (1997)
A) The data: daily exchange rates and interest rates. $/DM, $/¥, $/£, $/SF, DM/¥ and £/SF
1) Normalized by a 250-day moving average
B) The fitness criterion is the excess return over borrowing in one currency and investing in the other, each day.
10
C) Sample periods: training period: 1975-1977;selection period: 1978-1980: validation period: 1981-1995:10:11.
1975 1978 1981
Training Period Selection Period Validation Period - Out-of -Sample
In-sample period
1995
11
Table 1
Mean and median annual trading rule excess return
for each currency over the period 1981-95
$/DM $/¥ $/£ $/SF DM/¥ £/SF
Mean
AR*100
MSD*100
% > 0
SR
Trades
% Long
6.05
(28.18)
3.49
96
0.50
106.54
50.52
2.34
(7.94)
3.48
65
0.19
107.98
78.01
2.28
(10.55)
3.66
85
0.18
130.51
63.42
1.42
(5.63)
3.88
84
0.11
156.58
81.73
4.10
(13.09)
2.79
85
0.42
426.61
49.91
1.02
(9.48)
2.92
89
0.10
55.25
93.57
Median
AR*100
Trades
7.11
35
4.57
101
1.85
88
0.43
14
6.52
451
1.56
6
Long Rule
AR*100
MSD*100
1.03
3.54
1.09
3.58
-0.57
3.61
-0.04
3.94
1.47
2.93
0.53
2.89
12
E) Structure of the rules
1) Rules were usually too complex to analyze by hand but those that were understandable had extrapolative features.
2) The 55th best $/DM rule over the selection period, whose excess return was 7.34, number of trades was 37 and correlation with the median rule was 0.9911, prescribed: "Take a long position if the four-day minimum of the normalized exchange rate is greater than one."
F) Rules trained on $/DM data proved profitable on other exchange rates, out of sample.
13
Table 4
A comparison of results from running the $/DM trading rules on all currencies:
1981-1995
$/DM $/¥ $/£ $/SF DM/¥ £/SF
AR*100 (1)
(2)
% > 0 (1)
(2)
SR (1)
(2)
Trades (1)
(2)
6.05
(28.18)
6.05
(28.18)
96
96
0.50
0.50
106.54
106.54
2.34
(7.94)
4.87
(25.53)
65
97
0.19
0.42
107.98
103.71
2.28
(10.55)
4.92
(24.02)
85
93
0.18
0.40
130.51
95.60
1.42
(5.63)
5.40
(21.83)
84
94
0.11
0.40
156.58
114.37
4.10
(13.09)
2.28
(19.31)
85
96
0.42
0.22
426.61
116.38
1.02
(10.55)
1.31
(11.45)
89
89
0.10
0.13
55.25
111.69
14
G) Transactions costs can aid in avoiding
overfitting the data
1) Transactions costs were set at 0.001 per round trip in the
training/selection period, 0.0005 in the validation period.
H) Risk measures
1) Sharpe ratios were between 0.1 and 0.5. The S&P500 Sharpe
ratio was about 0.3 over the same period
2) CAPM beta
15
Table 3
Betas for returns to portfolio rules: 1981-1995
Beta / standard error ¥/DM SF/£ $/DM $/¥ $/SF $/£
World Portfolio Beta 0.0401 -0.0599 -0.0061 0.1689 0.0965 -0.0029
(s.e.) 0.0448 0.0546 0.0692 0.0617 0.0608 0.0695
S&P Portfolio Beta 0.0184 -0.0480 -0.0275 -0.0411 -0.0406 -0.0739
(s.e.) 0.0304 0.0441 0.0513 0.0398 0.0452 0.0507
Commerzbank Index Beta 0.0125 -0.0425 -0.0792 -0.0624 -0.1210 -0.0339
(s.e.) 0.0278 0.0378 0.0428 0.0340 0.0373 0.0433
Nikkei Index Beta -0.0051 -0.0569 -0.0679 0.0038 -0.0133 -0.0310
(s.e.) 0.0282 0.0382 0.0436 0.0348 0.0389 0.0439
16
V) "Technical Trading Rules in the European Monetary System” -- Neely and Weller (1998)
A) The Data and sample periods
1) Four ERM exchange rates: DEM/FRF, DEM/ITL, DEM/NLG and DEM/GBP
2) Training period, 3/13/79 to 1/2/83; selection period, 1/3/83 to 1/1/86; validation period, 1/2/86 to 6/21/96.
17
B) Results from portfolio rules on ERM dataTable 4: Summary Statistics for Median and Uniform Portfolio Rules over the EntireSample and Subperiods S1 and S2
Median Portfolio Rule Uniform Portfolio RulePanel A: FRF ITL NLG GBP FRF ITL NLG GBP
AR*100 1.35 4.13 0.03 3.14 0.97 2.49 0.12 2.89t-statistic 1.69 1.99 0.15 1.32 1.59 2.04 0.81 1.37
Entire post prob. 0.96 0.98 0.55 0.91 0.93 0.98 0.81 0.90Period Sharpe ratio 0.53 0.65 0.05 0.37 0.50 0.65 0.27 0.38
trades per year 4.87 4.39 5.82 1.24 5.67 4.53 5.73 3.90% XS 5.38 7.29 0.30 3.74 3.86 4.40 1.34 3.44% long 51.97 50.17 25.09 49.05 63.25 47.21 29.30 50.01
Panel B: FRF ITL NLG GBP FRF ITL NLG GBPAR*100 1.21 1.55 0.03 5.56 0.79 0.48 0.12 4.49t-statistic 1.54 1.03 0.15 1.36 1.18 0.52 0.81 1.18
S1 post prob. 0.94 0.58 0.56 0.92 0.90 0.31 0.81 0.91Sharpe ratio 0.56 0.64 0.05 1.23 0.43 0.38 0.27 1.07trades per year 5.01 5.36 5.82 1.54 5.35 5.35 5.73 3.69% XS 6.24 5.99 0.30 10.90 4.08 1.85 1.34 8.79% long 64.46 56.33 25.09 24.79 70.61 50.04 29.30 26.78
Panel C: FRF ITL NLG GBP FRF ITL NLG GBPAR*100 1.74 8.72 NA 2.59 1.45 6.08 NA 2.52t-statistic 0.82 1.70 NA 0.94 1.04 2.06 NA 1.03
S2 post prob. 0.76 0.95 NA 0.82 0.77 0.98 NA 0.85Sharpe ratio 0.55 1.10 NA 0.29 0.81 1.19 NA 0.32trades per year 4.16 2.66 NA 1.29 6.29 3.05 NA 4.00% XS 4.29 7.83 NA 2.83 3.58 5.46 NA 2.76% long 19.17 39.18 NA 54.58 43.91 42.16 NA 55.31
18
C) Structure of the rules: The interest differential and not the past exchange rate series is the most important informational input to the trading rule.
1) Example: “Go long if the interest differential (British
minus German) is greater than 4.42 per cent.”
a) This simple rule was the 28th best out-of-sample for the
DEM/GBP, having an excess return of 3.32 per cent per
year and a correlation of 0.95 with the median rule.
2) Moving average and filter rules did not do well.
3) High interest rate and mean reversion rules did not do well.
19
D) Risk measures: 1) CAPM betas were close to zero.2) X* statistics were close to the unadjusted returns.
Table 12: CAPM Regression Betas
FRF ITL NLG GBPWorld Index constant 1.789 3.721 -0.052 4.361
(s.e.) (0.785) (2.041) (0.163) (2.327)B -0.013 0.026 0.000 0.009(s.e.) (0.017) (0.044) (0.004) (0.050)
Commerzbank constant 1.381 4.009 0.006 3.381Index (s.e.) (0.800) (1.991) (0.168) (2.700)
B -0.000 0.036 0.000 -0.002(s.e.) (0.012) (0.031) (0.003) (0.042)
20
VI) “Technical Analysis and Central Bank Intervention” (Neely and Weller, 1998)
A) An explanation for the success of TA
B) There is previous work linking technical analysis and central bank intervention.
C) Can CBI information improve an ex ante trading rule?
D) Method: Supply intervention information as 1, 2, or 3 to the rule generating program.
21
Table 5Portfolio trading rule excess return for each currency over the period 1981-1995:10
Rules using intervention information vs. rules not using intervention information
Panel A: Median portfolio
DEM JPY GBP CHF MeanAR*100 CBI 6.29 1.13 4.83 5.36 4.4
No CBI 7.45 6.45 1.17 -0.13 3.74t-statistic CBI 2.18 0.42 1.68 1.68
No CBI 2.58 2.42 0.40 0.04Posterior prob. 9.10 3.40 96.10 90.50Sharpe ratio CBI 0.54 0.09 0.36 0.41 0.35
No CBI 0.63 0.57 0.09 -0.01 0.32Trades per year CBI 8.50 2.12 4.87 7.87
No CBI 2.12 3.94 5.62 3.62% long CBI 45.72 99.26 49.73 48.87
No CBI 45.52 62.46 69.46 98.70
Panel B: Uniform portfolio
DEM JPY GBP CHF MeanAR*100 CBI 5.98 3.49 3.89 4.19 4.39
No CBI 6.33 4.71 2.72 1.35 3.78t-statistic CBI 2.24 1.75 1.82 1.49
No CBI 2.51 2.64 1.19 0.67Posterior prob. 34.00 13.20 92.40 85.40Sharpe ratio CBI 0.55 0.39 0.41 0.36 0.43
No CBI 0.61 0.60 0.27 0.17 0.41Trades per year CBI 9.01 3.85 6.63 9.58
No CBI 4.07 6.50 6.68 7.84% long CBI 47.15 81.20 56.18 52.91
No CBI 47.89 65.35 65.70 77.20
22
F) How do we explain the failure of intervention
information to improve returns?1) A structural break in the CBI data generation process?
23
VII) What do we learn about market efficiency from these exercises?
A) The success of TA presents a puzzle to the EMH;
the success of GP deepens this puzzle because GP
provides a true, ex ante test of technical trading rules.
B) There has been work on institutional constraints
that may explain some lack of risk arbitrage.
24
C) There has been additional work on behavioral
finance as a result of the success of TA.
D) The success of TA underscores our need for a
better understanding of risk.
25
VIII) Work in Progress
A) High frequency trading rules
B) Options pricing1) HLP showed how neural networks could price and delta
hedge options. We are exploring similar issues with GP.
26
The End