1 / 64

Introduction to Algorithmic Trading Strategies Lecture 6

Introduction to Algorithmic Trading Strategies Lecture 6. Technical Analysis: Linear Trading Rules. Haksun Li haksun.li@numericalmethod.com www.numericalmethod.com. O utline. Moving average crossover The generalized linear trading rule P&Ls for different returns generating processes

mariel
Download Presentation

Introduction to Algorithmic Trading Strategies Lecture 6

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Algorithmic Trading StrategiesLecture 6 Technical Analysis: Linear Trading Rules Haksun Li haksun.li@numericalmethod.com www.numericalmethod.com

  2. Outline • Moving average crossover • The generalized linear trading rule • P&Ls for different returns generating processes • Time series modeling

  3. References • EmmanualAcar, Stephen Satchell. Chapters 4, 5 & 6, Advanced Trading Rules, Second Edition. Butterworth-Heinemann; 2nd edition. June 19, 2002.

  4. Assumptions of Technical Analysis • History repeats itself. • Patterns exist.

  5. Does MA Make Money? • Brock, Lakonishok and LeBaron (1992) find that a subclass of the moving-average rule does produce statistically significant average returns in US equities. • Levichand Thomas (1993) find that a subclass of the moving-average rule does produce statistically significant average returns in FX.

  6. Moving Average Crossover • Two moving averages: slow () and fast (). • Monitor the crossovers. • , • Long when . • Short when .

  7. How to Choose and ? • It is an art, not a science (so far). • They should be related to the length of market cycles. • Different assets have different and . • Popular choices: • (150, 1) • (200, 1)

  8. AMA(n , 1) • iff • iff

  9. GMA(n , 1) • iff • (by taking log) • iff • (by taking log)

  10. What is ?

  11. Acar Framework • Acar (1993): to investigate the probability distribution of realized returns from a trading rule, we need • the explicit specification of the trading rule • the underlying stochastic process for asset returns • the particular return concept involved

  12. Empirical Properties of Financial Time Series • Asymmetry • Fat tails

  13. Knight-Satchell-Tran Intuition • Stock returns staying going up (down) depends on • the realizations of positive (negative) shocks • the persistence of these shocks • Shocks are modeled by gamma processes. • Persistence is modeled by a Markov switching process.

  14. Knight-Satchell-Tran Process • : long term mean of returns, e.g., 0 • , : positive and negative shocks, non-negative, i.i.d

  15. Knight-Satchell-Tran 1-q Zt = 0 Zt = 1 p q 1-p

  16. Stationary State • , with probability • , with probability

  17. GMA(2, 1) • Assume the long term mean is 0, .

  18. Naïve MA Trading Rule • Buy when the asset return in the present period is positive. • Sell when the asset return in the present period is negative.

  19. Naïve MA Conditions • The expected value of the positive shocks to asset return >> the expected value of negative shocks. • The positive shocks persistency >> that of negative shocks.

  20. Period Returns hold Sell at this time point

  21. Holding Time Distribution

  22. Conditional Returns Distribution (1)

  23. Unconditional Returns Distribution (2)

  24. Long-Only Returns Distribution • Proof: make

  25. I.I.D Returns Distribution • Proof: • make

  26. Expected Returns • When is the expected return positive? • , shock impact • , shock impact • , if , persistence

  27. GMA(∞,1) Rule

  28. GMA(∞,1) Returns Process

  29. Returns As a MA(1) Process

  30. GMA(∞,1) Expected Returns

  31. MA Using the Whole History • An investor will always expect to lose money using GMA(∞,1)! • An investor loses the least amount of money when the return process is a random walk.

  32. Optimal MA Parameters • So, what are the optimal and ?

  33. Linear Technical Indicators • As we shall see, a number of linear technical indicators, including the Moving Average Crossover, are really the “same” generalized indicator using different parameters.

  34. The Generalized Linear Trading Rule • A linear predictor of weighted lagged returns • The trading rule • Long: , iff, • Short: , iff, • (Unrealized) rule returns • if • if

  35. Buy And Hold

  36. Predictor Properties • Linear • Autoregressive • Gaussian, assuming is Gaussian • If the underlying returns process is linear, yields the best forecasts in the mean squared error sense.

  37. Returns Variance

  38. Maximization Objective • Variance of returns is inversely proportional to expected returns. • The more profitable the trading rule is, the less risky this will be if risk is measured by volatility of the portfolio. • Maximizing returns will also maximize returns per unit of risk.

  39. Expected Returns

  40. Truncated Bivariate Moments • Johnston and Kotz, 1972, p.116 • Correlation:

  41. Expected Returns As a Weighted Sum a term for volatility a term for drift

  42. Praetz model, 1976 • Returns as a random walk with drift. • , the frequency of short positions

  43. Comparison with Praetz model • Random walk implies . the probability of being short increased variance

  44. Biased Forecast • A biased (Gaussian) forecast may be suboptimal. • Assume underlying mean . • Assume forecast mean .

  45. Maximizing Returns • Maximizing the correlation between forecast and one-ahead return. • First order condition:

  46. First Order Condition • Let

  47. Fitting vs. Prediction • If process is Gaussian, no linear trading rule obtained from a finite history of can generate expected returns over and above . • Minimizing mean squared error maximizing P&L. • In general, the relationship between MSE and P&L is highly non-linear (Acar 1993).

  48. Technical Analysis • Use a finite set of historical prices. • Aim to maximize profit rather than to minimize mean squared error. • Claim to be able to capture complex non-linearity. • Certain rules are ill-defined.

  49. Technical Linear Indicators • For any technical indicator that generates signals from a finite linear combination of past prices • Sell: iff • There exists an (almost) equivalent AR rule. • Sell: iff • ,

  50. Conversion Assumption • Monte Carlo simulation: • 97% accurate • 3% error.

More Related