data/Rmd/masters_thesis.md

title: Master's thesis author: Krzysztof Wojdalski output: html_document: toc: false theme: united highlight: tango keep_md: true

## Loading required package: knitr

The master's thesis is about the Reinforcement Learning application in the foreign exchange market. The author starts with describing the FX market, analyzing market organization, participants, and changes in the last years. He tries to explain current trends and the possible directions. The next part consists of theoretical pattern for the research - description of financial models, and the AI algorithms. Implementation of the RL-based approach in the third chapter, based on Q-learning, gives spurious results.

FX Market Organization

Explaining the institutional structure of FX market requires introducing formal definitions of market organization. According to Lyons Lyons2002, these are:

The FX market is a kind of decentralized multiple-dealer market. There is no single indicator that would show the best bid and the best ask. Hence, the market transparency is low. It is especially important at tail events. It is hard to determine when the market was at a given time and findings are usually spurious. The foreign exchange market is perceived as the largest and most liquid one, with a year-on-year turnover of \texteuro 69 trillion.

The FX market is an over the counter, global (OTC) market, i.e. participants can trade currencies with relatively low level of legal obstacles. The market core is built up by the biggest banks in the world. Hence, the FX organization is often referred as an inter-bank market. The participants of the FX market differ by access, spreads, impact, turnover they generate, order size, and purpose. They can be divided into five main groups:

Market share of top financial institutions in FX trading in 2014 Rank Bank MarketShare 1 1 Citi 0.16 2 2 Deutsche Bank 0.15 3 3 Barclays 0.08 4 4 JPMorgan 0.08 5 5 UBS 0.07 6 6 Bank of America Merrill Lynch 0.06 7 7 HSBC 0.05 8 8 BNP Paribas 0.04 9 9 Goldman Sachs 0.03 10 10 RBS 0.03 11 11 Societe Generale 0.02 12 12 Standard Chartered 0.02 13 13 Morgan Stanley 0.02 14 14 Credit Suisse 0.02 15 15 State Street 0.02

In last years, there have been observed shifting towards eFX. Commercial banks, as mentioned in the previous subsection, are subject to new regulations. Therefore, right now they are more concerned about increasing their turnover than benefiting off a good view (speculation). eFX helps in this goal. It requires more technology while a number of traditional dealers is effectively reduced. The activity require quantitative analysts, "quants", who can manage pricing engines in order to maximize profit while staying in the risk threshold. Over 4 years, eFX gained 13 percent point and in 2015 for the first time surpassed voice trading, with 53.2\% of client flow share JeffPatterson2015 Chung2015.

The following chapter introduces articles that correspond with the subject of the current thesis and are considered as fundamentals of modern finance. Specifically, the beginning contains financial market models. The next subchapter includes basic investment effectiveness indicators that implicitly or explicitly result from the fundamental formulas from the first subchapter.

Selected financial market models and theory

Works considered as a fundament of quantitative finance and investments are Sharpe \cite{Sharpe1964}, Lintner \cite{Lintner1965}, and Mossin \cite{Mossin1966}. All these authors, almost simultaneously, formulated Capital Asset Pricing Model (CAPM) that describes dependability between rate of return and its risk, risk of the market portfolio, and risk premium. Assumptions in the model are as follows:

Described by the following model formula is as follows: $$ E(R_P)=R_F+\frac{\sigma_P}{\sigma_M}\times[E(R_M)-R_F] $$ where:

$E(R_P)$ function is also known as Capital Market Line (CML). Any portfolio lies on that line is effective, i.e. its rate of return corresponds to embedded risk. The next formula includes all portfolios, single assets included. It is also known as Security Market Line (SML) and is given by the following equation: $$ \label{eq:erl} E(R_i)=R_F+\beta_i\times[E(R_M)-R_F] $$ where:

The Modern Portfolio Theory

The following section discuss the Modern Portfolio Theory developed by Henry Markowitz \cite{Markowitz1952}. The author introduced the model in which the goal (investment criteria) is not only to maximize the return but also to minimize the variance. He claimed that by combining assets in different composition it is possible to obtain the portfolios with the same return but different levels of risk. The risk reduction is possible by diversification, i.e. giving proper weights for each asset in the portfolio. Variance of portfolio value can be effectively reduced by analyzing mutual relations between returns on assets with use of methods in statistics (correlation and covariance matrices). It is important to say that any additional asset in portfolio reduces minimal variance for a given portfolio but it is the correlation what really impacts the magnitude. The Markowitz theory implies that for any assumed expected return there is the only one portfolio that minimizes risk. Alternatively, there is only one portfolio that maximizes return for the assumed risk level. The important term, which is brought in literature, is the effective portfolio, i.e. the one that meets conditions above. The combination of optimal portfolios on the bullet.

Bullet figure

The Markowitz concept is determined by the assumption that investors are risk-averse. This observation is described by the following formula:

$$ E(U)<U(E(X)) $$ where:

The expected value of payoff is given by the following formula: $$ E(U)=\sum_{i=1}^{n}\pi_iU(c_i) $$ where:

One of the MPT biggest flaws is the fact that it is used for ex post analysis. Correlation between assets changes overtime so results must be recalculated. Real portfolio risk may be underestimated. Also, time window can influence the results.

The efficient market hypothesis

In 1965, Eugene Fama introduced the efficient market term \cite{Fama1965}. Fama claimed that an efficient market is the one that instanteneously discounts the new information arrival in market price of a given asset. Because this definition applies to financial markets, it had determined the further belief that it is not possible to beat the market because assets are perfectly priced. Also, if this hypothesis would be true, market participants cannot be better or worse. Their portfolio return would be a function of new, unpredictable information. In that respect, the only role of an investor is to manage his assets so that the risk is acceptable.

Selected investment performance measures

Introduced articles does not include any indicator that would explicitly measure portfolio management effectiveness. Equations that result from the authors' work are important because some of further developed measures are CAPM-based. The most known are the Sharpe ratio, the Treynor ratio, and the Jensen's alpha. Popularity of these indicator comes from the fact that they are easy to understand for the average investor. \cite{Marte2012} In \cite{Sharpe1966}, the author introduced the $\frac{R}{V}$ indicator, also known as the Sharpe Ratio ($S$), which is given by the following formula: $$ S_i=\frac{E(R_i-R_F)}{\sigma_i} $$ where:

Treynor (Treynor1965) proposed other approach in which denominator includes $\beta_i$ instead of $\sigma_i$. The discussed formula is given by: $$ T_i=\frac{R_i-R_F}{\beta_i} $$ where:

Both indicators, i.e. $S$ and $T$ are relative measures. Their value should be compared with a benchmark to determine if a given portfolio is well-managed. If they are higher (lower), it means that analyzed portfolios were better (worse) than a benchmark. The last measure, very popular among market participants, is the Jensen's alpha. It is given as follows: $$ $$ where:

The Jensen's alpha is an absolute measure and is calculated as the difference between actual and CAPM model-implied rate of return. The greater the value is, the better for the $i$-th observation.

The differential Sharpe ratio - this measure is a dynamic extension of Sharpe ratio. By using the indicator, it can be possible to capture a marginal impact of return at time t on the Sharpe Ratio. The procedure of computing it starts with the following two formulas: $$ A_n=\frac{1}{n}R_n+\frac{n-1}{n}A_{n-1} $$ $$ B_n=\frac{1}{n}R_n^2+\frac{n-1}{n}B_{n-1} $$ At $t=0$ both values equal to 0. They serve as the base for calculating the actual measure - an exponentially moving Sharpe ratio on $\eta$ time scale. $$ S_t=\frac{A_t}{K_\eta\sqrt{B_t-A_t^2}} $$ where:

Using of the differential Sharpe ratio in algorithmic systems is highly desirable due to the following facts \cite{Moody1997}:

The drawdown is the measure of the decline from a historical peak in an asset. The formula is given as follows:

$$ D(T)=\max{max_{0, t\in (0,T)} X(t)-X(\tau)} $$

The Sterling ratio (SR)

The maximum drawdown (MDD) at time $T$ is the maximum of the Drawdown over the asset history. The formula is given as follows:

$$ MDD(T)=\max_{\tau\in (0,T)}[\max_{t\in (0,\tau)} X(t)-X(\tau)] $$



kwojdalski/rpm2 documentation built on May 29, 2019, 3:40 a.m.