Forex Modeling and Charting

download Forex Modeling and Charting

of 22

Transcript of Forex Modeling and Charting

  • 8/3/2019 Forex Modeling and Charting

    1/22

    Technical Analysis Compared to Mathematical Models Based

    Methods Under Parameters Mis-specification

    Christophette Blanchet-Scalliet1, Awa Diop2,

    Rajna Gibson3, Denis Talay2, Etienne Tanre2,

    Abstract

    In this study, we compare the performance of trading strategies based on possibly mis-specified

    mathematical models with a trading strategy based on a technical trading rule. In both cases, the trader

    attempts to predict a change in the drift of the stock return occurring at an unknown time. We explicitly

    compute the traders expected logarithmic utility of wealth for the various trading strategies. We next

    rely on Monte Carlo numerical experiments to compare their performance. The simulations show that

    under parameter mis-specification, the technical analysis technique outperforms the optimal allocation

    strategy but not the model and detect strategies. The latter strategies dominance is confirmed underparameter mis-specification as long as the two stock returns drifts are high in absolute terms.

    Keywords

    Stochastic models, Model specification, Portfolio allocation, chartist.

    JEL classification

    G11, G14, C15, C65

    AMS classification

    60G35, 93E20, 91B28, 91B26, 91B70.

    Acknowledgment

    Financial support by the National Centre of Competence in Research Financial valuation and RiskManagement (NCCR FINRISK) is gratefully acknowledged.

    NCCR-FINRISK is a research program supported by the Swiss National Science Foundation.

    1Laboratoire Dieudonne, universite Nice Sophia-Antipolis Parc Valrose 06108 Nice Cedex 2, FRANCE,[email protected]

    2INRIA, Pro jet OMEGA, 2004 route des Lucioles, BP93, 06902 Sophia-Antip olis, France,{Awa.Diop,Denis.Talay,Etienne.Tanre}@sophia.inria.fr. Awa Diop gratefully acknowledges financial support fromthe National Centre of Competence in Research Conceptual Issues in Financial Risk Management (NCCRFINRISK),

    3NCCR FINRISK, Swiss Banking Institute, University of Zurich, Plattenstrasse 14, Zurich 8032, Switzerland, Email:[email protected]

    1

  • 8/3/2019 Forex Modeling and Charting

    2/22

    1 Introduction

    The financial services industry typically relies on three main approaches to make investment decisions: thefundamental approach that uses fundamental economic principles to form portfolios, the technical analysisapproach that uses price and/or volume histories and the mathematical approach that is based on mathe-matical models. Technical analysis has been used by professional investors for more than a century. The

    academic community has looked at its foundations and its performance with a rather skeptical frame of mind.Indeed, technical analysis techniques have limited theoretical justification, and they stand in contradictionto the conclusions of the efficient market hypothesis. More recently, there has been a renewal of academicinterest in the performance of technical analysis based methods. Indeed, the pioneering study by Brock,Lakonishok and Le Baron [6] applied 26 trading rules to the Dow Jones Industrial Average and found thatthey significantly outperform a benchmark of holding cash. In their impressive study, Sullivan, Timmermannand White [15] examine close to 8000 technical trading rules and repeat Brock and al. study while correctingit for data snooping problems. They find that the trading rules examined by Brock and al. do not generatesuperior performance out-of sample. Lo, Mamaysky and Wang [11] propose to use a non-parametric kernelregressions pattern recognition method in order to automate the evaluation of technical analysis tradingtechniques. In their comprehensive study they compare the unconditional and the conditional - on techni-cal analysis indicators - distribution of a large number of stocks traded on the NYSE/AMEX and on theNASDAQ. They conclude that several technical indicators do provide some incremental information and

    may have some practical value. However, as pointed out by Jegadeesh [7] in his comment of the Lo andal. paper [11], none of the technical analysis indicators examined by the authors is able to identify prof-itable investment opportunities. Thus, it seems that the debate about the effectiveness of technical analysisusefulness is still very much alive.

    The purpose of our study is to examine chartist and mathematical models based trading strategiesby providing a conceptual framework where their performance can be compared. If one considers a non-stationary economy, it is impossible to specify and calibrate mathematical models that can capture all thesources of parameter instability during a long time interval. In such an environment, one can only attemptto divide any long investment period into sub-periods such that, in each of these sub-periods, the financialassets prices can reasonably be supposed to follow some particular distribution (e.g., a stochastic differentialsystem with a fixed volatility function). Due to the investment opportunity sets instability, each sub-periodmust be short. Therefore, one can only use small amounts of data during each sub-period to calibrate the

    model, and the calibration errors can be substantial. Yet, any investment strategys performance dependson the underlying model characterizing the evolution of the investment opportunity set and also on theparameters involved in the model. Thus, in a non-stationary economy, one can use strategies which havebeen optimally designed under the assumption that the market is well described by a prescribed model,but these strategies can be extremely misleading in practice because the prescribed model does not fit theactual evolution of the investment opportunity set. In such a situation, is one better of using a technicalanalysis based trading rule which is free of any model dependency? In order to answer that question oneshould compare the performance obtained by using erroneously calibrated mathematical models with the oneassociated with technical analysis techniques. To our knowledge, this question has not yet been investigatedin the academic literature.

    More specifically, we here consider the following test case: the agent in a frictionless continuous-timeeconomy can invest in a riskless asset and in a stock. The instantaneous expected rate of return of the stockchanges once at an unknown random time. We compare the performance of traders who respectively use:

    A technical analysis technique, namely the simple moving average technique in order to predict thechange in the stock returns drift.

    a portfolio allocation strategy which is optimal when the mathematical model is perfectly specified andcalibrated.

    two mathematical strategies called model and detect strategies aimed at detecting the time of the

    2

  • 8/3/2019 Forex Modeling and Charting

    3/22

    drift change.

    the three previous strategies under mis-specified parameters (due to the error on calibration).

    The study is divided into two parts: a mathematical part which, whenever possible, provides analyticalformulae for portfolios managed by means of mathematical and technical analysis strategies and a numerical

    part which provides comparisons between the various strategies performance. Based on the numericalsimulations, we find that the chartist strategy can outperform optimal portfolio allocation models when thereis parameter mis-specification. However, the model and detect mathematical strategies clearly dominatethe chartist trading rule even when they are subject to parameter mis-specification.

    The paper is organized as follows: In section 2, we describe the basic setting underlying our mathematicalmodeling. In sections 3 and 4, we examine the performance of a trader whose strategy is based on mathe-matical models. In section 3, we examine the optimal portfolio allocation strategy. We give explicit formulasfor the optimal wealth and the portfolio strategy of a trader who perfectly knows all the parameters charac-terizing the investment opportunity set and thus fully describe the best financial performance that one canexpect within our model. In section 4, we consider a trader who uses mathematical models in order to detectthe change time in the drift of the stock price process as early and reliably as possible: he/she selects astopping time adapted to the filtration generated by (St), which serves as an alarm signal (this strategyis called Model and Detect). In section 5, we consider the performances of the optimal portfolio allocation

    strategy and of the Model and Detect strategy when the trader mis-specifies the parameters of the model.In section 6, we focus on a technical analyst who uses a simple moving average indicator to detect the timeat which the drift of the stock return switches. We characterize his/her expected utility of wealth in thelogarithmic case. We also numerically illustrate the properties of his/her strategys performance. Finally, insection 7,we compare the performances of the mis-specified mathematical strategies to those of the technicalanalysis technique.1.

    2 Description of the Setting

    We consider a frictionless continuous-time economy with two assets that are traded continuously. The firstone is an asset without systematic risk, typically a riskless bond (or bank account), whose price at time t

    evolves according to the following equation dS0t = S

    0t rdt,

    S00 = 1.

    The second asset is a stock subject to systematic risk. We model the evolution of its price at time t by thelinear stochastic differential equation

    dSt = St

    2 + (1 2) 1 (t)

    dt + StdBt,

    S0 = S0,

    (2.1)

    where (Bt)0tT is a one-dimensional Brownian motion on a given probability space (, F, P). The randomtime of the stcok return drift change is independent ofB and has an exponential distribution with parameter

    :P ( > t) = et, t 0. (2.2)

    At time , which is neither known, nor directly observable, the instantaneous expected rate of return changesfrom 1 to 2.

    1A short version of this paper has been published in [3].

    3

  • 8/3/2019 Forex Modeling and Charting

    4/22

    We suppose that the parameters 1, 2, > 0 and r 0 satisfy

    1 2

    2< r < 2

    2

    2.

    The main purpose of this study will be to use this setting in order to examine if mathematical modelsused to detect the time change in the drift of the stock price process lead to better predictions and thus

    to superior performance than a very popular technical analysis method based on a simple moving averagesignal.

    3 The Optimal Portfolio Allocation Strategy Under a Change of

    Drift

    3.1 Introduction

    We start by characterizing the optimal wealth and portfolio allocation of a trader who perfectly knows all theparameters 1, 2, , r and . Of course, this situation is unrealistic. However, it is worth computing thebest performance that one can expect within our setting. This performance represents an optimal benchmark

    for mis-specified allocation strategies relying either on a mathematical model or on technical analysis.Let t be the proportion of the traders wealth invested in the stock at time t; the remaining proportion

    1 t is invested in the bond. For a given, non random, initial capital x > 0, let Wx, denote the wealthprocess corresponding to the portfolio (). We have

    dWx,t = Wx,t

    rdt + t

    1 r + (2 1) 1 (t)

    dt + dBt

    . (3.1)

    Now, let U() denote a utility function. We suppose that U is strictly increasing, concave, of class C2(0, )and satisfies

    U(0+) = limx0

    U(x) = , U() = limx

    U(x) = 0.

    Let A(x) denote the set of admissible strategies, that is, the set of processes which take values in [0, 1] andare progressively measurable with respect to the filtration FS generated by the observed prices St.

    It is easy to see that, for all process in A(x), Wx,t > 0 for all t.The investors objective is to maximize his/her expected utility of wealth at the terminal date T. He/she

    solves the following optimization problem:

    V(x) := supA(x)

    E [U(WT)|W0 = x] . (3.2)

    In order to compare the performance of the optimal strategy defined by ( 3.2) to the one pursued by atechnical analyst, we impose constraints on the portfolio weights. Indeed, we will below assume that thetechnical analyst invests all of his/her wealth either in the stock or in the bond depending upon the movingaverage signal. We therefore assume that the portfolio weights of the trader pursuing an optimal strategyare also constrained to lie within the interval [0 , 1] in the absence of short selling.

    3.2 The Case of General Utility Functions

    In order to compute the constrained optimal wealth of the trader, we use the martingale approach tostochastic control problems as developed by Karatzas, Shreve, Cvitanic, etc. More precisely, we follow andcarefully adapt the martingale approach to the well known optimal consumption-portfolio problem studiedby Merton [13]. We emphasize that our traders situation differs from the Merton problem for the followingthree reasons:

    4

  • 8/3/2019 Forex Modeling and Charting

    5/22

    The drift coefficient of the dynamics of the risky asset return is not constant over time (since it changesat the random time ).

    We face some subtle measurability issues since the traders strategy needs to be adapted with respectto the filtration generated by (St). As already mentioned, the drift change at the random time makesthis filtration different from the filtration generated by the Brownian motion (Bt).

    The portfolio weight is constrained to lie in a finite interval ([0, 1]).

    These three features of our problem make it hard to construct optimal strategies. Indeed, in the caseof a general utility function, we need an additional hypothesis described below to prove the existence of anoptimal constrained allocation strategy , and to exhibit an abstract representation for the correspondingoptimal portfolio process.

    As in Karatzas-Shreve [10], we introduce an auxiliary unconstrained market M defined as follows: LetD be the subset of{FSt } progressively measurable processes : [0, T] R such that

    E

    T0

    (t)dt < , where (t) := inf(0, (t)).

    The bond price process S0

    () and the stock price S() satisfy

    dS0t ()

    S0t ()=

    dS0tS0t

    + (t)dt,

    dSt()

    St()=

    dStSt

    +

    (t) + (t)

    dt.

    We compute the optimal allocation strategy for each auxiliary unconstrained market driven by a process (see Proposition 3.1). We conclude with Proposition 3.2 which links the optimal strategy for the constrainedproblem with the set of optimal strategies for auxiliary unconstrained markets.

    For each auxiliary unconstrained market, let A(x, ) denote the set of admissible strategies, that is,

    A(x, ) :=

    {

    FSt

    progressively measurable process s.t. W,0 = x, W

    ,t > 0 for all t > 0

    }.

    We have to solve the following problem P :

    V(, x) := supA(,x)

    E [U(W,T )|W,0 = x] ,

    where

    dW,tW,t

    = tdSt()

    St()+ (1 t) dS

    0t ()

    S0t ()

    =dWtWt

    +

    (t) + t(t)

    dt. (3.3)

    To characterize optimal allocation strategies and their associated wealth level, we need to introduce fourprocesses which are adapted to the filtration FS generated by the observed price process.

    The exponential likelihood-ratio process Lt is defined by

    Lt =

    StS0

    212

    exp

    1

    22

    (2 1)2 + 2(2 1)(1

    2

    2)

    t

    . (3.4)

    5

  • 8/3/2019 Forex Modeling and Charting

    6/22

    The conditional a posteriori probability Ft that the change point has appeared before time t is Ft :=P

    t|FSt

    .

    Ft =etLt

    t0

    esL1s ds

    1 + etLtt0

    esL1s ds(3.5)

    The innovation process B is defined by

    Bt =1

    Rt (1

    2

    2)t (2 1)

    t0

    Fsds

    , t 0. (3.6)

    The process B is a Brownian motion for the filtration FS.

    The exponential process Ht :

    Ht = exp

    t0

    1 r + (s)

    +

    (2 1)Fs

    dBs

    12

    t

    0

    1 r + (s)

    +

    (2 1)Fs

    2ds

    .

    Proposition 3.1. For each D, the optimal wealth is

    W,T = (U)1

    yHTe

    rTRT

    0(t)dt

    W,t =

    ert+Rt

    0(s)ds

    HtE

    HTe

    rTRT

    0(s)ds (U)

    1

    yHTerT

    RT

    0(s)ds

    |FSt

    .

    Moreover, the optimal strategy satisfies

    ,t = 1

    1 r + (2 1)Ft + (t)

    +

    t

    Ht W,t e

    rtRt

    0(s)ds

    , (3.7)

    where Ft is defined as in (3.5), y stands for the Lagrange multiplier, that is, is such that

    E

    HT exp(rT

    T0

    (t)dt) (U)1

    (yHT exp(rT T0

    (t)dt))

    = x.

    and is a FSt adapted process which satisfies

    E

    HTe

    (rTRT

    0(t)dt) (U)

    1

    yHTe(rT

    RT

    0(t)dt)

    FSt

    = x +

    t0

    sdBs.

    The proof is postponed to the Appendix.

    In view of (3.3), we observe that for each constrained strategy , (t) + t(t) 0, and thereforeW,t Wt and V(, x) V(x). So, V(x) infD V(, x). The following proposition tells us that, if theminimum is attained, then the minimizing auxiliary strategy provides the optimal constrained strategy .

    Proposition 3.2. If there exists in D such thatV(, x) = inf

    DV(, x), (3.8)

    6

  • 8/3/2019 Forex Modeling and Charting

    7/22

    then an optimal portfolio , for the unconstrained problemP is also an optimal portfolio for the constrainedoriginal problem P, such that

    Wt = W, ,et and V(x) = V(, x). (3.9)

    An optimal portfolio allocation strategy is

    t := 1

    1 r + (2 1)Ft + (t)

    +t

    Het Wt ertRt0 e(s)ds

    , (3.10)

    where Ft is defined as in (3.5).

    Proof. See the proof in Karatzas-Shreve [10] p. 275.

    3.3 The Case of the Logarithmic Utility Function

    When the agent has a logarithmic utility function, we can verify the existence of a

    satisfying (3.8) and

    explicit the optimal allocation strategy and its associated wealth W,x.

    Proposition 3.3. If U() = log() and the initial endowment is x, then the optimal wealth process andstrategy are

    W,xt =x exp

    rt +

    t0(s)ds

    Het , (3.11)where

    (t) =

    (1 r + (2 1)Ft) if 1 r + (2 1)Ft2

    < 0,

    0 if1 r + (2 1)Ft

    2 [0, 1],

    2 (1 r + (2 1)Ft) otherwise,(3.12)

    and, as above, (t) = inf (0, (t)) .In addition,

    t = proj[0,1]

    1 r + (2 1)Ft

    2

    . (3.13)

    Proof. If U(x) = log(x) for each D, the solution of the unconstrained problem is

    ,t =1 r + (2 1)Ft + (t)

    2,

    W,t =x exp

    rt +

    t0

    (s)ds

    Ht,

    V(, x) = log x + rT + ET

    0

    (t)dt

    +E

    T0

    1

    2

    1 r + (2 1)Ft + (t)

    2dt

    . (3.14)

    7

  • 8/3/2019 Forex Modeling and Charting

    8/22

    Then the process defined by (3.12) satisfies(t) + 1

    2

    1 r + (2 1)Ft + (t)

    2= inf

    D

    (t) +

    1

    2

    1 r + (2 1)Ft + (t)

    2.

    Remark 3.4. Optimal strategies for the constrained problem are projections on [0, 1] of optimal strate-gies for the unconstrained problem.

    Remark 3.5. In the case of the logarithmic utility function, when t is small and thus smaller than thechange time with high probability, Ft is close to 0; since, by hypothesis, one also has

    1r2 0, the optimal

    risky asset portfolio weight is close to 0 ; after the change time , Ft is close to 1, and the optimal risky assetportfolio weight is close to min(1, 2r2 ). In both cases, we approximately recover the optimal strategies ofthe constrained Merton problem. with drift parameters equal to 1 or 2 respectively.

    Remark 3.6. Notice that, in view of (3.4), (3.5) and (3.13), t can be expressed in terms of the prices(Su, 0 u t).

    Using the explicit value (3.12) of

    (t), one can obtain an explicit formula for the value function Ve(x)

    corresponding to the optimal strategy.

    The derivations of the optimal portfolio weights and of the expected utility of wealth for the logarithmicinvestor will serve as benchmarks to compare the performances obtained by the model and detect strategyand the strategy pursued by a technical analyst. Indeed, we can write (see Appendix 9.3) a lengthy formulafor the value function V(x) by using a result due to Yor (see Yor [16] or BorodinSalminen [5, formula 1.20.8p.618]). See [4] for further details.

    4 Two Model and Detect Strategies

    The optimal portfolio allocation strategy in the previous section supposes that the trader is allowed tocontinuously change his/her portfolio allocation. In this section, the trader is allowed to change his/herallocation only once. So, the trader uses an optimal detection procedure to decide when to rebalance his/her

    portfolio. In order to facilitate the comparison with the performance of the technical analysts strategy, wehere assume that the trader arbitrarily sets the stock weight to = 0 before the drift change and subsequentlyto 1. We continue to suppose that the trader perfectly knows all the parameters of the model.

    We consider two detection methods: the first one has been proposed by Karatzas [ 9], and the other onehas been proposed by Shiryayev [14]. The goal of these two methods is to find a stopping rule whichdetects the instant at whihc the drift of the stock return changes. We compute the wealth of the traderwho uses one of the two model and detect strategies. In both cases, the trader puts all of his/her money inthe bond until , and in the stock after , thus his wealth satisfies:

    WT =xS0S

    ST 1 (T) + xS0T 1 (>T).

    The time is interpreted as the alarm time, it can occur before (in this case, it corresponds to a false

    alarm), or after . So, the amount of time by which the stopping rule misses the true change of driftpoint is given by | |.

    The main mathematical tool used to obtain these two stopping rules is the process Ft, the (conditional)probability that the (unknown) change point appeared before the running time t. For each procedure, thetrader decides to invest his/her wealth in the stock when Ft is bigger than a given quantity repectively equalto p for the Karatzas method (see (4.2)) and to A for the Shiryayevs method (see (4.3)). These twoquantities will be defined in Sections 4.1 and 4.2.

    8

  • 8/3/2019 Forex Modeling and Charting

    9/22

    With the Karatzas method, the trader minimizes the expected miss E| |. With Shiryayevs one, thetrader minimizes {P( < ) + cE( )+}, i.e., he/she does not give the same weight to errors generatedby false alarms ( < ) and errors generated by late alarms ( ).

    4.1 Karatzas Method

    We first adapt Karatzass detection method to compute the optimal stopping rule K that minimizes theexpected miss

    R() := E| | (4.1)over all stopping rules , when is assumed to have the a priori exponential distribution ( 2.2).

    Proposition 4.1. The stopping rule K which minimizes the expected miss E|| over all the stoppingrules withE() < is

    K = inf

    t 0Ft p , (4.2)

    where Ft is defined as in (3.5) and p is the unique solution in (12 , 1) of the equation

    1/2

    0

    (1 2s)e/s

    (1 s)2+s2ds =

    p

    1/2

    (2s 1)e/s

    (1 s)2+s2ds,

    where = 22/(2 1)2.

    Proof. We adapt Karatzass method in [9] to our specific case. Denote by Sthe collection of stopping rules : [0, ) such that E() < . Rewrite (4.1) as follows:

    R() = E ( )+ + ( )+ = E( )+ + E() E( ).Then, using (2.2) and the notation (3.5), we get

    R() = 1

    + E

    0

    1 (s)ds 0

    1 (>s)ds

    =1

    + E

    0

    21(s) 1

    1 (s)ds

    =

    1

    + 2E

    0

    Fs 1

    2

    ds.

    We thus obtain

    infS

    R() = 1

    + 2 infS

    E

    0

    Fs 1

    2

    ds.

    It now remains to follow Karatzas arguments (see [9]).

    The terminal wealth of a trader who uses Karatzas detection procedure satisfies

    WT = xerK exp

    (BT BK ) + (1

    2

    2)(T K)

    + (2 1)[(T )+ (K )+]

    1 (KT)

    + x exp(rT) 1 (K>T).

    9

  • 8/3/2019 Forex Modeling and Charting

    10/22

    4.2 Shiryayevs Method

    The detection method proposed by Shiryayev (namely the Variant B in [14]) consists in computing

    B(c) := inf

    {P( < ) + cE( )+}

    and the corresponding optimal stopping time for a given c > 0.

    For all c > 0, this time is given by

    S(A) := inf{t 0; Ft A} (4.3)where F is the conditional a posteriori probability solution of (9.6) and the parameter A is defined as theroot in (0, 1) of the equation

    A0

    exp

    2

    2

    (2 1)21

    y

    1

    y(1 y)2

    y

    1 y 22

    (2 1)2 dy

    =(2 1)2

    22

    c

    exp22

    (2 1)2

    1

    A

    A

    1 A

    22

    (2 1)2 .

    For both Karatzas and Shiryayevs detection procedures, we are able to write explicit formulae for theexpected utility of terminal wealth, E(log(WT)) (similar to the formula in Proposition 6.1 below). Dueto their complexity, these formulae do not allow us to compare the expected utility of terminal wealthassociated with the model and detect strategies to the one obtained when pursuing the optimal strategyor the technical analysis based strategy. In section 7, we therefore rely on numerical simulations to makecomparisons between the various strategies performances.

    Remark 4.2. Beibel and Lerche [2] have considered the model (2.1) with 1 22 r 2 2

    2 .They have studied the problem of maximizing E

    erS 1 (

  • 8/3/2019 Forex Modeling and Charting

    11/22

    Notation. As in the previous developments without estimation error, we set Rt = log(St), where Stdenotes the current stock price. We need to compute Lt and Ft (see (3.4) and (3.5)) to apply the optimalallocation strategy and the model and detect strategies. We define the approximated quantities computedwhen the model is mis-specified Lt and Ft as follows:

    Lt = exp1

    2(2 1)Rt

    1

    22 (2 1)2 + 2(2 1)(1

    2

    2) t ,

    Ft =etLt

    t0

    esL1

    s ds

    1 + etLtt0

    esL1

    s ds.

    5.2 On the Mis-specified Optimal Allocation Strategy

    Observing the stock price St, the trader computes a pseudo optimal portfolio allocation by using theerroneous parameters 1, 2, and . Thus, the stock proportion of his/her mis-specified optimal allocationstrategy satisfies

    t = proj[0,1](1 r + (2 1)Ft)

    2,

    and the corresponding wealth satisfies

    W

    t = ert exp

    t0

    ud(eruSu)

    .

    5.3 On Mis-specified Model and Detect Strategies

    The erroneous stopping rule for the Karatzas dtection time rule sastifies

    K

    = inf

    t 0, Ft p

    where p is the unique solution in (1

    2, 1) of the equation

    1/20 (1 2s)e/s

    (1 s)2+ s2

    ds = p

    1/2

    (2s

    1)e/s

    (1 s)2+ s2

    ds

    with = 22/(2 1)2.The wealth of the model and detect trading strategy satisfies

    WT = xS0

    K

    STSK

    1

    (KT)

    + xS0T 1 (K>T).

    A similar approach based on the results obtained in section 4.2 can be followed to compute the erroneousstopping rule and its associated wealth for the Shiryayev detection rule.

    6 The Chartist Investment Strategy

    6.1 Introduction

    Technical analysis makes predictions about the evolution of an assets price and defines trading rules usingonly the assets price (or/and volume) history. Thus, technical analysts compute indicators based on theassets past transaction prices and volumes. These indicators are used as trading signals assuming that (see,e.g., the book by Steve Achelis [1]) :

    11

  • 8/3/2019 Forex Modeling and Charting

    12/22

    The price of a stock is governed by the law of supply and demand. The stock price evolves according to trends during discernible periods. These discernible tendencies repeat themselves in a regular fashion.

    A very large number of technical analysis indicators are used by practitioners. In their impressive study,

    Sullivan, Timmermann and White [15] provide a parameterization for 7846 distinct trading rules. Here, welimit ourselves to the simple moving average indicator because it is easy to compute and widely used todetect trend patterns in stock prices. In order to compute its value, one averages the closing prices of thestock during the most recent time periods. When prices are trending, this indicator reacts quickly to recentprice changes.

    6.2 Moving Average Indicator for the Stock Prices

    Consider a chartist trader who takes decisions at discrete times during the interval [0, T] with time incrementst = TN:

    0 = t0 < t1 < .. . < tN = T; tk = kt.

    We denote by t {0, 1} the proportion of the agents wealth invested in the risky asset at time t, and byMt the simple moving average indicator of the prices defined as

    Mt =1

    tt

    Su du. (6.1)

    The parameter denotes the size of the time window used to compute the moving average.

    At time 0, the agent knows the past prices of the stock and has enough data to compute M0 . At eachtn, n [1 N], the chartist follows a very simple trading strategy: all the wealth is invested into the riskyasset if the price Stn is larger than the moving average M

    tn . Otherwise, all the wealth is invested into the

    riskless asset. This portfolio investment strategy is thus analogous to the one followed by the model anddetect trader.

    Consequently,

    tn = 1 (StnMtn). (6.2)

    Denote by x the initial wealth of the trader. The wealth at time tn+1 is

    Wtn+1 = Wtn

    Stn+1

    Stntn +

    S0tn+1S0tn

    (1 tn)

    ,

    and therefore, since S0tn+1/S0tn = exp(rt),

    WT = xN1n=0

    tn

    Stn+1

    Stn exp(rt)

    + exp(rt)

    . (6.3)

    6.3 The Particular Case of the Logarithmic Utility Function

    We now assume that the chartist trader displays a logarithmic utility function. Then, his expected utilityof wealth can be explicitly characterized.

    12

  • 8/3/2019 Forex Modeling and Charting

    13/22

    Proposition 6.1. Consider a technical analyst whose strategy is defined as in (6.2). Then his expectedlogarithmic utility of wealth satisfies

    E

    log

    WTe

    rT

    x

    =

    2

    2

    2 r

    T p

    (1)

    + t 2 2

    2 r

    1 eT

    1 et (p(2) p(1) )e +p(3)

    t(2 1)(et t) 1 eT

    1 etp(3) ,

    where we have set

    p(1) =

    0

    y

    z23/2

    2ye

    (2/ /2)2 2

    (1 + z2)

    22y i2/2

    z

    2y

    dzdy,

    p(2) =

    0

    R4

    1

    (y2

    z1y1

    +z2

    )

    z23/2

    22y2 e

    (2/ /2)2 ( v)

    2

    (1 + z22)

    22

    y2 i2(v)/2 z22y2z13/21

    2y1e

    (1/ /2)2 v2

    (1 + z21)

    22y1 i2v/2

    z1

    2y1

    evdy1dz1dy2dz2dv,

    p(3) =

    0

    y

    z13/2

    2ye

    (1/ /2)2 2

    (1 + z2)

    22y i2/2

    z

    2y

    dzdy,

    the function i being defined as in (9.11).

    Proof. In view of

    Stj+1Stj

    = exp

    1 2

    2

    t + (2 1) (tj+1 max(, tj))+ + (Btj+1 Btj )

    , (6.4)

    and (6.2), we have

    E log

    WT

    x

    =

    1

    2

    2 r

    t

    N1j=0

    P

    Stj Mtj

    + (2 1)N1j=0

    E

    1 (StjM

    tj) (tj+1 max(, tj))+

    + rT + N1

    j=0 E 1 (StjMtj )(Btj+1 Btj ) .From here, one obtains the result by lengthy calculations using independence and identity in law arguments,and Lemma 9.3 in the Appendix.

    Remark 6.2. Relying on proposition 6.1, one can use numerical optimization procedures to optimizethe choice of , the moving average window size. As we will see in the next section, inadequate choices of may negatively affect the performance of the technical analyst strategy.

    13

  • 8/3/2019 Forex Modeling and Charting

    14/22

    7 A Numerical Comparison of the Various Strategies

    7.1 Empirical Determination of a Good Windowing

    Before turning to a comparison between the various trading strategies, we first show how to optimize thechoice of the moving average window size by using Proposition 6.1 and deterministic numerical optimization

    procedures, or by means of Monte Carlo simulations. In this subsection, we present results obtained fromMonte Carlo simulations to show that inadequate choices of may indeed alter the performance of thetechnical analyst strategy. For each value of we have simulated 500,000 trajectories of the asset priceand computed the expected utility of terminal wealth, E log(WT) by a Monte Carlo method. In all oursimulations the empirical variance of log(WT) is set at 0.04. Thus, the Monte Carlo error on E log(WT) is ofthe order 5.104 with probability 0.99. At first, the number of price trajectories used for these simulationsmay seem too large; however, considered as a function of , the quantity E log(WT) varies very slowly, sothat we really need a large number of simulations to obtain smooth curves (cf. Fig. 1).

    Fig. 1(a) and Fig. 1(b) illustrate the relationship between E log(WT) and for two different values of thestock returns volatility. It is clear from these figures that the optimal choice of varies with the volatilityof the stock returns. When the volatility reaches 0.05, the optimal choice of is around 0.3 whereas, whenthe volatility increases to 0.15, the optimal choice of is around 0.8.

    4.72

    4.73

    4.74

    4.75

    4.76

    4.77

    4.78

    4.79

    4.8

    0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6

    E(log(W_

    T))

    order of moving average = delta

    (a) 1 = 0.2; = 2; r = 0.0; 2 =0.2; = 0.15; T = 2.0

    4.77

    4.78

    4.79

    4.8

    4.81

    4.82

    4.83

    4.84

    4.85

    4.86

    4.87

    4.88

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7

    E(log(W_

    T))

    order of moving average = delta

    (b) 1 = 0.2; = 2; r = 0.0; 2 =0.2; = 0 .05; T = 2.0

    Figure 1: Expected Values of the Logarithm of the Terminal Wealth (E(log(WT))) for a Trader using theMoving Average Indicator of Order as a Function of .

    On the basis of a comprehensive numerical study performed in [4], we can make the following statements:

    When the volatility decreases, the choice of becomes more important: the curve is flat for largevolatility levels only.

    When the volatility is high, the losses decrease when choosing a large window size.

    In all cases, a too small window length is sub-optimal,

    As |1| or 2 decreases (respectively, increases), the choice of becomes less (respectively, more)important.

    The choice of depends on the arrival rate . The parameter 2 has a strong effect on the importance of the window length. In [4], it is shown that

    the curves become flatter when 2 increases. This observation confirms the intuition; if the future driftis not large enough, the detection of will be more difficult.

    14

  • 8/3/2019 Forex Modeling and Charting

    15/22

    Fig. 2 shows that, when = 2.0, the time horizon has a significant effect on the optimal choice of . Whenthe time horizon is small, for example when T = 1, one has better to underestimate than to overestimateit. When T is large, one has better to overestimate . Of course, the specific values for T highly depend onthe chosen level of .

    0 0.5 1 1.5 24.63

    4.64

    4.65

    4.66

    T=1

    0 0.5 1 1.5 24.92

    4.94

    4.96

    4.98

    5

    T=3

    Figure 2: Expected Values of the Logarithm of the Terminal Wealth (E(log(WT))) for a Trader using theMoving Average Indicator of Order as a Function of : the Dependence of the optimal on the TimeHorizon T.

    7.2 Mis-specified Mathematical Strategies vs Technical Analysis

    We can now address our main question: Is it better to invest according to a mathematical model and detectstrategy based on a mis-specified model, or according to a strategy which is model - free? Due to theanalytical complexity of all the explicit formulae that we have obtained for the various expected utilitiesof terminal wealth, we have not yet succeeded to find a mathematical answer to this question( even inasymptotic cases, when 212 is large, e.g.). We therefore present numerical results obtained from Monte

    Carlo simulations to illustrate our comparisons2

    .Fig. 3 shows that, despite a large degree of parameter mis-specification, the two model and detect

    strategies represented in panels (a) and (b) yield a good performance and clearly outperform the technicalanalyst. However, it can be seen from Figure 3(c) that the optimal trading strategy with mis-specifiedparameters is out-performed by the technical analysis strategy. This result suggests that statistical detectiontechniques or technical analysis approaches could be more attractive when the parameters are mis-specified.

    We have run, a number of other simulations which all confirm that the technical analyst may outperformthe mis-specified optimal allocation strategy but not the mis-specified model and detect strategies. Thesesimulations also show that when 2/1 decreases, the performances of well specified and mis-specified modeland detect strategies decrease3.

    In conclusion, our numerical study suggests that there is no universal solution to the problem of parametermis-specification. It seems that when the drifts are high in absolute terms and, in particular, when the upward

    drift is high, the performance of the Model and Detect strategies can be quite robust and superior to theone of the chartist trading strategy. However, their performance deteriorates rapidly when is stronglymis-specified and/or when the upward drift is not very high. Since the second drift is in fact the hardest toestimate due to the fact that we lack a priori information, we recommend caution before asserting that Model

    2A more complete set of simulations on the performance of the mathematical and the chartist strategies can be found in [4].3The results are available from the authors upon request.

    15

  • 8/3/2019 Forex Modeling and Charting

    16/22

    0 0.5 1 1.5 24.55

    4.6

    4.65

    4.7

    4.75

    4.8

    4.85

    E[log(W

    T)]

    Time (years)

    technical analysisexact parametersmisspecified parameters

    (a) Model and Detect Strategy based on KaratzasEstimation

    0 0.5 1 1.5 24.55

    4.6

    4.65

    4.7

    4.75

    4.8

    4.85

    E[log(W

    T)]

    Time (years)

    technical analysisexact parametersmisspecified parameters

    (b) Model and Detect Strategy based onShiryayevs Estimation

    0 0.5 1 1.5 24.55

    4.6

    4.65

    4.7

    4.75

    4.8

    4.85

    E[log(W

    T)]

    Time (years)

    technical analysisexact parametersmisspecified parameters

    (c) Optimal Strategy

    = 0.2 = 0.2 = 0.15 = 2

    21

    exact

    parameters

    2

    parameters

    misspecified

    = 0.3

    = 1

    _

    ___1 = 0.1 = 0.25

    Figure 3: Comparison of the Expected Values of the Logarithm of Wealth when the Traders use Strategies

    With Exact and Mis-specified Parameters

    and Detect strategies are superior to the technical trading rule4. Indeed, the model and detect strategiesonly offer a clear comparative advantage over the chartist trading rule in the presence of strong expectedfuture trends.

    8 Conclusion and Perspectives

    In this study, we have compared the performance of trading strategies based on possibly mis-specified math-ematical models used to detect the time of the change in the drift of the stock return with a trading strategybased on the simple moving average rule. We have explicitly computed the traders expected logarithmic

    utility of wealth for the various trading strategies. Unfortunately, these explicit formulae were not propitiousto mathematical comparisons. We have therefore relied on Monte Carlo numerical experiments, and observedfrom these experiments that under parameter mis-specification, the technical analysis technique outperformsthe optimal allocation strategy but not the model and detect strategies. The latter strategies dominance

    4In reality, the technical analyst does not know the length of the optimal window, thus his/her strategy is not free of mis-specification either. However, as we show in figure 2, the performance of the technical analyst has only weak sensitivity withrespect to the window length.

    16

  • 8/3/2019 Forex Modeling and Charting

    17/22

    is confirmed under parameter mis-specification as long as the two stock returns drifts are high in absoluteterms.

    This study provides a first step towards building a rigorous mathematical framework in which chartistand mathematical model based trading strategies can be compared. We are extending this research alongseveral dimensions. First, we examine and model the performance of other chartist based trading rules (suchas filter rules, point and figure charts, etc.). Second, we consider modeling the more realistic case where

    there are multiple changes in the drift of the stock returns: we examine the case where the instantaneousexpected rate of return of the stock changes at the jump times of a Poisson process, and the value of thisrate after each time change is unknown. We follow two new directions to tackle these questions: jointlywith B. de Saporta (INRIA), we use stochastic control techniques for switching models and, jointly withM. Martinez (INRIA) and S. Rubenthaler (University of Nice Sophia Antipolis), we use filtering techniques[12]. Finally, it would be worth extending our conceptual framework to the more realistic case where themathematical and the chartist strategies performances account for market frictions.

    9 Appendix

    9.1 An Explicit Expression for the Process Ft

    Lemma 9.1. The conditional a posteriori probability Ft that the change point has appeared before timet, that is, Ft := P

    t|FSt

    , is

    Ft =etLt

    t0

    esL1s ds

    1 + etLtt0

    esL1s ds(9.1)

    where

    Lt =

    StS0

    212

    exp

    1

    22

    (2 1)2 + 2(2 1)(1

    2

    2)

    t

    . (9.2)

    Proof. In order to compute Ft, we start with a probability space (, F,Q) that can support both a standardBrownian motion B and independent random variable : [0, ) with distribution Q[ > t] = et fort 0; we denote by (Gt)t0 the filtration generated by and B, which means that Gt := (, Bs; 0 s t).In view of Girsanovs theorem, the process

    Bt = Bt (2 1)

    t0

    1 (s)ds

    is a (Gt)t0-Brownian motion under the measure of probability P such thatdP

    dQ

    Gt

    = exp

    t0

    1

    (2 1)1 (s)dBs 1

    22

    t0

    (2 1)2 1 (s)ds

    = exp

    1

    (2 1)(Bt B)1 (t) 1

    22(2 1)2(t )+

    = exp

    1

    (2 1)(Bt B) 1

    22(2 1)2(t )

    1 (t) + 1 (>t).

    We observe thatBt =

    1

    log

    StS0

    (1

    2

    2)t

    . (9.3)

    Observe that under Q, the random variable is independent of the (Gt ; t 0)-Brownian motion B andthus of R. Thus, the above expression of dP/dQ can be written as follows

    dP

    dQ

    Gt

    =LtL

    1 (t) + 1 (>t) := Zt, (9.4)

    17

  • 8/3/2019 Forex Modeling and Charting

    18/22

    where Lt is defined as in (3.4). We now check that, on the probability space (, F,P), we have the samemodel as the one presented in the introduction. Indeed, the random variable is G0 -measurable; then,under P, is independent of the (Gt)t0-Brownian motion B and we have P[ > t] = EQ[Z0 1 >t] = Q[ > t].Using the Bayes rule, one gets

    Ft = P[

    t

    |FSt ] =

    EQ

    Zt 1 (t)|FSt

    EQ Zt|FSt . (9.5)Using now the independence of B and under Q, one gets

    EQ

    Zt|FSt

    = EQ

    Lt 1 (=0) +

    LtL

    1 (0t) | FSt

    =

    t0

    LtLs

    esds + et.

    On the other hand, we get

    EQ

    Zt 1 (t)|FSt

    =

    t0

    LtLs

    esds.

    Then, going back to (9.5), we get (3.5).

    Moreover, we can show that the process (Ft)t0 satisfies the following stochastic differential equation

    dFt = (1 Ft)dt + (2 1)

    Ft(1 Ft)dBt, (9.6)

    where

    Bt =1

    log(St) (1

    2

    2)t (2 1)

    t0

    Fsds

    , t 0, (9.7)

    is the innovation process. Indeed, set Vt :=Ft

    1 Ft ; an easy computation leads to

    Vt =

    t0

    LtLs

    e(ts)ds.

    FromdLt = Lt

    12

    (2 1)d(log St) 12

    (2 1)(1 2

    2)dt

    we deduce dVt =

    + Vt

    1

    2(2 1)(1

    2

    2)

    dt +

    1

    2(2 1)Vtd(log St),

    V0 = 0.

    We finally apply Itos formula to the process Ft =Vt

    1 + Vt, and get the stochastic differential equation (9.6).

    Notice that Bt defined as in (3.6) is a (FSt )t0- Brownian motion.

    We conclude with a result useful to apply the martingale representation theorem in the next subsection.

    Lemma 9.2. The filtration generated by the observations (FS ) is equal to the filtration generated by theinnovation process (Bt; t 0). In particular, each (FS ) martingale M admits a representation as

    Mt = M0 +

    t0

    sdBs,

    where is an (FS ) adapted process.

    18

  • 8/3/2019 Forex Modeling and Charting

    19/22

    Proof. Thanks to (3.6), Bt is (FS ) adapted. Conversely, we write (3.6) as:

    d(log St) =

    (1

    2

    2) + (2 1)Ft

    dt + dBt, (9.8)

    Thanks to (9.6), F is (FB ) adapted. and we conclude that the process S(= exp(R)) is also (FB ) adapted.And so (F

    B

    ) = (FS

    ).

    9.2 Proof of Proposition 3.1

    We follow Karatzass method (see for example Karatzas [8]). For A(x, ), remember thatdW,tW,t

    = (r + (t))dt + t ((1 r) + (2 1)Ft + (t)) dt + tdBt.

    Define

    t := (1 r) + ( u2 1)Ft + (t)

    W,

    t := W,

    t exprt t0 (s)ds .We thus have

    dW,tW,t

    = ttdt + tdBt,

    W,t = x exp

    t0

    ss 1

    222s

    ds +

    t0

    sdBs

    .

    We now search an exponential martingale Mt (independent of) such that W,t = W,t Mt is an exponentialmartingale. Set

    Mt = exp

    t0

    sdBs 12

    t0

    2sds

    .

    Then needs to satisfy1

    2(s + s)

    2= ss 1

    22s

    1

    222s ,

    from which s = s and Mt = Ht . Thus, for all ,

    dW,tW,t =

    t t

    dBt. (9.9)

    Therefore the process (W,t , 0 t T) is a non-negative (FSt ,P)- local martingale and so a supermartingale.Consequently,

    E

    HTW

    ,T exp

    rT

    T0

    (t)dt

    x.

    We now introduce the convex dual of U() :

    U(y) := max0

  • 8/3/2019 Forex Modeling and Charting

    20/22

    Using a duality method, we obtain: for all > 0, A(x, ), y 0,

    E[U(W,T )] E

    U

    yHT exp(rT

    T0

    (t)dt)

    + yEHTW,T exp(

    rT

    T

    0

    (t)dt) E

    U(yHT exp(rT

    T0

    (t)dt))

    + yx.

    This inequality is an equality if and only ifW,T = (U

    )1

    yHT exp(rT T0

    (t)dt)

    ,

    E

    HTW

    ,T exp

    rT T

    0(t)dt

    = x.

    The coefficient y is introduced to satisfy the constraint.

    Now, we need to verify that there exists a portfolio such that the process

    Xt :=

    E

    HT exp(rT T0

    (s)ds)(U)1

    yHT exp(rT T0

    (s)ds) FSt

    Ht exp(rt t0

    (s)ds)

    is its wealth process. We use the martingale representation property of the Brownian filtration in order tofind the optimal strategy . Indeed, there exists a predictable process such that

    E

    HTe

    rTRT

    0(t)dt(U)1(yHTe

    rTRT

    0(t)dt) / FSt

    = x +

    t0

    sdBs.

    In particular, with the notation

    Xt = XtH

    t exp

    rt

    t

    0(s)ds

    , we obtain

    d Xt = tdBt.Consider the strategy

    t = 1

    1 r + (2 1)Ft + (t)

    +

    t

    XtHt ert

    Rt

    0(u)du

    .

    In view of (9.9), we have

    dW,tW,

    t

    =t

    Xt

    dBt =d Xt

    Xt.

    By uniqueness arguments, we obtain Xt = W,

    t .

    9.3 Joint Law of Geometric Brownian Motion and its Integral

    Lemma 9.3. Let B be a real Brownian Motion. Let > 0 and be in R. Let G be a GeometricBrownian Motion:

    Gs = exp

    2s + Bs

    .

    20

  • 8/3/2019 Forex Modeling and Charting

    21/22

    It holds that

    P

    t0

    Gsds dy ; Gt dz

    =z1

    2ye

    22t

    2

    (1 + z2)

    22y i 2t

    2

    z

    2y

    dydz, (9.10)

    whereiy(z) :=

    ze2/4y

    y

    0

    expz cosh u u2/4y sinh u sin(u/2y)du. (9.11)

    Yor has obtained this last result in [16] (see also [5]).

    References

    [1] S. Achelis. Technical Analysis from A to Z. McGraw Hill, 2000.

    [2] M. Beibel and H. R. Lerche. A new look at optimal stopping problems related to mathematical finance.Statist. Sinica, 7(1):93108, 1997.

    [3] C. Blanchet-Scalliet, A. Diop, R. Gibson, D. Talay, and E. Tanre. Technical analysis techniques versusmathematical models: Boundaries of their validity domains. In Monte Carlo and Quasi-Monte CarloMethods 2004, H. Niederreiter and D. Talay (Eds), pages 1530. Springer-Verlag, Berlin, 2005.

    [4] C. Blanchet-Scalliet, A. Diop, R. Gibson, D. Talay, E. Tanre, and K. Kaminski. Technical analysiscompared to mathematical models based methods under misspecification. Working Paper Series 253,NCCR-FINRISK, 2005. http://www.nccr-finrisk.unizh.ch/wp/index.php?action=query&id=253.

    [5] A. N. Borodin and P. Salminen. Handbook of Brownian Motion Facts and Formulae. Probabilityand its Applications. Birkhauser Verlag, Basel, second edition, 2002.

    [6] W. Brock, J. Lakonishok, and B. LeBaron. Simple technical trading rules and the stochastic propertiesof stock returns. Journal of Finance, 47(5):17311764, 1992.

    [7] N. Jegadeesh. Discussion. Journal of Finance, 55(4):17651770, 2000.

    [8] I. Karatzas. Lectures on the Mathematics of Finance, volume 8 of CRM Monograph Series. AmericanMathematical Society, Providence, RI, 1997.

    [9] I. Karatzas. A note on Bayesian detection of change-points with an expected miss criterion. Statist.Decisions, 21(1):313, 2003.

    [10] I. Karatzas and S. E. Shreve. Methods of Mathematical Finance, volume 39 of Applications of Mathe-matics (New York). Springer-Verlag, New York, 1998.

    [11] A. W. Lo, H. Mamaysky, and J. Wang. Foundations of technical analysis: Computational algorythms,statistical inference, and empirival implementation. Journal of Finance, 55(4):17051770, 2000.

    [12] M. Martinez, S. Rubenthaler, and E. Tanre. Misspecified filtering theory applied to op-timal allocation problems in finance. Working Paper Series 278, NCCR-FINRISK, 2006.http://www.nccr-finrisk.unizh.ch/wp/index.php?action=query&id=278 (submitted to publica-tion).

    [13] R. C. Merton. Optimum consumption and portfolio rules in a continuous-time model. J. Econom.Theory, 3(4):373413, 1971.

    21

  • 8/3/2019 Forex Modeling and Charting

    22/22

    [14] A. N. Shiryaev. Quickest detection problems in the technical analysis of the financial data. In Mathemat-ical Finance Bachelier Congress, 2000 (Paris), Springer Finance, pages 487521. Springer, Berlin,2002.

    [15] R. Sullivan, A. Timmermann, and H. White. Data-snooping, technical trading rule performance, andthe bootstrap. Journal of Finance, 54(5):16471691, 1999.

    [16] M. Yor. On some exponential functionals of Brownian motion. Adv. in Appl. Probab., 24(3):509531,1992.

    22