## Monday, November 28, 2016

### Macro | How Sustainable is the US Dollar Rally

The dollar rally that started since the conclusion of US presidential election shows not much signs of abatement. 2014 was the year of crude oil, when the fantastic sell-off in crude set much of the moods prevailing in the world economy - from equities to rates. In 2015, this slowly turned over to dollar, partly through the surprise CNY depreciation, and later through Fed rate hike expectation. And without any doubt, despite all the noises around the Brexit and Italian referendum votes (early Dec), the dominating factor for risks is again US dollars. The figure below shows a quantitative look at the cross market risk drivers using Minimum Spanning Tree methodology (based on correlation). It shows clearly the dollar is in the center of the cross market driving force. A very similar situation to what we had back in 2013, but more concentrated role for the dollars to set the market sentiments. We already had a not-so-quite riot in rates following the dollar strength post election. The emerging market currencies and equities have taken significant beatings. And top houses are calling for this dollar strength to be one of the top trades in 2017. Naturally it begs the question how much leg is still left in this dollar rally.

To take a long-term look, the dollar rally is by no means extreme. In nominal terms the broad-based trade weighted dollar index is near its historical highs. However, when we compensate for the inflation differentials between the US and its trade partners, the rally is well within the historical range (still 13% off from the 2002 peak) - as the chart below shows. Note the rally in dollar since 2014 has been almost equal for the real and nominal exchange rate - 17% vs 20%.

But while this rally may not be extreme, it may not be sustainable either. A large part of the recent dollar strength has been on the back of expectation of US policy change, specifically a possible fiscal stimulus. The economic argument behind is that a fiscal stimulus, coupled with a budget deficit will increase interest rates and hence the exchange rate. In fact this is what was observed during early 1980s in the US (although it has not much support from observations in other non-US advanced economies). The actual mechanism is far from clear. There are extensive studies on budget deficit reduction and its impact on exchange rates, but reverse studies are rare. Theoretically, the direct impact (of increasing budget deficit) goes through the interest rate and asset return channel above and lead to a higher exchange rate (as demand for higher interest assets goes up among foreigners). On the other hand, increased budget deficit can increase the long term inflation expectation and hence expectation of future dollar depreciation. The second part of the policy is trade - which is basically a tightening pressure on the US current account deficit - if President-elect Trump follows though his promises. Typically for the US the current account in recent history has been driven to a large extent by demand for financials assets from overseas investors. This means a tightening of current account will have to be matched by reduced demand for US financial assets by foreign investors, resulting in a currency depreciation now (and possibly an appreciation later). In fact the post-crisis dollar weakness has resulted in a significant tightening of current account for the US already. A further sustained tightening in general may not be great for either the US or global economy. The other possible factors, i.e. the overall demand (or GDP differential) or real rate differential with major trading partners are relatively straightforward, an increase in both leading to a stronger dollar.

Looking in to the above set of arguments empirically, we run a quick vector auto-regression estimates with real dollar exchange rate, real rate differential, current account (% GDP), budget balance (% GDP) and GDP differential as endogenous variables (differential with GDP-weighted Euro area and Japan data representing rest of the world). The results are as shown in terms of impulse response - i.e. response of dollar real exchange rate for unit positive move in budget balance (FD), current account balance (ca), real rates differential (rates) and GDP differential (GDP). It seems at least for our data (spanning 1995 to 2014, quarterly), Trumps policy of budget deficit (negative fd) and tightening current account (positive ca) has off-setting impact for dollar real exchange rate. In fact there are good chances the current account tightening impact (negative for dollar in near term, positive long term) can overwhelm. An increase interest rates may make US assets attractive among foreign investors, but without matching trades the flows in to those assets will be difficult to sustain. Among other drivers, while inflation in US has been steady, including wage growth, we have seen some early signs of a come back of inflation in the Euro area. The main thing to look out there is the pick up in Euro area credit growth after a stall start of this year.

Given this ambiguous impact of policy, and hopefully a declining need for policy divergence and a head-room for trade-weighted dollars of only ~13% to reach all time high in real terms, it does not look like the dollar rally has much room left. one of the surprise trigger can come from ECB and/or BoJ in December, with QE in Europe still priced in. And the Dec Fed hike - which is almost a certainty now - will act to defuse this rally.

Interestingly, while from the emerging market point of view, the recent dollar rally was kind of risk-off, it was hardly so for Euro. Euro - which has lately became a funding currency like the Yen, sold off steeply. Arguably there was not much positioning to blame either, so this makes it a very interesting move. The Euro area as a whole has accumulated a huge current account surplus in its glut for savings in the post-crisis period. A substantial change in trade relationship with the US may start to unravel that. If you are positioning for the consensus Euro dollar parity, think again. 2017 may see a major reversal in Euro instead dollar.

Note: all data from the St Louis Fed FRED database.

## Saturday, November 5, 2016

### Markets | The Trump Trade?

Keynesian beauty contest is an interest concept that shows a group of perfectly rational agents trying to predict the outcome of an event may not converge on the most expected case, provided their risk and reward depends on what most others think. I think something similar happens in the markets around a big event. Rarely it is clear what are the implications of different possible outcomes of such events. In such a scenario, a trader's immediate pay-off depends on how good he is at predicting market reaction (as opposed to the actual implications). As a result collectively the market ends up reacting in some ways that very few people may actually believe.

Next week's presidential election is such an event. There are strong evidences that economy has significant impact on election outcomes. however the reverse result is very weak if any. Performance of a large globally connected economy depends on more things beyond the control of the Oval Office than we give credit for. However the markets seem to have already formed an opinion and trading according to the poll results in recent week. This is not only the US market but across the globe. The common denominator is an expectation of underperformance with a republican win.

The consensus is more or less a status quo with a democratic victory and large uncertain changes with the republic candidate in office. Honestly, I think it is too early to say what will be the policy changes as we hardly have any clue on specific policies apart from election promises. For example it is usually considered republican victory will be good for defense stocks. However if Mr Trump carries out his promise on cutting down on NATO, will that necessarily be the case? He promised to unwind trade agreements. But sure there will be something to replace it, will that be very different than the existing one, and will that have really any significant impact on trades, prices and job? Or may be you should buy Apple? - he is sure to threaten EU to withdraw the taxation case and make America great again! My personal take is Mr Trump promised things, but post election (if he wins) it will be hard to deliver on many of them except in a much run-down version. Hence in the base case, sooner than later, we focus back on things like earnings and economy and inflation once the initial reaction is over.

However, the market is close to pricing in a crash scenario for an outcome favoring the republican candidate. The VIX (and volatility of VIX) are tad shy of last August peaks. The implied skew and (near-month) implied correlation in S&P 500 are racing sky-wards (and interestingly with a quite flat vol convexity, i.e. high skew and very low smile). There is a high amount of uncertainty.

And if you are planning to take decision (being flat is one of them), I have already written about how to generally think about positioning under uncertainties before. If you are a hedger, you know what you need to do - that's quite it. And if you are a speculator, after all the analyses and mumbo-jumbo, basically you have to choose a side (rally or sell-off) and stick to it. And the only things that matter are:
1. what is your expectation and how that looks from risk-reward already priced in the markets and
2. How to optimize your responses in case you are wrong.

The first one is commonly understood. At present the markets are definitely pricing a large sell-off. This is in the background of decent economic news and improving global PMIs. Technically most markets across the globe has or on the verge of confirming a bearish signal (see chart above). The asymmetric pricing in the downside suggests there are large price move expected, but at the same time it makes the risk-reward unattractive compared to the upside. And based on the past history in S&P which has breached a technical support recently, the distribution of near term returns favors the upside statistically (albeit with a rather large uncertainty spread around that). The chart shows the historical price distribution after such technical breaches (categorized in to three types of technical formation - megaphone, triangle and channel, and whether the existing trend was ascending or descending, and also if the breach is of resistance (up) or support (down))1. We are in a down breach within an ascending megaphone (see the figure above).

As far as the second point is concerned, if you are positioning for downside and it turns out wrong, your responses are limited if you assume it will be a relief rally, (not a sustained one). Alternatively, if you are positioning for the upside and if you are wrong, you will have plenty of opportunities to react. We will sure enter a period of high volatility and there will be plenty of trading opportunities.

So it appears purely based on the second criteria, a long risk positioning is preferred2. Of course this assumes the outcomes are fairly priced from criteria one and you do not have any strong view on either outcome.

Note: 1) This is based on systematic technical analysis, for details see here, for code page go here. You can select or de-select series on this interactive chart

## Friday, October 28, 2016

### Macro: The Quiet Riot - Continental Version

For the past few weeks, the fixed income market has seen a significant change in moods.

The earliest trigger was in the JGBs market in late July, then it was the Gilts in late September following a pause from BoE. This week it definitely felt like the Bunds. Treasuries are down too from July highs, but in a much gradual fashion compared to the rest.

Now while we do have individual explanation (with the 20/20 hindsight) for all these (BoJ steepening chatter, Brexit, ECB QE rumors and, of course, Fed hike expectation), these moves signals some fundamental changes common across the markets as well. For one, this sell-off in rates is markedly different that recent large moves or the 2013 taper tantrum in terms of the accompanying movement of the inflation expectation. This is the first large sell-off in rates where the real rates (I used 10y yield less the 5y swap breakeven rate) were stable. Clearly the common thread has been inflation expectation - led by the Sterling inflation market, in response to a weakening currencies. But this was not limited only to GBP. Backed by the strong recovery of the commodity prices and oil, inflation markets across regions rallied, recovering from the bottom in Q1 this year. Even the Euro inflation is  flat on YTD basis after this recent move.
However, it is still too early to say if this points to an inflation scare. We are far off from seeing the white of the eyes of inflation. Large part of the recovery in inflation is driven by commodity prices which just came off multi-year lows. With over-capacity in many sectors, and a new cost/ supply equation for oil (see here too), there is no strong case for the commodity rally to overshoot substantially from here. On the demand side, apart from the healthy wage growth in the US, things are not significantly better. UK is still trying to figure out the consequences of Brexit. The collapse of the credit impulse in the Euro area late last year is yet to recover and Japan seems increasingly stuck.

The suddenness of the move suggests a large driver of the sell-off may be positioning, especially in Euro and GBP. Bunds open interest on Eurex were near historical high since 2008 before the selloff. This was definitely not helped by a rather tight-lipped Draghi on the last ECB. ICE Gilt positioning also indicated asymmetry with position build-up after Brexit. For core rates, this means the recent sell-off will stabilize as the pressure from positioning is diffused eventually. However, it is clear that we are approaching near the end of the era of quantitative easing. The next big move in rates will not be triggered by Fed. It will be the policy announcement from BoJ in Nov, followed by ECB's decision on QE in Q1 next year. Fed is priced in, and with all probabilities, will carry out a measured hike in December. It will be mostly a non-event.

What is rather interesting is how the current monetary policy plays out for the curve. It is clear we are increasingly approaching the end of QE-topia, with some central banks moving to normalize, and some still leaving considerable liquidity in the system and trying to lean on the next lever. This apparent divergence in the first order (the level of rates) is leading a convergence drive in the second order (the yield curve slope). BoJ is actively seeking to steepen the curve to alleviate concerns of the banking sectors, among other things. ECB will be glad to have the Euro area curve steepen back. The Fed is allegedly getting in the same business. The latest round of rates sell-off, unlike most before in recent time, was mostly a bear steepening move. Unfortunately, steepeners are not as juicy as they used to be in terms of carry a couple of years back, but still this is the trade to be in for the medium term - either in absolute term or cross-markets.

On the equity side, contrary to general view, this is not at all negative. Inflation recovering from current levels shows strength of the macro drivers. In fact in recent years, S&P 500 has shown more asymmetric correlation to inflation expectation than outright rates itself (see chart below). The thick tail on the right hand side has been dominated by inflation downside (i.e. correlated sell-off in equities with collapse in inflation expectation). A recovery in inflation expectation should be positive, at least initially, and ultimately uncorrelated to equity performance (runaway inflation is still a distance myth). This is especially true given the strong commitment from the Fed on its intention of slow paced hikes.
The S&P appears to be in a consolidation state - in a typical triangle formation, before the next leg (usually up from here).

The downside for equities from here is in fact event risks, and not macro. The US presidential election is one -although apparently the market does not care. Italian referendum is another - and again the history does not make a strong case for it either, if you go by the off-hand manner in which market digested the outcome of recent southern European election outcome.

## Saturday, October 22, 2016

### Systematic Trading | An R Package for Automated Technical Analysis

This is an R package for automated technical analysis and some ground stuff for some pattern matching algorithm I plan to build. This is available at github - you can directly install it from github or you can fork or download. Currently it has three functionalities - 1) perceptually important points 2) change points for time series with linear deterministic trends and 3) automated technical support/ resistance/ price envelope identification (useful for back-test, but I have not found the time yet). It has also an undocumented module for technical pattern identification, which is in fluid state. Please note the is in early version and features/ data structures may undergo substantial changes in later version. I copy paste the R vignette below.

Techchart: Technical Feature Extraction of Time Series Data The R package techchart is a collection of tools to extract features from time series data for technical analysis and related quantitative applications. While R is not the most suitable platform for carrying out technical analysis with human inputs, this package makes it possible to extract and match technical features and patterns and use them to back-test trading ideas. At present, the package covers four major areas:
• Perceptually Important Points (PIPs) identification
• Supports/resistance identification (either based on PIPs or the old-fashioned Fibonacci method)
• Change point analysis of trends and segmentation of time series based on underlying trend
• Identification of technical envelopes (like trend channels or triangles) of a time series

## Perceptually Important Points

PIPs are an effort to algorithmically derive a set of important points as perceived by a human to describe a time series. This typically can be a set of minima or maxima points or a set of turning points which are important from a feature extraction perspective. Traditional technical analysis - like technical pattern identification - relies heavily on PIPs. In addition, a set of PIPs can be used to compress a time series in a very useful way. This compressed representation then can be used for comparing segments of time series (match finding) or other purposes. In this package, we have implemented the approach detailed here.
spx <- quantmod::getSymbols("^GSPC", auto.assign = FALSE)
spx <- spx["2014::2015"]
imppts <- techchart::find.imppoints(spx,2)
head(imppts)
##            pos sign   value
## 2014-02-03  22   -1 1741.89
## 2014-03-07  45    1 1878.52
## 2014-03-14  50   -1 1841.13
## 2014-04-03  64    1 1891.43
quantmod::chart_Series(spx)
points(as.numeric(imppts$maxima$pos),as.numeric(imppts$maxima$value),bg="green",pch=24,cex=1.25)
points(as.numeric(imppts$minima$pos),as.numeric(imppts$minima$value),bg="red",pch=25,cex=1.25)

The function takes in a time series object (in xts format), and a tolerance level for extreme points identification (can be either a percentage or a multiple of standard deviation). It returns an object which has the list of all PIPs identified, marked by either a -1 (minima) or 1 (maxima), as well as the maxima and minima points separately as xts objects

## Supports/ Resistance

Supports and resistance levels are very popular tools for technical analysis. The function find.pivots implements a couple of ways to identify supports and resistance levels for a price series. Using the option FIB will produce a set of Fibonacci levels around the most recent price point. The option SR will run an algorithm to find co-linear points along x-axis (horizontal line) to find levels most tested in recent times. A set of levels as well as xts representation of the lines defined by them are returned
spx <- quantmod::getSymbols("^GSPC", auto.assign = FALSE)
spx <- spx["2014::2015"]
sups <- techchart::find.pivots(spx, type = "FIB")
summary(sups)
## supports and resistance:
## next 3 supports:1982.249 1936.355 1890.461
## next 3 resistance:2130.82
sups <- techchart::find.pivots(spx, type = "SR", strength = 5)
summary(sups)
## supports and resistance:
## next 3 supports:2043.688 1992.551 1895.028
## next 3 resistance:2070.407 2111.588

## Price Envelop Identification

Price envelopes features are an integral part of technical analysis. For example technical analysts look for features like trending channel, or ascending triangles etc to identify continuation or breakout from current price actions. The function find.tchannel identifies the most recent such envelopes using an implementation of the popular Hough transform algorithm in image processing, along with some heuristics.
spx <- quantmod::getSymbols("^GSPC", auto.assign = FALSE)
spx <- spx["2016-01-01::2016-09-30"]
tchannel <- techchart::find.tchannel(spx,1.25)
tchannel
## name: channel
## type: neutral
## direction: 0
## threshold: NA
quantmod::chart_Series(spx)

quantmod::add_TA(tchannel$xlines$maxlines[[1]],on=1, lty=3, col="brown")

quantmod::add_TA(tchannel$xlines$minlines[[1]],on=1, lty=3, col="brown")

The function returns an object with parameters of the envelopes found (if any), as well as the xts representation of the envelopes lines

## Saturday, October 15, 2016

### Central Bank Watch: FOMC Minutes (and RBI)

It is highly interesting to see the views and counter-views on the impact of  low rates on the DCF industry. I think both miss the subtle point here . All these DCFs and PVs and pretty much everything else depends on an assumption of properly functioning lending and borrowing market. The question is: if negative rate does persist for long, will that assumption breakdown, or will adapt.

Speaking of rates, the FOMC minutes released this week was very informative. It was a much ambivalent FOMC than we have seen earlier. It appears the September hold decision was a close call. So it is safe to assume it will be so in November and December (if no hike in Nov) as well.

On the major points that drives the"data dependent" FOMC, it seems the consensus is on the labor markets. Since the last meetings, we had more or less similar or slightly improved wage data. However, this week's job opening (JOLT) was a bit disappointing. On economic growth expectation, retails sales data from Friday was more or less on the mark, matching street expectation, and capital goods from earlier has shown improvement as well. Even the much discussed negative influence of foreign GDP has subsided. Eurozone forecast edged up to 1.3% from 1.2%, and UK forecasts from 0.50% to 0.70% (since Sep FOMC).

However, surprisingly, on both of these parameters, Fed's own measure is going the other way. The Labor Market Condition Index and the Atlanta Fed's GDP now-casting have both nose-dived in recent readings.

On the inflation front, the both the CPI and PCE edged up since. The CPI is still suffering from energy prices drag. Given the recent moves in oil prices, this should have a positive impact on data before the next meeting.

Overall, I expect the data to be neutral for both employment and growth and marginally hawkish for inflation for the November meeting. The possibility of a November hike is still lower. Partly, that will be a surprise for the markets - which currently prices in a 17% chance of a hike at November FOMC and a 64% at the Dec meeting. As I discussed before, Fed has never hiked before without a substantial chance priced in by the markets.

That said, one particular line of arguments stands out from the released minutes:
A few participants referred to historical episodes when the unemployment rate appeared to have fallen well below its estimated longer-run normal level. They observed that monetary tightening in those episodes typically had been followed by recession and a large increase in the unemployment rate. Several participants viewed this historical experience as relevant for the Committee's current decisionmaking and saw it as providing evidence that waiting too long to resume the process of policy firming could pose risks to the economic expansion, or noted that a significant increase in unemployment would have disproportionate effects on low-skilled workers and minority groups.
There were only two major hike cycles not followed by a rise in unemployment in recent history. One was following the early 80s recession, and the other following the early 90s recession.

This points towards a strong commitment of FOMC towards a gradual rate hike, even if the initial hike has to be brought forward in time. It will be very surprising if we do not have another hike by the end of the year. But this, along with the now-lower long term equilibrium rates, also means it will NOT be particularly threatening to US equities or rates in general (both slopes and levels). Fade the move if any respond violently to FOMC one way or the other.. Both equities and rates should depend less on FOMC and more on intrinsic and unexpected events.

Talking of unexpected evens, the one is of course the US presidential election. The general expectation is a sell-off if Mr Trump wins. Although I fail to see a rally even if it is Mrs Clinton. And of course market expectation can be wrong. In 2012, it was widely expected that a Obama win will be bad for equities, and indeed there was minor sell-off leading up to the election day. However the results marked the start of a long stretch of bull run.

October was also a historic moment for Reserve bank of India. It was a new Governor (following the exit of Raghuram Rajan) and its first ever Monetary Policy Committee decision. And it was a decision quite difficult to understand - an (mostly) unexpected 25 bps cut. RBI revised GDP higher, and both real rate and inflation lower. A lower real rate expectation usually means a lower potential GDP. That means a higher GDP will lead to a potential overheating. A lower inflation rate is not consistent with this, unless RBI is expecting substantial imported disinflation.

India's decreasing credit growth is a worry, but it is not clear higher rates are the culprit here. The decline is driven mostly by the industrial sector - which presumably has more on its plate than to worry about higher rates. And in any case the pass through of RBI rate cuts by the banking sector has not been exemplary in recent time -which has been mired in its own significant bad loan problems. It was appeasing to the markets (and politics perhaps), but hard to imagine how much, if at all, it will help the economy forward.

## Sunday, September 18, 2016

Finally we had a little bit of excitement back in the markets, and a vindication of sort for the numerous bears. Analysts from Citi confirm the macro drivers to blame. Indeed the cross market correlation has been on the rise. Below table shows the current cross market correlation1. As it shows, rates and inflation still remain the major drivers, along with a very high level of correlation between commodities and currencies.

The chart below shows average correlation across asset classes. The recent spike is still far away from the levels around August 2015, but clearly captures the market sentiment.

And this sentiment is what is reflected in the latest AAII release last week. The market neutrals and bears remain significantly above the historical average as we have during most of this post-crisis bull runs. The change to highlight is an increase in bears at the expense of mostly the neutrals.

For a contrarian, this would signal a limited scope of continued sell-off. However the other factor is positioning on the derivatives side. I have written about this before, but you must have already observed the change in the intraday price patterns in S&P. During much of last few months, it showed a strong mean-reverting characteristics (opening price shocks reversed during the day). For last few session starting from the 9th sell off, it seems the intraday trends are self sustaining now. That is confirmed on more quantitative measures as well. The chart 2 below shows two approximate indications of short gamma positioning of the dealers. The idea behind this is in a market where the dealers (i.e. the hedgers, as opposed to players who hold options positions unhedged) are short gamma (net sellers of options), the natural hedging activity will create price pressure that will tend to amplify a price move (a up move in to a sustained rally and vice versa). On the other hand, when the dealers are net long, this will tend to stabilize price moves. Much of the stability in S&P intraday move for past few months can, at least partially, be attributed to net long position from the dealers, which appears changing now, as the short term intraday trends get stronger and sustain longer.

On the valuation side, however, S&P is still not screaming over-valued. Below chart shows world equity markets valuation vs trends (past 1-year returns) in two measures. The left one is the regular P/E measure, on which S&P is quite in the red zone, along with India and only second to Mexico. However, just going by historical P/E in a world of zero rates can be highly misleading. In terms relative valuation to bonds, S&P is quite in the middle.

If you followed the trades from my last post, it would have been a good couple of weeks capturing most of the major moves in the markets in the right direction. Looking ahead, if you are a bear, the investor sentiments and the valuation is not at a very helpful support to go big short at current levels. On the other hand the change in the gamma signature of the markets tells us unless something changed after Friday's expiry, we will continue to see decent swings and volatility will pick up. Although vols are not particularly cheap (relative to realized, yet), and I think given the reasons discussed before, it still makes more sense to buy options than to buy VIX here.

A traders' market after a long time. Brace for the upcoming Fed, but more for the BoJ. Going beyond equities, the major moves in rates (one of the major driers across asset classes now) has been set in motion by BoJ arguably. The recent bout of steepening in fixed income started with a bout of sell-off in JPY rates markets. This transmitted to rest of the world following ECB, with sharp steepening across EUR, USD, and GBP. The built up to the month end BoJ is almost palpable, and if not FOMC, at least this is almost certain to be an interesting event.

1. This is based on smoothed data (Gaussian kernel smoothed with 5-day bandwidth) to capture medium-term correlation.
2. The left chart is based on identifying trends quantitatively using change point techniques. The idea is as trends become more sustaining the ratio of max to median trends will increase, as shown in the chart. The right hand chart shows absolute value of beta in a simple regression of intraday price to time, capturing the strength of the trend (if any) irrespective of its direction (rally or sell-off).
3. Data from Bloomberg and Google Finance