Louis Raffestin

Foreign exchange investment rules and endogenous currency crashes

We present a model of the FX market with 3 agents: carry traders, momentum traders, and fundamentalists, where carry traders are subject to funding constraints. We show that the interac-tions between these agents provide a theoretical base for the empirical observation that exchange rates go up the stairs and down the elevator. Such microstructure eects also help explaining some important puzzles of the FX market such as the exchange rate disconnect from fundamentals and the seemingly abnormal prots to momentum and carry trading.

Introduction

Every empirical moment of the oating exchange rates seems to contain a puzzle for economists. In terms of expected values, exchange rates are related to fundamental factors only in the long run. At a shorter yet non-trivial horizon, important deviations from such fundamentals may arise and persist [START_REF] Meese | Empirical exchange rate models of the seventies: do they t out of sample[END_REF]Rogo, 1983, Faust et al. 2003). The same disconnect has long been documented in terms of volatility [START_REF] Baxter | Business cycles and the exchange rate regime. Some international evidence[END_REF], while the distribution of exchange rates also has fat tails [START_REF] Huisman | The tail-fatness of FX returns reconsidered[END_REF] and is conditionally skewed. In particular, the currencies of high interest rate countries appear subject to crashes which again do not appear linked to a clear fundamental trigger, as pointed out by [START_REF] Brunnermeier | Carry trades and currency crashes[END_REF].

A gigantic literature has focused on explaining this seemingly puzzling behavior of currency prices.

One broad approach has put forward macro-based explanations. [START_REF] Dornbusch | Expectations and exchange rate dynamics[END_REF] notably argues that exchange rate volatility is a natural consequence of fundamental volatility when uncovered interest 1 rate parity holds. [START_REF] Devereux | Exchange rate pass-through, exchange rate volatility, and exchange rate disconnect[END_REF] postulates that the exchange rate disconnect from fundamental may be due to the fact that consumer prices are relatively insensitive to changes in the nominal rates. With respect to skewness, the sudden stop literature has explained crashes in emerging country through a combination of push and pull factors.

Another strand of literature has focused more on nancial markets, arguing that frictions at the investor level may be the cause of non-fundamental price movement. This microstructure approach postulates that the rules followed by investors, the constraints they face, the structure of the markets, have a non-negligible impact on market prices. It received signicant support from [START_REF] Evans | Order ow and exchange rate dynamics[END_REF] who showed that order ow, an indicator of the net demand by customers to foreign exchange (FX) dealers, explains most of the short-to-mid term returns in the FX market, in contrast to fundamental factors. FX microstructure models have been successful in reproducing some empirical features of exchange rates (see [START_REF] King | The market microstructure approach to foreign exchange: looking back and looking forward[END_REF] for a survey). A popular approach notably explains fat tails and volatility clustering through the interactions of heterogeneous trading rules [START_REF] Frankel | Chartists, fundamentalists and the demand for dollars[END_REF][START_REF] De Grauwe | Exchange Rate Theory[END_REF][START_REF] De Grauwe | Exchange rate puzzles: a tale of switching attractors[END_REF], while other models put forward information eects [START_REF] Bacchetta | Can information heterogeneity explain the exchange rate determination puzzle?[END_REF]. However these models, to our knowledge, have been silent on the issue of currency crashes.

This study lls this gap by showing that negative (positive) skewness arises naturally for high-yield (low-yield) currencies once we account for two basic features of FX investors: heterogeneous trading rules and funding constraints. We specify a model which generates dynamics that are consistent with the empirical observation that high-yield exchange rates go up the stairs and down the elevator.

Importantly, these dynamics emerge even in the absence of fundamental shocks, consistent with the suggestion by [START_REF] Chernov | Crash risk in currency returns[END_REF] that jumps in the exchange rates result from a self exciting process.

In a nutshell, we present a model in which exchange rates move with the demand for currencies from three types of traders 1 :

-Chartists or momentum traders, who aim at identifying trends in price dynamics and tag along them.

-Fundamentalists who try to take advantage of the tendency of the exchange rate to revert to their fundamental value in the long run.

1 See [START_REF] Pojarliev | Trades of the living dead: style dierences, style persistence and performance of currency fund managers[END_REF] for evidence on the preponderance and these trading styles.

2

-Carry traders, who borrow in a low-yield currency and lend in an high-yield one, and are subject to funding constraints.

These dierent trading rules and their interactions cause deviations from fundamentals, by allowing the exchange rate to feed o itself to a certain extent. Recurrence in the exchange rate (ER) dynamics will come from two sources : 1) chartists, and to a lesser extent fundamentalists, base their expectations of future exchange rate change on the past recently observed movements; 2) past exchange rate movements impacts the capital of carry traders and thus their ability to nance new positions.

Formally this translates into a complex relationship between S t , the change in the exchange rate between time t and t+1, and its lagged values, which we study both in its deterministic and stochastic version.

We nd that currency crashes for high-yield currencies occur endogenously as follows. Slow moving capital from constrained carry traders induces a trend of appreciation in a high-yield currency, which is picked up by chartists. When this trend weakens through the inuence of fundamentals, chartists exit their long positions while fundamentalists enter the market, shorting the high yield currency. This combined selling by both agents leads to a signicant drop in the price of the currency, which in turn impacts the capital of carry traders. Since carry traders are required to hold a given proportion 1/L of their total holdings in capital, they are then forced to sell assets to comply with their constraint. These margin calls lead to currency crashes. In its stochastic version, the model yields empirical moments that are comparable to those of currency couples known to attract carry traders, such as Japanese yen versus Australian or New Zealander dollar (AUD/JPY and NZD/JPY), in terms of skewness as well as variance and kurtosis.

In this way the approach of the chapter is based on combining two established ndings of the exchange rate microstructure literature, which so far have been considered separately. First funding constraints have potential to turn an adverse shock into a crash, second heterogeneous trading rules may induce such adverse shocks in currency prices. This places this chapter at the crossroads of two strands of literature.

The rst focuses on the link between funding issues and market prices. In a general setting, Adrian and Shin (2010) study how procyclical capital requirements foster nancial cycles. [START_REF] Danielsson | Endogenous and systemic risk[END_REF] argue that funding constraints may translate into higher asset volatility, leading to endogenous risk. In the FX market in particular, [START_REF] Plantin | Carry trades, monetary policy and speculative dynamics[END_REF] argue that in the presence of high funding costs, carry trade may lead to rational speculation which causes exchange rates to depart from their fundamental value. Finally a decisive study from our perspective comes from [START_REF] Brunnermeier | Carry trades and currency crashes[END_REF] who nd a signicant link between currency crashes and the positions of leverage constrained carry traders.

The second strand is centered around heterogeneous agents, and studies the dynamics of the exchange rate that arise from the interactions of dierent types of FX investors with dierent demand functions for the currency. The approach pioneered by [START_REF] Frankel | Chartists, fundamentalists and the demand for dollars[END_REF] studied the interaction between 2 rules: chartist and fundamentalist (C&F). However in a recent paper [START_REF] Spronk | Carry trade and foreign exchange rate puzzles[END_REF] uses a similar set-up by adding carry traders. Our contribution again lies with the fact that these models produce exchange rates with distributions that are either symmetric, or whose skewness rises with interest rates, in contrast with what we observe empirically.

Our approach may be also compared to that of the C&F literature on technical grounds. A notable similarity is that our modeling implies a necessary departure from the rational expectation assumption.

We specify investment rules for our agents which correspond more to a (simplied version of the) reality of the FX market, than to the solution to a fully informed maximization problem. As in De Grauwe and Grimaldi (2006), we simply control that such rules are valid by checking their protability ex-post 2 .

Another common feature is that the model generates dynamics that may not be solved analytically, so that this study relies mostly upon simulations.

Yet there are also important dierences with the usual C&F literature. In particular models such as De Grauwe and Grimaldi (2006) generate chaotic dynamics which are dened by a strong sensitivity to initial conditions, and dierent possible paths for a given starting point. In contrast, under general conditions our model converges asymptotically towards a single point given by the fundamental value F of the exchange rate, which represents its only steady state. Our interest lies with how realistic interactions between FX investors may lead the ER to deviate from this steady state value F, and whether this deviation will die out through a crash or a smooth adjustment.

We extend the model by studying its sensitivity to dierent levels of funding constraints for carry traders, and dierent levels of activeness for chartists and fundamentalists. We nd that skewness is a non-linear function of funding constraints. When capital is very constrained no boom phase appears, and consequently no bust. When capital is little constrained the ER immediately kicks up then gradually adjust as predicted by basic nancial theory. For moderately constrained carry traders however, there is enough capital to create a build-up phase, while traders remain vulnerable to margin calls because they operate on their funding constraint. We also nd that more active trading by chartists and fundamentalists typically leads to lower currency crash risk by reducing the length and stability of the build-up phase.

Finally we investigate how our funding-driven booms and busts may help resolving two well known puzzles of the FX market: the exchange rate disconnect from fundamentals in terms of expected values, and the seemingly abnormal prots to carry and momentum trading, highlighted notably by

Menkho et al. (2012).

To investigate the disconnect, we generate 10 000 random time paths for the fundamental value F, from which we draw the corresponding 10 000 ER dynamics implied by our model. We then regress ER on F for all realizations, in order to study what type of empirical link between fundamentals and the exchange rate arise in the model. Our results are consistent with the ndings of a classic empirical study on the matter, provided by [START_REF] Mark | Exchange rates and fundamentals: evidence on long-horizon predictability[END_REF].

With respect to the prot puzzle, we uncover 1) that all strategies are protable on average and 2) the prots generated reproduce a number of stylized facts highlighted by the literature on the matter. In particular it appears accounting for carry trader leverage reduces the puzzle of carry prots, as argued by [START_REF] Darvas | Leveraged carry trade portfolios[END_REF]. Momentum trading on the other hand appears remarkably successful including during crashes, consistent with [START_REF] Menkho | Currency Momentum Strategies[END_REF].

The contributions of this study may then be summarized as follows: 1) From a theoretical standpoint, the FX market may suer from a perverse interaction between active procyclical trading rules and funding constraints; 2) A model with 3 simple trading rules and funding constraint does a good job matching the empirical features of exchange rates, notably their skewness; 3) Dynamics of booms and busts may explain other features of the FX market, notably the puzzles of the prots of the FX investors and the disconnect between the exchange rate and fundamentals. Section 2 presents the model. Section 3 calibrates it and presents the dynamics it generates. Section 4 extends the discussion.

The model

This section presents the structure of the FX market, and derives the asset demands of the FX investors.

The market

Set-up

We study a 2-country model in which a large developed country, Home, interacts with a smaller high-interest rate country, Abroad. The reader may see Home as the US, and Abroad as either a smaller developed country, or a fairly open emerging one. The exchange rate between the domestic and foreign country, expressed in terms of the value in the home currency of one foreign currency unit (FCU henceforth), will move according to the relative demand for currencies. Currency supply is thus nitely elastic as in [START_REF] Evans | Order ow and exchange rate dynamics[END_REF], which allows the ER to move with demand.

We simplify the analysis by studying only the demand for FCU from the larger Home country, implicitly assuming that the variations in the demand for both currencies by the foreign country are not suciently large to impact the exchange rate. In other words the larger Home country is a currency price maker while Abroad is a price taker. Taking an example, we assume the US dollar/ New Zealand dollar exchange rate will change only marginally in response to a rise in the demand for USD by New-Zealand, but will likely be largely impacted by a rise in the US demand for NZD. We also assume both Home and Abroad have fairly advanced nancial markets which allow satisfactory liquidity.

The demand for FCU by Home comes from two sources: real demand which represents the demand for foreign goods by Home rms and consumers, and nancial demand which comes from the demand for FCU by Home investors. The timing is as follows : demand shocks for FCU occurs at exactly time t, and have an impact on the exchange rate at t + ω, where ω may be seen as the time it takes for a dealer to execute the order and adjust his quotes if he nds evidence of excess demand. An increase in demand between t-1 and t, Q t-1 = Q t -Q t-1 , will then have an impact on the ER between t and t + 1 S t = S t+1 -S t .

Formally we choose a simple linear form for the price impact of the demand for FCU:

S t = b Q t-1 = b[ Q r,t-1 + Q f m,t-1 ] (1)
where b is the marginal impact of an additional unit of FCU demanded on the exchange rate, and Q r,t-1 and Q f m,t-1 represent the real and nancial demand shocks for the FCU between time t-1 and time t.

Real and nancial demands

We dene the real demand for FCU as the current account position of the foreign country at each period t. In appendix A we derive an simple micro based expression for this current account. Plugging this expression in equation (1) yields:

S t = λ( F -S t S t ) + b Q f m,t-1
where F is the fundamental exchange rate, which in our set-up is simply dened as the exchange rate for which trade is balanced between both countries 3 . λ is a parameter which governs to the speed of convergence between S t and its fundamental value. We set both F and λ to remain constant in order to focus on the endogenous dynamics of S t that emerge through the behavior of investors in an otherwise stable set-up.

Note that the real demand for FCU is a driver of mean reversion towards the fundamental value F.

In this way our formal specication is consistent with the literature discussed in the introduction: the exchange rate will deviate from its fundamental value F through the demand from FX investors, but return to fundamentals in the long-run. We verify that this convergence holds later in the chapter.

The nancial demand component Q f m,t-1 depends on the total net demand for FCU by all traders, which includes carry traders, momentum traders, and fundamentalists, to which we add a noise trading component. The nal form for the evolution of the exchange rate is thus:

S t = λ( F -S t S t ) + b[n c q c,t-1 + n m q m,t-1 + n f q f,t-1 ] + n,t (2)
where n stands for the number of traders of each prole, while the c, m, and f subscripts stand respectively for carry traders, momentum traders, and fundamentalists. n,t is the noise trading component, which we set to be white noise. The evolution of the ER will then depends upon the expressions for the demand of the traders q c,t-1 , q m,t-1 , q f,t-1 , which we now derive.

Summary : the exchange rate is inuenced by the real and nancial demand for a currency, where the real demand is a driver of long-term convergence towards fundamentals.

3 Other denition for fundamental value may exist, notably those based on uncovered interest parity 2.2 Carry traders

Basics

Carry traders allocate capital between a riskless home bond, which may be seen as a cash position, and a risky foreign bond. The foreign bond may be seen as a generic asset whose return and risk reect that of a diversied position in the foreign country. The balance sheet position for a carry trader in the Home currency is given by: e t = p t q t + S t p t q t

where e t is the capital (or equity) of the trader, expressed in the Home currency. p t is the price of the foreign bond in the portfolio at time t, q t the quantity held, and S t the exchange rate, expressed as the value of one FCU in terms of the home currency. The apostrophes indicate the positions taken in the domestic currency. p t q t may take a negative value, indicating that the investor is leveraged.

Normalizing the return on the domestic asset to 1, the value of the capital at the following period is given by: e t+1 = p t q t + S t p t q t (1 + R b,t )(1 + R s,t )

where R s,t = St+1 St -1 is the realized return on the exchange rate between t and t+1, and R b,t = pt+1 pt -1 is the return of the foreign bond. Because we normalize the return on the domestic bond to 1, R b,t is also the spread between both countries, and we shall refer to it in this way in what follows.

We set the return on the foreign risky asset to depend on the risk free rate of the foreign country, plus

a premium: 1 + R b,t = (1 + δ)(1 + R bf ) + b,t
, where δ is the premium, R bf is the risk-free rate abroad , and b,t is a white noise component that captures risk. As with F, we keep δ and R b constant for simplicity, in order to focus on endogenous price movements only.

Modeling

We consider a continuum of carry traders who wish to hold varying amount q * of foreign bonds, depending on their risk aversion, where we simply set this desired holdings q * to be a positive linear function of the interest rate dierential. Since this dierential will remain constant the desired quantity for each trader will be constant also. Carry trading demand shocks will thus not come come from changes in desired quantities, but from the evolution of the funding constraint.

Of course a richer form would allow the carry trader to have changing optimal quantities, by allowing their beliefs about future exchange rate movements, their expectations about the future interest rate dierential, or their risk aversion to vary. This would notably be in line with the empirical observation that factors such as the VIX or the US interest rate expectations play a huge part in the exchange rates of high interest countries. Nevertheless, the method of the study is to show how endogenous crashes occur through the interactions of our three investors even in an otherwise perfectly stable set-up, which is why we rule out shocks in to carry demand. Note though that such shocks would likely add to both the probability and the magnitude of currency crashes, as they would involve large up and down swings in the exchange rates, where down movements may be exaggerated by margin calls.

The modeling of the VaR constraint follows closely Shin (2010).

Funding constraint

Carry traders are subject to a value-at-risk (VaR) constraint, a classic risk management tool 4 which will be our vehicle for modeling the constraint. The value-at-risk is the capital loss associated with a given realization of the portfolio return, that may occur with probability α. It is used by investors to keep enough capital to face such a capital loss, and thus keep their probability of failure to α.

We relegate to appendix B the step by step derivation of the VaR, whose nal form is given by :

S t p t q °t = L.e t (5)
where S t p t q °t is the maximum holding of the foreign asset allowed by the current equity level e t , where maximum holding is expressed in the Home currency. L is a constant which may be seen as an indicator of maximum allowed leverage, since it represents a lower bound for the proportion of foreign investment nanced by equity.

This expression implies that the positions taken by carry traders, expressed in the local currency, are a positive linear function of their capital. Any capital gain made at period t will then loosen the VaR constraint and thus allow for a larger position at period t+1, which will then generate procyclicality in the model 5 . If the regulatory constraint binds for the investor, i.e. if q °t < q * , his holding of the foreign asset will simply reect the evolution of the maximum holdings of FCU allowed, which plugging equation ( 4) into ( 5) may be expressed as:

q °t = 1 + LR c,t-1 1 + R c,t-1 q °t-1 (6)
where R c,t-1 = (1 + R b,t-1 )(1 + R s,t-1 ) -1 is the total return on the carry position. The relative increase in the holdings of the foreign bond thus depends on the return on the portfolio at the previous period. Note the role of L here: a high leverage magnies the gains or the losses, and thus translate into larger uctuations in bond holdings from one period to the other.

Demand

Considering the foreign bond is issued in its own currency, the net demand for the FCU by carry traders will be given by q C,t = p t+1 (q t+1 -q t ), i.e. the net demand for fresh foreign bonds times the price of those newly purchased bonds.

With a constant expected return and variance, the price of the foreign bond will depend only on the distance to maturity of the bond. Accounting for changing bond prices clouds the model without adding a new dynamic, thus we assume for simplicity that carry trader will buy and sell bonds of fairly stable maturities. The price of the bonds sold and bought at each period is then assumed to be roughly constant:

q C,t-1 = p(q t -q t-1 ).

The net demand of FCU by carry traders is then given by: -q C,t-1 = p(q °t -q °t-1 ) = p( (C-1)Rc,t-1 1+Rc,t-1 ), if the investor is constrained at both periods.

q C,t-1 = p(q * t -q * t-1 ) = 0, if the investor is unconstrained at both periods.

q C,t-1 = p(q °t -q * t-1 ) or q C,t = p(q * t -q °t-1 ) if the constraint stops or starts binding between t-1 and t.

Summary: When the carry trader is constrained, he will demand more of the FCU at time t if the FCU has appreciated between t-1 and t.

Chartists and fundamentalists 2.3.1 Basics

For simplicity we ignore interest payments on the positions of chartists and fundamentalists, so that they only benet from the future evolution of the exchange rate S t . This assumption is designed to keep a clear separation between agents: allowing chartists to account for interest rate dierential would lead them to act partly as carry traders. Both agents are unconstrained, so that their desired holdings will always equal the actual ones, i.e. q * t = q t .

The evolution of the wealth of the investor in his own currency is given by W t = q t + q t S t , and their expected change in wealth at horizon t+T is:

E(W t+T -W t ) = q * t E(S t+T -S t )
Contrary to carry traders chartists and fundamentalists are unconstrained, thus we draw their demands from a regular unconstrained optimization. Using a classic mean-variance utility function yields the solution:

q * t = τ E( S T ) V ar( S T ) (7)
where E( S t ) = E(S t+T -S t ) is the expected change in exchange rate between t and t+T, and

V ar( S T ) the estimated variance of ER change during the period.

Both chartists and fundamentalists face a similar optimization problem, but will dier in their investment horizons. Chartists focus on the short-run exchange rate dynamics, which are driven more by the (procyclical) demands of carry traders. Fundamentalists on the other hand will have a longer horizon, and will exploit the long term tendency for ER to return to its fundamental value.

Formally since the rate of convergence towards fundamentals λ is small, the short-run dynamics of the exchange rate may be approximated by:

E( S t+1 ) E(b Q f m,t-1 ) f + (E( S t-1 )
). On the other hand over a suciently long horizon T, E(S T -S t ) = F -S t , so that price movement from order ow can be ignored. Both the short-term procyclicality and the long-run convergence to F are veried in the model.

Modeling

Before going further it is important to clarify our approach with respect to the modeling of both agents.

The key point is that we take a descriptive approach, as opposed to a normative one. The investment rules we specify for chartists and fundamentalists correspond to a (simplied version of the) behaviors that are known to exist on the markets, as documented by many market surveys such as Pojarliev and Levich (2010). This approach necessarily implies a departure from a rational expectation model, as naive investment strategies such as chartism in theory should not be protable in such a set-up.

Indeed a market in which all agents know the investment rule of the others, no investor should have to use past prices to make inference. Besides, as noted by De Grauwe et al. (1993) in a perfectly rational equilibrium there should be no exchange rate disconnect from its fundamental value.

This stance brings this study close to the chartist and fundamentalist (C&F) literature, and our demand functions resemble those of this literature. Another important similarity is that we control that our naive rules are realistic in an ex-post manner as in De Grauwe and Grimaldi (2006), by checking that they are protable over the exchange rate dynamics generated by the model itself.

Yet the comparison with the C&F literature does not go further. In the C&F literature a single agent switches between a fundamentalist rule and a chartist one, which induces chaotic movement in the ER. Chaotic system are very sensitive to initial conditions and will generate very dierent dynamics for minor changes in them. In this chapter we want to discuss the interactions between three types of traders, which is more easily done within a non-chaotic system and keeping a representative agent set-up. Thus we model chartists, fundamentalists, and carry traders as separate agents. The stability of the price dynamics that results from the model is discussed in appendix C and D.

Momentum traders

Chartists by denition use past movements to forecast future ones. We capture this by allowing them to base their estimations of the moments E( S t ) and V ar( S t ) on recent price dynamics, as well as unconditional moments which in are respectively 0 and σ 2 s . Mathematically we specify the following general form:

E m ( S t ) = (1 -α) × 0 + α( 1 x t-1 t-x S i ) = αM A( S) x V ar m ( S t ) = (1 -α)σ 2 s + αV ar( S) x
where α is the weight chartists put on recent observations compared to long-term unconditional

moments. M A( S) x = 1 x t-1 t-x
S i and V ar( S) x are the two empirical moments for S observed over these last x periods. Chartists thus use a moving average for their estimations, a tool widely used in practice [START_REF] Lui | The use of fundamental and technical analyses by foreign exchange dealers: Hong Kong evidence[END_REF]. Plugging these estimations into (7) yields:

q m,t = τ αM A( S) x (1 -α)σ 2 s + αV ar( S) x (8)
where the m subscript stands for momentum trading.

The skeptical reader may see this investment rule as an over-simplication of the behavior of chartists. It is true that in practice chartists use several moving averages and within much more complex trading strategies, notably based on moving average crossovers 6 . However, this form has two advantages for our purposes.

First there are many dierent complex chartists rules and the investment pattern of chartists as a whole is unknown. Modeling a more complex strategy then involves choosing a precise rule, which would increase the risk of an ad-hoc model. A simple feedback strategy is more general and thus less subjective. What's more, if chartists are very heterogeneous it is not clear that this simple autoregressive form is worse description of the investment of the entire chartist sector than a single more complex rule.

Second and most importantly, it is not apparent that this very naive rule undermines the results presented. On the contrary, the fact that simple rules give birth to complex dynamics may be seen as encouraging. More complex strategies based for instance, on moving average crossovers, would generate even larger non-linearities as such rules imply massive selling past certain endogenously determined thresholds. This should increase both the possibility and the magnitude of endogenous crashes. De

Grauwe and Grimaldi (2006) make a similar point.

Summary : if a currency has risen/fallen in the recent periods, chartists will be long/short q t units of it, and the more stable the rise/fall the largest the position will be.

Fundamentalists

Fundamentalists expect deviations from fundamentals to die out, so that their expected return over a suciently long horizon T is given by F -S t .

As we shall see, this belief that S t will converge to F will hold eventually so that the strategy can be seen as perfectly safe over a suciently long horizon. The risk for fundamentalists lies with the fact that this convergence to F may take a long time to occur, and may involve important losses in the short run, due to the order ow component of exchange rate dynamics which may move against fundamentals.

We allow fundamentalists to account for this risk by basing their decisions not only on the expected return F -S t they expect in a fundamentals-driven market, but also on their assessment of the likelihood that we are in such a market. This specication is in line with survey studies such as [START_REF] Dick | Exchange rate expectations of chartists and fundamentalists[END_REF], who show that FX traders consider of the current market dynamics before switching to a fundamentalist rule.

6 A crossover occurs when a moving average dened over a given time span x crosses another one with a time span y.

For instance when the 10 days moving average gets above the 50 days one.

Mathematically we set E f ( S T ) = P r(regime = f unda) t × (F -S t ). In short, this form implies that fundamentalists try to assess whether prices are currently driven by fundamentals or by order ow: they will not blindly try to enforce fundamentals if the market appears to be moving against them.

The probability of being in a fundamentals driven market P r(regime = f unda) t is estimated through the likelihood that the current price dynamics move in the same direction as fundamentals, which we estimate using a normal distribution whose rst two moments are the empirical mean and variance of the daily exchange rate movement over the last x periods.

Of course this measure is not perfect, notably due to the fact that true distribution of the daily exchange rate will not be normal. However in practice it is accurate enough to serve its purpose, which is to allow fundamentalists to make prots, while capturing the stylized fact that current price dynamics have an impact on the size of fundamentalist trading. Using alternative distribution changes little the dynamics presented below 7 .

The optimal quantity is then:

q * f,t = τ Φ(sign(F -S t ) = sign(M A( S) x )) × (F -S t ) σ 2 s (9)
where we have implicitly set V ar F ( S) = σ s , i.e. fundamentalists use the unconditional variance.

Summary : Fundamentalists will go long/short if the currency should appreciate/depreciate according to fundamentals, and the magnitude of their position will depend on how whether prices are currently moving towards fundamentals.

Baseline dynamics

The last section specied a model in which the demand functions for traders and consumers generate a complex relationship between exchange rate movements and their lagged values. We now present the dynamics arising from this set-up.

Before proceeding, an issue that deserves investigation is the stability of a system with such numerous and non-linear recurrences. In appendix C and D we show that the exchange rate S t process converges asymptotically towards a constant expected value and variance under fairly general conditions.

7 Simulations using alternative distributions are available on request [START_REF] Dornbusch | Expectations and exchange rate dynamics[END_REF] 3.1 Calibration

Exogenous parameters

We specify 10 carry traders, with a similar capital at the beginning of the period, but with varying desired holdings, i.e. q * ∈ [START_REF] Adrian | Liquidity and leverage[END_REF][START_REF] De Grauwe | Exchange Rate Theory[END_REF]. This fairly low value of 10 was chosen because changing the number of carry traders has a trivial impact on the results as long as the total capital by carry traders stays the same, only more trader makes the simulations lengthier. Since carry traders have dierent desired holdings, at each period some will be constrained, i.e. have desired holdings q * above their maximum allowed holdings q • , while others will not. The proportion of constrained carry traders at each period t is noted ϕ t .

The initial exchange rate is normalized to 1, where the ER is expressed in terms of the number of units of domestic currency that one unit of FCU buys. Our time unit is a day. We chose to focus on the dynamics that emerge from a rise of the interest spread from 4% to 6% annually. A dierential of 6% is in line with some of the known historical carry couples such as YEN/NZD. The previous value of 4% was chosen because it implies a rise in the desired quantities by carry traders of 50%, which seems consistent with some important historical episodes of capital ow. The daily rate implied by an annual 6% is R B ≈ 0, 00019.

With respect to fundamentalists and chartists, we normalize the coecient of absolute risk aversion τ to 1, and allow the variances σ 2 s and σ 2

Rs to be dened by their empirical counterparts in the simulation 8 . We initially set x, the number of past periods they use to forge their estimation, to 30.

Thus investors base their estimations on their observations over the last month. However we later present the results with a alternative values for x to study how more active (passive) investors impact the results.

We turn to λ and α , which represent respectively the speed of convergence towards fundamentals and the weight of the recent observations in the estimations by chartists, compared to unconditional moments. As mentioned exchange rate converge only in the long run, so that a low value for λ is warranted. We set λ = 0.0005. With respect to α, the nature of chartists is to act upon recently observed dynamics, we thus settle for a high value α = 0.9. 9 8 Note that this implies these parameters solves a xed point problem because the variances σ 2 s and σ 2

Rs are both inputs and outputs of the model : they impact the demand of investors and through them the ER dynamics, and thus the the realized variances. Thus the statement we allow the variances σ 2 s and σ 2

Rs to be dened by their empirical counterparts should be understood as we pick values for σ 2 s and σ 2

Rs which provide a good approximation to the solution of the xed point problem. 9 The reader may wonder why a value of α = 1 was not chosen. The reason is that we set the ER to be constant and equal to F because the rise in interest occurs.α = 1 has the undesirable feature of implying a 0 variance at the start of With respect to the price impact of an additional unit of demand b, we use the study on order ow by [START_REF] Lyons | Tests of microstructural hypotheses in the foreign exchange market[END_REF], who nds that a FX dealer would raise his quotes by 0.01 Deutschemark (DEM) for incoming orders worth $1 billion. We thus set b = 0.01.

Maximum leverage

The key parameter is L, the maximum leverage allowed in the VaR constraint, which we loosely see as an indicator of how constrained carry capital is. Unfortunately there is surprisingly little data on carry trader leverage. We thus resort to discussion.

On one hand the FX market appears to be hosting highly leveraged investors. Anecdotal evidence, such as press articles or discussions with traders, points to leverage being a major concern amongst practitioners. Some dealers oer leverage factors of up to 1:50. Academic research also suggests that some of the features of the FX market can only be explained through non negligible levels of leverage for carry traders [START_REF] Darvas | Leveraged carry trade portfolios[END_REF].

On the other hand, the FX market is dominated by bank and near-banks institution, who likely are very exposed to the capital constraints from the Basel agreements. Adrian and Shin (2010) for instance mention that the 1996 Market Risk Amendment of the Basel capital accord limits the regulatory capital is 3 times the 10 day, 99% Value-at-Risk for investment banks. We expect such a constraint at the bank level should extend to its FX trading desk. Even without considering Basel, VaR are often used internally for risk management, and it seems unlikely that a major institutional investor would allow a given trading desk to take on too much risk through leverage. Another limiting factor is that we use a wide denition of carry trading in this chapter, which includes portfolio investors who buy assets denominated in the foreign currency. These investors are likely to have a leverage factor much below 1:50.

Thus we chose to present results for a leverage factor of 1 to 10, in order to study the impact of L across all values that we believe represent a possible value for the average carry trade position.

Model-driven parameters

this weight is too large for a given investor, the price dynamics become driven by this trader only. If carry traders have too large a capital available they will kick up the ER instantly following a rise in the interest spread. A model in which momentum traders dominate will simply produces large price spikes and drops around F, as chartists rally and exit in response to minor price events. Finally if we allow fundamentalists to be dominant, prices immediately converge towards F, or the system will diverge.

The sensitivity of the model to the weighs attributed to each agent is an unfortunate consequence of our use of a representative agent model [START_REF] Kirman | Whom or what does the representative individual represent?[END_REF]. When one trader dominates 1) the intuition that the interaction between agents play a part in skewness cannot be investigated 2) the two other traders typically lose money, which makes the model unrealistic. We thus chose to focus only the interesting cases in which all agents interact, restricting the parameter set to values in which all 3 agents make prots. In the following baseline simulation we set n F = 0.01,n M = 0.05, and ϕ = 0.8, values for which the model produces representative dynamics of the parameter sets in which all 3 agents coexists.

The reader may nd the list of parameter values in appendix E.

Deterministic dynamics

To better understand the endogenous dynamics generated by the model, we start by presenting the deterministic model, i.e. the dynamics that emerge in the complete absence of exogenous shocks besides the initial interest rate rise to 6%. Formally we set b,t and n,t , the shocks on the return of the foreign bond and the demand by noise traders, to zero.

Short-term dynamics

To ease the presentation, we chose to start with the study short-term dynamics. Figure 3.3.1 plots the dynamics that emerge in the most revealing case L=4, but the dynamics for the other values for L will be presented in the following section.

We see that the exchange rate seems to be rising along a long-term trend of appreciation (dotted line) but faces increasingly large downward shifts. The importance of the currency crash, both in terms of total fall and rapidity, appears to be an increasing function of the magnitude and length of the build-up phase that precedes it. The combined trading of both leads the exchange rate to fall, incurring losses to the leveraged carry traders. In reaction, carry traders will be forced to reduce the foreign exposure to satisfy their funding constraint, causing the crash.

In the early stages, both chartists and carry traders have fairly small positions in the FCU. Consequently the exit by chartist leads to a moderate fall, and this fall is little magnied. However as the positions grow larger carry traders react with increasing strength to increasingly adverse shocks.

To get the full glimpse of the role of each agent in the unfolding of the crash, gure 3.3.2 plots the ER around the last and largest crash, along with the quantities demand by all agents, and the proportion of constrained carry traders in the economy.

The timing appears clearly: just before the crash chartists start reducing their exposures, while Figure 2: Actions of market participants around the crash fundamentalists take increase their short selling. These changes are relatively smooth until t=4. Nevertheless it is enough to further slow the trend down, leading to a more signicant selling at t=4, notably by fundamentalists who are starting to forge the belief that gravity is about to prevail. This selling leads to a notable price drop between t=4 and t=5. This is when margin calls start kicking in, which can be seen through the evolution of the share of constrained carry traders. At t=5, 50% of the carry traders are constrained, i.e. have holdings that are below their desired ones. At t=5 these investors must liquidate positions to comply with their constraint, which along with further selling by chartists and fundamentalists leads to another sharp fall in the ER between t=5 and t=6. The fall wipes out carry capital, so that new investors become constrained at t=6. A vicious cycle then begins, in which carry traders are forced to close down positions, which leads to further losses, and so on. The proportion of carry traders hit by margin calls steadily rises to 80%.

Thus crashes can occur endogenously without a fundamental trigger, through a perverse interaction between active trend chasing strategies and highly leveraged investors.

Long-term dynamics

We now present all the cases, with a longer term perspective. We see that funding constraints have a double impact: one lies with the emergence of shorter run cycles and the other with the overall long term behavior of the ER. We discuss each level separately to outline the non-linear impact of funding liquidity.

L=1. The ER initially kicks up before depreciating, but this initial rise is very modest. The reason is that in this case capital is very constrained, so that 1) carry traders are limited in their ability to move capital immediately and 2) in their capacity to nance new positions. Thus carry traders are immediately dominated by fundamentals and fundamentalists, no upward trend is implemented.

L=2. As carry capital is less constrained, carry traders take increasingly large positions, driving the ER upwards. Nevertheless this trend of appreciation is very gentle: carry traders remain strongly constrained so that they do not have the capacity to move capital as quickly as they wish to. The trend carries on in similar fashion until around t=10 000, not plotted here, at which point the ER starts converging back 10 to its fundamental value of F = 1.

L=3 also yields an upward trend, more pronounced because more leveraged carry traders are able to demand more FCU more quickly. The pattern of shorter-term cycles of appreciation/ depreciation start emerging. The reason is that the more vigorous appreciation has lead chartists to take larger long positions, which they then exit. Carry traders are also getting more leveraged so that price drops start translating into larger wealth eects. The skewness of S t turns negative, at -2.16. However in this case the short-term ER drops are not large enough to hamper the long-term appreciation trend.

L=4 gives the clearest up the stairs down the elevator pattern, discussed in the previous section.

Most importantly the currency crashes are now suciently large to prevent carry traders from implementing a true sustainable trend of appreciation. In this way leverage has a counter counter-intuitive eect: even though capital moves more freely, it does not lead to a quicker price adjustment. Skewness falls to -5.07.

L=5 produces similar dynamics, only with even steeper rises in the price of the currency as capital ows more easily. Skewness in this case is -4.19.

Another interesting feature of cases L=4 and L=5 is the fact that following the last and largest crash, a new cycle of appreciation and falls, similar to the previous one, starts. The explanation for such metacycles lies with carry capital. Each metacyle is dened by a succession of appreciation phases, and crashes. When crashes occur they inict losses to carry traders, but these losses are initially not sucient to wipe out the gains made during the appreciation phase. Thus carry traders start each new appreciation phase with more capital, which explain their increasing strength. The last crash however has a more drastic impact on the capital of carry trader, and thus on their demand for the FCU at subsequent periods, which ends the metacycle.

Finally in L=6 the funding constraint has enough slack to allow carry traders to move to their desired holdings nearly instantly, leading to a large and immediate appreciation. After this, fundamentals prevail and a slow depreciation sets in. Currency crashes disappear because carry traders are 10 Of course this long period of appreciation results from the fact that we keep all parameters constant and set all shocks to 0 here. In practice over such a long period there should be a change in fundamentals or in the interest rate which would change the dynamics, before the ER has adjusted.

close to unconstrained, so that they have enough capital to deal with moderate drops in the exchange rate.

This case produces the dynamics that are expected in a perfectly ecient market. Indeed two conditions for eciency coexist: 1) the demand for an asset immediately rises in response to an increase in its return 2) the subsequent evolution of the exchange rate reects fundamentals. Levels L=7 to L=10, not plotted, yields dynamics that are very similar to L=6 , as expected since capital is even less constrained for such levels.

Thus funding constraints have a non-linear impact on the likelihood of a currency crash. Low levels of allowed leverage constitute a guarantee against crashes as they limit the wealth eects faced by agents, but these levels have the undesirable feature of restraining the ability of capital to move quickly, which may have costly impacts on the real economy. High levels of leverage are the most desirable allocation in theory, as they ensure both liquid markets and a stronger resilience to shocks.

Finally intermediate levels of leverage may be quite dangerous from tail-risk perspective, because they allow traders to take large positions while exposing them strongly to margin calls.

Stochastic dynamics and the empirical performance of the model

We take a look at the empirical performance of the model. To do so we release the constraint that b,t and n,t , are zero in order to study its stochastic properties. Both shocks are modeled as idd normally distributed shocks, of variances of 1.85 × 10 -5 and 2.5 × 10 -5 respectively. These values were chosen because they induce a level of volatility consistent with the data, nevertheless the sensibility of this performance to the choice of the variances is very moderate. We employ a Monte Carlo method, simulating the model as specied above 10 000 times to draw the asymptotic properties of S t .

Table 1 compares the model-driven moments of the daily exchange rate movement to those of 2 well known carry-trade currency couples, AUD/JPY and NZD/JPY. The mean is not included as it is zero by construction in our set-up, since in the long term the evolution of the exchange rate is given by the fundamental value F which is set constant and equal to S 0 , the exchange rate at the start of the period. Out of the same desire to control for fundamentals, we report the moments for AUD/JPY and NZD/JPY over the period 2000-2007 period. During this period interest rate dierential Australia/New Zealand and Japan staid fairly constant around 6% 11 , and no major exogenous shock hit the FX market. Several phases of build-up emerge, with three episodes apparently materializing into currency crashes.

For comparison purposes we also provide in the right-hand side a plot of the detrended AUD/JPY exchange rate, which conrms that comparable dynamics emerge. We conclude that a model which endogenously generates booms and busts does a good job at matching exchange rate daily data. However two points should be noted:

-First funding issues may not be the sole explanation for up the stairs down the elevator pattern.

Other factors may add to this dynamic, notably pro-cyclical risk aversion. Indeed carry traders may feel growingly condent about investing abroad as more and more investor do it and the benets accumulate, but this condence quickly evaporates as the rst losses appear.

-Second, at the weekly or monthly frequency, the simulations sometimes yield deviations from fundamentals which appear slightly too large and rapid. This is likely due to our modeling of the VaR constraint and chartists, which entails a direct positive interaction between capital gains at t-1 and quantities demanded at t during the boom phase. In reality some autocorrelation must be present in the exchange rate, otherwise momentum trading would not be protable, but the relationship between exchange rate changes and their lagged values is likely to be much more complex and hard to gather in a single model.

4 Digging deeper

Prots

We rst consider prots from a robustness check perspective, as losses would imply that we have specied unrealistic investment rules for our traders. We plot in appendix F the accumulated prots for each trading sector and all values of L. All investment rules make money over the long-run, and in the vast majority of the cases it takes little time for them to become protable.

Zooming in on our preferred case L=4, we nd that the prots generated by our model contain interesting patterns. We discuss how these t with empirical ndings of the existing literature on prots in the FX market. Unfortunately there is very little research on the performance of fundamentalists, likely due to the fact that designing a fundamentalist strategy requires an estimation of the fundamental exchange rate F, which will always be subject to controversy. We thus chose not to include them in the discussion. Figure 3.4.1 presents the total accumulated prots for both sectors. As an indicator of scale these accumulated earnings may be compared to the desired holdings of the carry trades q * ∈ [1, 10].

The level of prots per se cannot directly be compared, because in the model the wealth invested to get these prots varies hugely across agents and periods. We can only say that both strategies are protable. A more interesting discussion lies with the variance of these prots and their resilience to shocks. This variance is much higher for carry trading. In particular the total prot of carry traders This negative skewness has deep implications for the issue of the excess returns of carry trading.

Indeed if carry traders face an important crash risk, the return they earn may no longer be seen as abnormal, but rather as legitimate compensation. A large literature has investigated whether crash risk is sucient to explain carry returns, with mixed result [START_REF] Burnside | Carry trade : the gains of diversication[END_REF]. However as noted by [START_REF] Darvas | Leveraged carry trade portfolios[END_REF] , these papers usually studied an unleveraged carry trade strategy, a crucial omission since leverage has a multiplicative eect on tail risk. Accounting for it, [START_REF] Darvas | Leveraged carry trade portfolios[END_REF] nds that skewness appears sucient to justify carry return. Our model thus supports this view.

The prots from chartism on the other hand have a much lower variance, and no apparent crash risk. This feature appears in line with the literature on the performance of momentum trading in the FX market, both in terms of performance and strong resiliency to crashes (e.g [START_REF] Burnside | Carry trade : the gains of diversication[END_REF]. In our set-up this comes from the fact that chartists move from long to short positions before the lion's share of the adjustment occurs. Thus chartism and carry trading are negatively correlated during crashes, which is consistent with the empirical ndings of [START_REF] Menkho | Currency Momentum Strategies[END_REF]. In this way our set-up may help providing an explanation to the abnormal prots from carry trading, but not to those from momentum trading.

The same patterns arise in the stochastic L=4 version of the model. All three rules are protable on average. In order to compare our results to the existing literature, we study the performance of naive momentum and carry trading strategies per annum. The reader may look at appendix G for a description of the method used.

We obtain returns that are somewhat too high compared to the empirical literature for both agents, notably for momentum traders who earn a staggering 30.91 % p.a.. This is likely due to our strong auto-correlation in daily returns, which makes momentum very protable. Carry traders also earn large returns, but these are largely oset by the important risk they face. With L=4 we obtain a Sharpe ratio of 0.78 for momentum traders and 0.35 for carry traders. These values are consistent with the literature on momentum prots (e.g. [START_REF] Menkho | Currency Momentum Strategies[END_REF], but noticeably lower than the 0.54 found by [START_REF] Burnside | Carry trade : the gains of diversication[END_REF] for carry trading over single currency pairs, which adds to the impression that accounting for leverage reduces the puzzle of carry trade returns.

The ability of the model to replicate stylized fact about the prots of chartist and carry trader may

Active/passive chartists and fundamentalists

We investigate how the dynamics of the model respond to more or less active trading by chartists and fundamentalists. Activeness is measured through the number x of periods both investors go back to when forecasting future prices. A lower x means larger daily changes in holdings by both agents, as shorter-term price dynamics are more volatile. A higher x should have the opposite eect, as a strategy based on longer price dynamics should be more stable. First we note that only one case involves a real change in the pattern of booms and busts: more active momentum traders. The reason is that when chartists are more active, they are quicker to exit their long positions, which makes a consistent trend of appreciation dicult to implement. This option thus seems desirable from a tail risk perspective. Yet it also prevents the carry traders from kicking up the exchange rate, which should happen in an ecient market. The distribution of S in this case is nearly symmetric, skewness is 0.02.

In all the other cases the overall dynamics do not change drastically. Allowing fundamentalists to be more active in their chase for mean reversion simply reduces the magnitude of the appreciation phase, which lowers the size of the currency crashes. On the other hand more active fundamentalists also means that daily negative demand shocks can be larger. Overall both eects seem to cancel each other out, skewness is -5.17, comparable to the x=30 case.

When agents have a longer perspective, i.e x=60, the same two eects are at play in the opposite direction. On one hand the build-up phases are larger in magnitude as the positions of chartists (fundamentalists) are consistently more long (less short). On the other hand a more passive strategy also means less drastic reactions to adverse price movements. For both cases this latter eect seems to dominate. Skewness is -3.72 and -3.95 for more passive chartists and fundamentalists respectively, which represents a notable improvement compared to the value of -5.07 in the x=30 case.

Thus the activeness of chartists has a non-linear impact on skewness, similar to funding constraints.

Intermediate levels of activeness are suciently stable to create long build-up phases, and suciently volatile to trigger large daily drops in demand. For fundamentalists the impact of more active trading is not as clear for low values of x, but it seems past a certain point a more passive approach also reduces crash risk. We investigate whether the model is capable of reproducing some empirical features of disconnect between exchange rate and fundamentals. Long run convergence with fundamentals is a built-in feature in our set-up, so that nding a signicant relationship over a suciently long horizon is natural. A more interesting question lies with whether the patterns of this convergence are in line with the empirical ndings on the matter for our set of parameters.

Conclusion

Previous research has highlighted that heterogeneous FX investors may be a vector of excess volatility in exchange rates, and that constrained carry traders play a part in currency crashes. The main lesson of this chapter is that both variables should be considered together, as their interaction is a potential source of currency risk.

The model provides an explanation for the appearance of seemingly inexplicable falls in exchange rates. The dynamics produced are also consistent with other empirical features of exchange rates such as excess volatility and fat tails. Finally the model helps explaining puzzles such as the prots to carry trading and the exchange rate disconnect.

The emergence of large capital inows which are quick to evaporate has been a major policy concern, notably for emerging economies who have suered from sudden stops since adopting oating currencies. Our model suggests that such stops are at least partly of endogenous nature, which may provide an extra rationale for the implementation of capital controls, as it implies even sound macroeconomic may not be sucient to prevent crashes.

A deeper understanding of microstructure eects in large developed countries may nonetheless allow for ner forms of regulation. For instance in our model endogenous crashes occur within a certain context: high interest rate dierential and/or easy access to funding in the Home country. A small interest rate dierential or a tight liquidity in the developed world should thus act as natural obstacles to the arrival of speculative capital in emerging countries. These countries may then consider hardening/ loosening capital controls on all assets according to these two variables, rather than applying controls to certain assets or industries which are deemed speculative.

Yet it appears a rst and crucial step for an ecient regulation would be to increase the availability of data on the positions taken at the trader/trading desk level, so that researchers may have a more precise idea of the impact of market microstructure on currency risk.

Consider that Home and Abroad each produce a single good, and both goods have a moderate degree of dierentiation. Let the representative consumer 12 of the home country have following general utility function:

U t = q α t q β t where q and q are the quantities demanded of the home and foreign good respectively, while α and β are preference parameters. The consumer faces the following budget constraint, expressed in the local currency:

W t = p t q t + p t q t where W t is the consumer wealth at time t, p and p' are the prices of the foreign and domestic good respectively. Assuming perfect competition in both countries, rms are price-takers in their local currencies, we have p t = M C and p t = M C × S t . The price of the domestic asset at home is the marginal cost of producing for home rms in their own currency, while the price of the foreign good at home is the marginal cost of production in the foreign currency expressed in the local one.

For simplicity we assume all fundamentals characteristics of both economies stay constant, an assumption also made and discussed in the body of the thesis. Here this means setting MC, MC' and W constant.

Maximizing yields the textbook demand functions for both goods, expressed in units of the home currency.

p q = α α+β W and p

t q t = M C × S t × q t = β α + β W (A.1)
The value of the exports for the foreign country is the home demand for foreign goods denominated in the foreign currency X t = ptqt St = M C×St×qt St = M C × q t . Assuming as in the body of the thesis that the foreign country is small, so that we may ignore the variations in the imports of the foreign country from home, the current account of the foreign country at time t can then be expressed as:

CA t = X t -M = M C × q t -M
This expression represent the real net demand for FCU between t and t+1. Plugging in equation (A.1), we obtain CA t = A St -M , where A = β α+β W . Noting F the fundamental exchange rate for which trade is balanced i.e. CA * = A F -M = 0, we may re-expressed this current account as:

In this appendix we determine the conditions under which the exchange rate process will be stationary in its rst moment.

m,t = τ αM A( S)x (1-α)σ 2 s +αV ar( S)x ) = αM A(cst)x (1-α)σ 2
s +αcst = cst, which yields lim t→∞ q m,t = 0 and lim t→∞ t 0 qm,t t = 0 i.e. the average demand shock by chartists at each period tends to 0. The second case also implies lim t→∞ q m,t = 0 because when the movements in the exchange rate are increasingly large, the variance of S t increases more rapidly than S t itself.

Thus it appears that lim t→∞ t 0 St t > 0 implies lim t→∞ t 0 qm,t t = 0. In words there are no condition under which chartists will carry on buying FCU ad nauseam. Either the trend of appreciation is stable in which case chartists should have stable holdings, or the sequence S t is explosive in which case chartists are eventually turned o by the innite variance that should also exist in this case.

Let us now consider the demand by carry traders. An immediate observation is that regardless of the evolution of S t , the quantity held by carry traders q c,t must lie somewhere between their desired holdings q * and 0, where the former corresponds to a situation in which the carry trader has innite capital, and the latter to a situation in which he has none. Since q c,t is bounded, the sum of all changes in holdings must also be bounded, so that lim t→∞ t 0 qc,t t = 0. Now let us consider the impact of an ever increasing exchange rate on the demand by fundamentalists and the real demand by consumers. lim t→∞ t 0 St t = +∞ yields lim t→∞ S t = +∞ which in turn implies that lim t→∞ F -S t = -∞. Since the demands by consumers and fundamentalists are a positive function of F -S t , we must then have lim t→∞ t 0 q f,t t ≤ 0 and lim t→∞ t 0 Qr,t t ≤ 0

. In other words when the exchange rate in increasing on average, the positions of consumers and fundamentalists are negative on average. Equation ( 2) may be re-expressed as follows: must be zero since n,t has a symmetric distribution. Since the rst four limits are also below or equal to zero, it follows from the expression above that lim t→∞ t 0 St t 0, which violates our initial assumption lim t→∞ t 0 St t > 0. Thus there exists no parameters for the exchange rate is ever increasing . There exists a threshold value for S past which all demands are either negative or constant. The exchange rate must then lie somewhere below this value.

A similar proof holds for an ever decreasing ER. Carry traders remain bounded, while the same logic works in the opposite direction for other three sources of demand. Thus we may not have lim t→∞ t 0 St t < 0 , any drop in the exchange rate below/above F is bound to be compensated by a rise/drop in the exchange rate at subsequent periods. Thus S t has a lower and an upper bound, so that we must have lim t→∞ E(S t ) = cst, S t must be stationary in mean.

Appendix D

Let us now move to the study of the stationarity of the variance. We use a method similar to appendix B, starting from the hypothesis that the variance is non-stationary, i.e. lim t→∞ var(S t ) = ∞. Let us consider this is true. An immediate observation is that in such a case we have lim t→∞ q m,t = τ αM A( S)x (1-α)σ 2 s +αV ar( S)x = 0, the demand by chartists must converge to zero, so that lim t→∞ var(q m,t ) = 0. Similarly the demand shocks by carry traders are bounded, which implies lim t→∞ var(q c,t ) = cst Since var(S t ) = E(S 2 t ) -E(S t ) 2 , and E(S T ) 2 must be a constant as the process is stationary in its rst moment, we have lim t→∞ var(S t ) = lim t→∞ E(S 2 T ) = ∞ which then implies that lim t→∞ S t = ±∞. Re-expressing the real demand for FCU as Q r,t = λ( F St -1), it follows that lim t→∞ Q r,t = 0, so that the asymptotic innite variance lim t→∞ var(S t ) = ∞ may not come from Q r,t either.

We may rewrite equation (2) as follows:

S t = bn f q f,t-1 + c,t + r,t + m,t + n,t where c,t , r,t , and m,t are the demand shocks from carry traders, consumers and chartists. For our purposes these shocks may be considered simultaneously because we only require that they have nite variance. Plugging in the expression for q f,t- In what follows we focus on the parameter set for which this condition is satised because the economic story behind non-stationary cases is limited in length and interest. Note that the exchange rate with only one steady-state is a major technical dierence between this study and the C&F literature, which generates chaotic dynamics which are sensitive to initial conditions. the papers on FX prots, yet it involves a departure from the investment behavior we have specied in the model for both agents.

Indeed in our set-up, chartists change their exposure daily, and these exposures are unconstrained.

This means that the wealth invested at time t+1 is independent of the wealth owned at time t, so that the ratio Wt W0 may not be viewed as an indicator of the yearly performance of the representative chartist. Similarly the complete reinvestment of equity is not in line with carry traders when they are unconstrained, i.e. when their current holdings may not reect their capital. Therefore these indicators can viewed as a broad estimate of the protability of momentum trading and carry trade, comparable with that of other studies, but not as a perfect indicator of the return of the representative agents in the model.

Studying the evolution of the wealth of chartists also requires assumptions about their leverage, and how much capital is consumed by short selling. In line with the literature we assume no leverage, and that short selling is as capital intensive as buying, i.e. chartists must hold 100% of amount they short sell.

Figure 1 :

 1 Figure 1: Short-term endogenous cycles of the ER with C=4

Figure 3 . 3 .

 33 3 plots the dierent dynamics that emerge in the 10 years following our initial rise in interest rate.

Figure 3 :

 3 Figure 3: Dynamics for varying levels of funding constraint

  the 2 carry couples in terms of daily variance, skewness and kurtosis. L=4, the most interesting case in the previous section, yields estimates which are qualitatively satisfying, though a bit too small in magnitude. Specifying a slightly less binding funding constraint, L=4.5, gives the model a good t. The left-hand side diagram in gure 3.3.4 plots a representative case.

Figure 4 :

 4 Figure 4: Simulation of the stochastic model with C=4, compared to detrended ER AUD/YEN

Figure 5 :

 5 Figure 5: C=4, Carry and momentum prots

Figure 6 :

 6 Figure 6: C=4 dynamics with varying investment horizons by chartists and fundamentalists

Figure 3 . 4 .

 34 Figure 3.4.2 presents the ER dynamics specifying x=10 and x=60 for both agents. We include the baseline scenario x=30 for comparison purposes.

Figure 7 :

 7 Figure 7: C=4 dynamics with varying investment horizons by chartists and fundamentalists

f τ σ 2 s| < 1 f τ σ 2 s| < 1

 2121 Assigning to A t and B t their maximum value by setting the time-varying numerator to its maximum value of 1 gives | bn for both conditions. Therefore | bn is sucient to ensure that the system converges in terms of rst and second moments. This condition has a limited economic meaning. It only represents a bound for the weight of fundamentalists, which are the only agent which can introduce stochastic divergence in the system.

Table 2

 2 presents the realized skewness from Monte Carlo simulations in the L=4 case, for our

	dierent levels of x.
	skewness	x=10	x=30	x=60
	chartists	-0.27	-0.32	-0.29
	fundamentalists	-0.58	-0.32	-0.22
	This table conrms that more passive trading by both agents lowers currency risk, while the impact
	for more active trading diers for both agents. For chartists moving to x=10 brings a moderate fall in
	realized skewness. However for fundamentalists it seems more active trading fosters crash risk in the
	stochastic version.
	4.3 Can endogenous booms and busts explain the exchange rate discon-
	nect?

  Stationarity in the rst moment implies lim t→∞ E(S t ) = cst which must hold if the average exchange rate change tends to zero, i.e. if lim t→∞ The rst case implies lim t→∞ q

						t 0	t	St	= 0. We show this condition must hold
	using a reductio ad absurdum, starting with the opposite postulate lim t→∞	t 0	t	St	> 0, i.e. the
	expected exchange rate is ever increasing.
	Let us rst consider the impact of this condition on the demand by chartists. There are two
	possibilities for lim t→∞	t 0	t	St	> 0 to hold. Either the expected change in exchange rate tends
	towards a positive constant i.e. lim t→∞	t 0	t	St	= cst where cst > 0, or this change is ever in-
	creasing lim t→∞	t 0	t	St	= +∞.

  1 yields S t = A t (F -S t-1 ) -B t S t-1 + t where A t = bn f τ Φt-Φt-1 , with Φ t the probability evaluated by fundamentalists that fundamentals dominate the market. t = c,t + r,t + m,t + n,t is the total shock at period t with var( T,t ) = cst. . The stochastic process thus has two components besides the shock, a mean-reversion one A t (F -S t-1 ) and a recurrence one B t S t-1 .A full investigation of the conditions for explosiveness of this sequence would imply studying how both components interact, which is outside the scope of this study. Here we simply note that a sucient condition for the convergence of a simple recurrence systemS t = B t S t-1 + t is that |B t | < 1, ∀t,while a sucient condition for convergence of a mean reverting process S t = A t (F -S t-1 ) + t is|A t | < 1, ∀t.

	σ 2	s	and B t = bn f τ Φt σ 2 s

A notable dierence from a technical perspective is that our dynamics are not chaotic as our set-up the exchange rate will always converge its fundamental value.

[START_REF] Adrian | Liquidity and leverage[END_REF] provide evidence on the wide spread use of VaR across markets. This use may in fact be particularly important in the FX market, in which banks and near-bank institutions are prominent (see for instance[START_REF] Galati | Why has FX trading surged? Explaining the 2004 triennial survey[END_REF]

Note that further procyclicality may arise if we allowed L itself to vary, indicating than the capital requirements are procyclical[START_REF] Adrian | Procyclical leverage and value-at-risk[END_REF]. However for conciseness we keep only one engine of procyclicality

parameters remain to be dened: the proportion of carry traders initially constrained ϕ, and the number of fundamentalists and momentum traders n F and n M . These parameters indirectly indicate the weight of each trader in total turnover. In our set-up, if the period

[START_REF] Brunnermeier | Carry trades and currency crashes[END_REF].38% dierential with Australia and 6.53% with New Zealand, 5.96% averaged over both countries. Annualized short rates obtained from the OECD.

We only consider consumers in order not to overload the model. In practice this demand may also come from rms, but this demand should have a comparable form.

set of fundamental variables on the exchange rate at varying horizons. In a nutshell, this author runs two regressions of the exchange rates for 4 developed countries against the US dollar (Canada, Germany, Japan and Switzerland). The rst regression is based on a simple random walk model, the second is based on a set of fundamental variables. Mark then uses the regression results to draw the predicted out-of-sample exchange rate for both models, at horizons of 1,4,8,12, and 16 quarters.

He then compares the performance of the random walk model and the fundamentals-based one, by comparing their root-mean-square error (RMSE), i.e. the sum of the squared dierences between predicted values and actual ones.

We run a similar analysis. We rst run a Monte-Carlo experiment which generates 10 000 random walks which be our vector of fundamental values, where each vector has a length of 10 years. We generate the corresponding 10 000 exchange rates vectors over 10 years. We then split the sample in half. In the rst half we estimate a regression of the ER over the fundamental values. In the second we use the regression results to draw predicted values at the same horizons as Mark. Similarly we draw the predicted values from a random walk model. We then compare both RMSEs, by taking the ratio of the RMSE of the fundamentals-based regression over that of a simple random walk, Figure 3.4.3 plots this ratio for our model, compared to that obtained by [START_REF] Mark | Exchange rates and fundamentals: evidence on long-horizon predictability[END_REF]. We show his results for all the countries in his sample, and those excluding Canada who appears to be an outlier in his paper. Note that a high RMSE indicates a poor forecasting performance, so that a ratio above one, for instance, indicates that the fundamentals-based model is a worse predictor of future exchange rates than a random walk.

We see that the model generates a forecasting power for fundamentals that is comparable to the empirical study of [START_REF] Mark | Exchange rates and fundamentals: evidence on long-horizon predictability[END_REF]. In terms of levels rst, the performance of the fundamentals-based regression dominates that of the random walk by a similar order of magnitude. In terms of evolution, we see that this dominance increases as the horizon widens in both cases, i.e. fundamentals have a better forecasting power as the horizon for prediction rises.

Nevertheless a dierence is that the largest gain in terms of explanatory power occurs earlier in our set-up. In other words in [START_REF] Mark | Exchange rates and fundamentals: evidence on long-horizon predictability[END_REF] the main increase in the performance of fundamentals occurs when we move from a 12 to a 16 quarters horizon. For the exchange rate generated by our model on the other hand, the predictability increases more when we move from 1 to 4 quarters.

The evolution of the exchange rate may then be expressed as

Appendix B

The value at risk (VaR) gives the capital loss associated with a given realization of the portfolio return R c,t , that may occur with probability α. Risk managers chose a threshold value for α, noted α, and require that investors hold enough capital to cover the losses associated with the corresponding return Rc,t . If the realized return is below Rc,t , which occurs with probability α, then the investor does have enough to face his losses and is eectively bankrupt. Through the VaR constraint risk manager then eectively set a maximum probability of bankruptcy α.

The investor is bankrupt if all of his capital, or more, has been lost. Mathematically, the bankruptcy condition at t+1 is then e t+1 ≤ 0, which using expression (4) can be rewritten as R c,t ≤ -et

Therefore we have P rob(R c,t ≤ -et

On the other hand the threshold return is given by Rc,t = µ-xσ , where x is the number of standard deviations required to have P rob(R c,t ≤ µ-xσ) = α.

We thus have:

= xσ -µ thus using constant unconditional moments µ and σ, investment in the foreign bond will be linearly related to capital, and we have:

as put in body of the text, where C = xσ -µ

The reader may object that specifying a constant C is a weak assumption. Indeed Shin and Adrian

Appendix G

The total return for chartists and carry traders is dened as : et e0 , where e T is the wealth at the end of the year and e o that at the beginning. To obtain yearly return we normalize e 0 to 1, and specify that investor reinvest at each period t their entire existing wealth, i.e. their wealth at t-1 the previous period plus any capital gains realized between t-1 and t. This approach is in line with the majority of