Introduction to Algorithmic Trading Strategies Lecture 2 Hidden
- Slides: 43
Introduction to Algorithmic Trading Strategies Lecture 2 Hidden Markov Trading Model Haksun Li haksun. li@numericalmethod. com www. numericalmethod. com
Outline � Carry trade � Momentum � Valuation � CAPM � Markov chain � Hidden Markov model 2
References � Algorithmic Trading: Hidden Markov Models on Foreign Exchange Data. Patrik Idvall, Conny Jonsson. University essay from Linköpings universitet/Matematiska institutionen; Linköpings universitet/Matematiska institutionen. 2008. � A tutorial on hidden Markov models and selected applications in speech recognition. Rabiner, L. R. Proceedings of the IEEE, vol 77 Issue 2, Feb 1989. 3
FX Market � FX is the largest and most liquid of all financial markets – multiple trillions a day. � FX is an OTC market, no central exchanges. � The major players are: � Central banks � Investment and commercial banks � Non-bank financial institutions � Commercial companies � Retails 4
Electronic Markets � Reuters � EBS (Electronic Broking Service) � Currenex � FXCM � FXall � Hotspot � Lava FX 5
Fees � Brokerage � Transaction, e. g. , bid-ask 6
Basic Strategies � Carry trade � Momentum � Valuation 7
Carry Trade � Capture the difference between the rates of two currencies. � Borrow a currency with low interest rate. � Buy another currency with higher interest rate. � Take leverage, e. g. , 10: 1. � Risk: FX exchange rate goes against the trade. � Popular trades: JPY vs. USD, USD vs. AUD � Worked until 2008. 8
Momentum � FX tends to trend. � Long when it goes up. � Short when it goes down. � Irrational traders � Slow digestion of information among disparate participants 9
Purchasing Power Parity � Mc. Donald’s hamburger as a currency. � The price of a burger in the USA = the price of a burger in Europe � E. g. , USD 1. 25/burger = EUR 1/burger � EURUSD = 1. 25 10
FX Index � Deutsche Bank Currency Return (DBCR) Index � A combination of � Carry trade � Momentum � Valuation 11
CAPM � 12
Alpha � 13
Bayes Theorem � 14
Markov Chain a 22 = 0. 2 s 2: MEAN REVERTIN G a 12 = 0. 2 a 21 = 0. 3 a 23 = 0. 5 a 32 = 0. 25 a 13 = 0. 4 s 3: DOWN s 1: UP a 31 = 0. 25 a 11 = 0. 4 15 a 33 = 0. 5
Example: State Probability � 16
Markov Property � 17
Hidden Markov Chain � 18
Markov Chain a 22 = ? s 2: MEAN REVERTIN G a 12 = ? a 21 = ? a 23 = ? a 32 = ? a 13 = ? s 3: DOWN s 1: UP a 31 = ? a 11 = ? 19 a 33 = ?
Problems � 20
Likelihood Solutions 21
Likelihood By Enumeration � 22
Forward Procedure � 23
Backward Procedure � 24
Decoding Solutions 25
Decoding Solutions � 26
Maximizing The Expected Number Of States � 27
Viterbi Algorithm � 28
Viterbi Algorithm � 29
Learning Solutions 30
As A Maximization Problem � 31
Baum-Welch � 32
Xi � 33
Estimation Equation � 34
Estimation Procedure � 35
Conditional Probabilities � Our formulation so far assumes discrete conditional probabilities. � The formulations that take other probability density functions are similar. � But the computations are more complicated, and the solutions may not even be analytical, e. g. , t-distribution. 36
Heavy Tail Distributions � t-distribution � Gaussian Mixture Model � a weighted sum of Normal distributions 37
Trading Ideas � Compute the next state. � Compute the expected return. � Long (short) when expected return > (<) 0. � Long (short) when expected return > (<) c. � c = the transaction costs � Any other ideas? 38
Experiment Setup � EURUSD daily prices from 2003 to 2006. � 6 unknown factors. � Λ is estimated on a rolling basis. � Evaluations: � Hypothesis testing � Sharpe ratio � Va. R � Max drawdown � alpha 39
Best Discrete Case 40
Best Continuous Case 41
Results � More data (the 6 factors) do not always help (esp. for the discrete case). � Parameters unstable. 42
TODOs � How can we improve the HMM model(s)? Ideas? 43
- Introduction to algorithmic trading strategies
- Introduction to algorithmic trading strategies
- Introduction to algorithmic trading strategies
- Zip trading algorithm
- Algorithmic trading singapore
- Ireallytrade
- Meaning of non trading organisation
- Market microstructure trading strategies
- Trading strategies involving options
- Evaluating trading strategies
- 01:640:244 lecture notes - lecture 15: plat, idah, farad
- Algorithmic state machine examples
- Abstraction gcse computer science
- Algorithmic nuggets in content delivery
- Algorithmic cost modelling
- Algorithmic graph theory and perfect graphs
- Notasi algoritmik
- Input and output algorithm
- Algorithmic adc
- Simple event correlator examples
- Mealy asm chart
- Gdpr algorithmic bias
- A revealing introduction to hidden markov models
- A revealing introduction to hidden markov models
- Depth sorting method in computer graphics
- Sole trading concern introduction
- Introduction to biochemistry lecture notes
- Introduction to psychology lecture
- Introduction to algorithms lecture notes
- Bold pronouncement hook
- Stalling objection example
- Among the hidden theme
- Hidden rules examples
- Entrance hidden by bricks and rubble
- Hidden rules of poverty
- Hidden messages in water
- Hidden costs of assisted living
- Hidden cost fallacy
- Veton kepuska
- Hidden ovulation
- She dwelt among the untrodden ways
- Johari window model of self awareness
- Ruby payne hidden rules chart
- Hidden markov model rock paper scissors