Introduction to Algorithmic Trading Strategies Lecture 2 Hidden Markov Trading Model Haksun Li

Slides:



Advertisements
Similar presentations
WELCOMES YOU TO THE FOREX PRESENTATION !!! Visit Our Web Site.
Advertisements

1 (of 24) IBUS 302: International Finance Topic 4-The Bid-Ask Spread and Cross-Exchange Rates Lawrence Schrenk, Instructor.
Hidden Markov Models (HMM) Rabiner’s Paper
McGraw-Hill/Irwin Copyright © 2001 by The McGraw-Hill Companies, Inc. All rights reserved Futures Markets Chapter 22.
Futures markets. Forward - an agreement calling for a future delivery of an asset at an agreed-upon price Futures - similar to forward but feature formalized.
Hedging Foreign Exchange Exposures. Hedging Strategies Recall that most firms (except for those involved in currency-trading) would prefer to hedge their.
1 Volatility Smiles Chapter Put-Call Parity Arguments Put-call parity p +S 0 e -qT = c +X e –r T holds regardless of the assumptions made about.
Hidden Markov Models Bonnie Dorr Christof Monz CMSC 723: Introduction to Computational Linguistics Lecture 5 October 6, 2004.
By: Benjamin Hooker  Forex is the foreign currency market  Forex is over-the-counter  Markets are open around the clock.
Copyright © 2013 Pearson Education, Inc. publishing as Prentice Hall 9-1 International Business Environments & Operations 14e Daniels ● Radebaugh ● Sullivan.
International Business Environments & Operations
The Forward Market and the Forward Exchange Rate Understanding the use of the forward market and what determines the “equilibrium” forward exchange rate.
International Financial Management Vicentiu Covrig 1 The Market for Foreign Exchange The Market for Foreign Exchange (chapter 4)
Exchange Rates and the Foreign Exchange Market:
First introduced in 1977 Lots of mathematical derivation Problem : given a set of data (data is incomplete or having missing values). Goal : assume the.
Part 4 b Forward-Backward Algorithm & Viterbi Algorithm CSE717, SPRING 2008 CUBS, Univ at Buffalo.
Lecture 5: The Foreign Exchange Market Understanding Foreign Exchange Quotes.
The Basics of the Foreign Exchange Market. Defining The Foreign Exchange Market The Foreign Exchange Market can be defined in terms of specific functions,
Foreign Exchange Foreign Exchange Market Exchange Rate Appreciation/Depreciation Effective Exchange Rate Trade Weighted Dollar Real Exchange Rate Interbank.
INBU 4200 INTERNATIONAL FINANCIAL MANAGEMENT Lecture 3 Topic: The Foreign Exchange Market The Structure of the Market.
Lecture 6: The Forward Exchange Market
How Securities Are Traded Chapter 5. Explain the role of brokerage firms and stockbrokers. Describe how brokerage firms operate. Outline how orders to.
Visual Recognition Tutorial1 Markov models Hidden Markov models Forward/Backward algorithm Viterbi algorithm Baum-Welch estimation algorithm Hidden.
Radka Hlavnová.  (FX Market, Forex Market,Currency market)  Is a form of exchange for the global trading of international currencies  An exchange market.
Foreign Exchange Market Overview Convention and Terminology Mechanics and Operations Instruments ปริทรรศน์ เหลืองอุทัย, CFA, FRM 9 August 2006.
FX Aggregation Rovinj, May 2012 Johann (Hansi) Leikert
FOREIGN EXCHANGE (FX) MARKETS Review, Organization & Central Bank Intervention.
Lecture 5: The Foreign Exchange Market Understanding Foreign Exchange Quotes.
Chapter 13 Supplementary Notes. Exchange rate The price of a currency in terms of another currency DC = $, FC = € The exchange rate can be quoted as –DC.
Lecture 6: The Forward Exchange Market Understanding Forward Exchange Quotes and the Use of the Forward Market.
Copyright © 2009 Pearson Prentice Hall. All rights reserved. Chapter 1 Currency Exchange Rates.
Finance THE BANKING SYSTEM. Finance Lecture outline  The types and functions of banking  Central banking  Commercial and investment.
Chapter 12: Market Microstructure and Strategies
1.–2. Foreign Exchange Markets International Finance Karel Bruna.
WHATIS FOREX MARKET? WHATIS. WHAT IS FOREX?  Forex stands for foreign exchange. it’s also referred as FX or currency market. This is a place.
Fundamentals of Hidden Markov Model Mehmet Yunus Dönmez.
INVESTMENTS | BODIE, KANE, MARCUS Copyright © 2011 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin CHAPTER 19 Futures Markets.
Foreign Exchange Market. 2 Foreign Exchange Markets The market where the commodity traded is Currencies. The market where the commodity traded is Currencies.
CH 7: The foreign exchange market 1 Foreign Exchange Market Did you know that the foreign exchange market (also known as FX or forex) is the largest.
1 The Foreign Exchange Market Chapter Foreign Exchange Definitions Exchange rate: price of one currency in terms of another Exchange rate: price.
International Finance Dr Katarzyna Sum Chair of International Finance Warsaw School of Economics INTERNATIONAL FINANCE.
Foreign exchange markets Dr.Guru. Raghavan. Some basic concepts Why we need foreign exchange? What foreign exchange means? Role of exchange rates Payment.
© 2012 Pearson Education, Inc. All rights reserved.2-1 Exhibit 2.1 The Structure of the Foreign Exchange Market Most important cities: London New York.
ECE 8443 – Pattern Recognition ECE 8423 – Adaptive Signal Processing Objectives: ML and Simple Regression Bias of the ML Estimate Variance of the ML Estimate.
 Foreign Exchange. Basics of Forex  Marketplace where currencies are exchanged  Critical for conducting foreign business  Largest financial market.
CS Statistical Machine learning Lecture 24
CHAPTER 8 DISCRIMINATIVE CLASSIFIERS HIDDEN MARKOV MODELS.
Andrew Baum and David Hartzell, Global Property Investment, 2011 Property derivatives – an introduction.
Chapter 12 The Foreign- Exchange Market. ©2013 Pearson Education, Inc. All rights reserved Topics to be Covered Spot Rates Forward Rates Arbitrage.
© 2004 South-Western Publishing 1 Chapter 10 Foreign Exchange Futures.
© 2004 South-Western Publishing 1 Chapter 10 Foreign Exchange Futures.
McGraw-Hill/Irwin Copyright © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 22 Futures Markets.
CS Statistical Machine learning Lecture 25 Yuan (Alan) Qi Purdue CS Nov
ECE 8443 – Pattern Recognition ECE 8527 – Introduction to Machine Learning and Pattern Recognition Objectives: Reestimation Equations Continuous Distributions.
Copyright © 2009 Pearson Education, Inc. publishing as Prentice Hall 9-1 Part Four World Financial Environment Chapter Nine Global Foreign Exchange And.
Visual Recognition Tutorial1 Markov models Hidden Markov models Forward/Backward algorithm Viterbi algorithm Baum-Welch estimation algorithm Hidden.
Current Trends in Foreign Exchange Randy Royther Head of Commercial Products 5/23/2016.
Investment Planning Chapter 11. Investing Placing money in some medium such as stocks, bonds or real estate in the expectation of receiving some future.
Currency Markets BY: ALCANTARA, REA MAE C..
The Currency Market: Lecture 2
EEL 6586: AUTOMATIC SPEECH PROCESSING Hidden Markov Model Lecture
Futures Markets and Risk Management
FIN 440: International Finance
Hidden Markov Model LR Rabiner
FOREX 101.
Slides prepared by Kaye Watson
LECTURE 15: REESTIMATION, EM AND MIXTURES
A Gentle Tutorial of the EM Algorithm and its Application to Parameter Estimation for Gaussian Mixture and Hidden Markov Models Jeff A. Bilmes International.
Introduction to Currency Market
A Gentle Tutorial of the EM Algorithm and its Application to Parameter Estimation for Gaussian Mixture and Hidden Markov Models Jeff A. Bilmes International.
Presentation transcript:

Introduction to Algorithmic Trading Strategies Lecture 2 Hidden Markov Trading Model Haksun Li

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  A tutorial on hidden Markov models and selected applications in speech recognition. Rabiner, L.R. Proceedings of the IEEE, vol 77 Issue 2, Feb

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

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  McDonald’s hamburger as a currency.  The price of a burger in the USA = the price of a burger in Europe  E.g., USD1.25/burger = EUR1/burger  EURUSD =

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 s2: MEAN- REVERTIN G s1: UP s3: DOWN a22 = 0.2 a11 = 0.4a33 = 0.5 a12 = 0.2 a21 = 0.3 a23 = 0.5 a32 = 0.25 a13 = 0.4 a31 =

Example: State Probability 16

Markov Property 17

Hidden Markov Chain 18

Markov Chain s2: MEAN- REVERTIN G s1: UP s3: DOWN a22 = ? a11 = ?a33 = ? a12 = ? a21 = ? a23 = ? a32 = ? a13 = ? a31 = ? 19

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  6 unknown factors.  Λ is estimated on a rolling basis.  Evaluations:  Hypothesis testing  Sharpe ratio  VaR  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