LATEST ANSWERS

Have a look at "Quantum Computing for Everyone" by Chris Gernhardt (MIT Press). https://www.amazon.com/Quantum-Computing-Everyone-MIT-Press-ebook/dp/B07P7KN23F/ref=sr_1_2?crid=31CISZ7XVOUGF&dchild=1&keywords=quantum+computing&qid=1587034160&sprefix=quantum+com%2Caps%2C578&sr=8-2

Brexit brought a wave of uncertainty to the world’s political and financial ecosystems. Its effects were felt in many areas, from the prices of stocks to the value of gold. Many who follow global financial news are familiar with the rapid drop in the pound relative to the dollar as the Brexit results were announced. Less visible was how FX traders anticipated and responded to the event. In this analysis, we utilize 1QBit’s Quantum-Ready Software to provide insights on their activity. We also provide the capability to run such analysis for yourself, so that you, the user, can begin to formulate research ideas and trading strategies around calculations such as these.

This post examines how Brexit was perceived by traders of a particular type currency forward. It takes advantage of the algorithms in the Quantum-Ready Software Development Kit (SDK) to explore this new trade data.

This is the first in a series of analyses that we will be posting in the coming weeks. The community is encouraged to post their own results and comments using the same data and tools. We look forward to the hearing of your experiences in producing your own investigations.

First, we will cover Brexit and the specific type of currency forward under examination. Then, we will discuss the idea of making graphs from the data we retrieve on these contracts. Finally, we examine the sample graphs that come out of the analysis. Further posts in the coming weeks will discuss changes in graphs before and after the Brexit vote.

The Brexit Vote

The Brexit vote took place on Thursday, June 23, 2016, in the middle of our three week analysis window. The polls closed at 10:00pm British Summer Time (9:00 pm GMT), and the results were gradually announced through the early hours of Friday June 24th. However, it was clear after a few hours that Leave would almost certainly win. This was reflected in both the volatility and sharp decline of the pound (GBP) against the US dollar (USD).

The picture on below is a representative Open, High, Low, Close chart using the most widely published US market data. Each specific market has its own version, but the size of the drop is unmistakeable.

Events like the Brexit vote are rare and provide an opportunity to study unusual behavior not present in day-to-day financial activities. By studying examples of these events using new tools, we may find new insights into the dynamics of the foreign exchange market.

New Data, New Techniques

The analysis makes use of new data and new techniques:

Non-Deliverable Forward (NDF) trade reports made public by the Swap Data Repository (SDR) operated by the Depository Trust & Clearing Corporation (DTCC). Public SDR data has only been available since 2013 and is fragmented amongst several repositories with different formats and access protocols.

Detection of cliques and quasi-cliques in currency relationship graphs using tools provided in 1QBit’s Quantum-Ready Software Development Kit.

The currencies are modeled as nodes in a graph, and the trades as edges from one node to another. An edge may represent a simple message count or a property such as price or volume. A clique is a fully connected subgraph, which, in the case of currencies, means that trading is present between all the pairs of currencies that belong to the clique (i.e. there is an edge connecting every pair of nodes). The graphs are represented by adjacency matrices that can be loaded into a Jupyter interactive Python notebook, where they can be manipulated and visualized.

Data Sharing

The U.S. Commodity Futures Trading Commission (CFTC) requires that every Swap Data Repository “publish and make available swap transaction and # pricing data in a non-discriminatory manner, through the Internet or other electronic data feed that is widely published and in machine-readable electronic format”.

The data used in this study was filtered from the DTCC’s real time dashboard and converted into Python lists. Initially, we provide fifteen 30×30 adjacency matrices covering the NDF message counts on trading days from Monday, June 13 to Friday, July 1. For convenience, these have been reproduced at the end of this post. Members of the Quantum for Quants community are encouraged to download them for their own use with 1QBit’s interactive notebooks. A larger data set will be posted in the future.

Non-Deliverable Forward Contracts

The Non-Deliverable Forward is a short-term, cash-settled currency forward between two counterparties. On the settlement date, the profit or loss is determined by the difference between the contracted rate and the prevailing spot rate. The key idea is that the settlement is made in a major deliverable currency, because exchange controls or national regulations limit the availability of one or more of the traded currencies. For example, the Bank of China offers NDF contracts in Chinese Renminbi (CNY), Euros (EUR), British Pounds (GBP), Hong Kong Dollars (HKD), and U.S. Dollars (USD). These are settled in USD and give exposure to the Renminbi without requiring possession of the actual currency.

In a study done in 2005 for the Federal Reserve Bank of New York, it was found that NDF prices “can be a useful tool for market monitoring in that these prices reflect market expectations and supply and demand factors that cannot be fully manifested in onshore currency product prices in a country with capital controls… in periods of heightened investor caution or concern over potential change in the exchange rate regime or a perceived increase in onshore country risk”.

Non-Deliverable Forwards are useful in studies of market perception because they are largely traded by well-informed traders at major financial institutions. Furthermore, we will look at only the most heavily traded maturities, where an individual trader can compare his or her perception with that of others in the market.

Our study period covers Monday June 13 through to Friday July 1. We will begin by looking at “trader engagement” with specific currency pairs, i.e. did they trade these or did they prefer to wait. Then will go on to other market data such as price, volume, direction, and contract tenor. We will look at short-term NDF contracts where the settlement date is only a month from the execution date (and the effective date is no more than two business days from the execution date).

Setting Up a Currency Graph

The ISO 4277 Standard defines over 160 three-letter currency codes. In our three week analysis window, 51 of these appeared in NDF trades. The 30 most active were used to create a matrix, ranging from US Dollars (#1 at 72%) and Indian Rupees (#2 at 4.2%) down to Danish Krone (0.12%). The cutoff is, somewhat arbitrarily, 0.1%.

In the one month maturities, there were 74,015 reported trades over the 15 trading days from Monday, June 13 to Friday, July 1.

The 30 currencies can be plotted around the perimeter of an ellipse. The graph below indicates the activity observed on Monday, June 13, the first day of our analysis period.

The USD is connected with almost every other currency. The euro (EUR) is also highly connected. Other currencies vary. The pound (GBP) is connected to the Japanese yen (JPY), the Colombian peso (COP) and the USD. The South African rand (ZAR) and the New Zealand dollar (NZD) are not connected at all. No NDF contracts in these currencies were traded that day.

Three currencies have been highlighted in yellow. The Mexican peso (MXN), the Chilean peso (CLP) and the US dollar (USD) form a triangular clique, in that each of these currencies is connected to the other two. Triangular cliques are common in the data, and indicate broadly that businesses in all three countries intend to do business with each other.

A graph may contain multiple cliques. However, our goal will be to find the largest clique, which may contain four or five members and sometimes more. There may also be more than one of these.

For example, in this picture from July 1, the end of our analysis window, the active currencies (USD, EUR, and GBP) form a clique with the Australian dollar (AUD) and the Korean won (KRW).

Note that these are simple message counts, such that the presence of a single trade is enough to create an edge. A single NDF trade between Danish krone (DKK) and USD has the same weight as a thousand trades in USD-EUR.

A more realistic approach might be to set a threshold, e.g. only pairs with message counts above the median count for all pairs are counted as connected. Other possibilities are to include volume or bid/ask spread as a measure of “trader engagement” with that pair. Even more could be deduced by studying how cliques form over time, e.g. by breaking down the daily counts into hourly counts. All of this is possible with the SDR data, more of which will be posted as the study proceeds.

References

Lipscomb, Laura, An Overview of Non-Deliverable Foreign Exchange Forward Markets, Federal Reserve Bank of New York May 2005, also available from the Bank for International Settlements, https://www.bis.org/publ/cgfs22fedny5.pdf

Further Notes:

Adjacency Matrices

Swap Data Repositories as a Data Source

Trade data for non-deliverable forwards (NDF) is reported to swap data repositories (SDRs) according to the regulations of the US Commodity Futures Trading Commission, pursuant to the Dodd-Frank act. The share of CFTC regulated trades relative to total NDF trades can be estimated from the global outright forwards data collected by the Bank for International Settlements, where in 2013, 43% of forwards involved USD as opposed to 13% for EUR, 9% for JPY, and 5% for GBP. The USD trades are typically settled in USD and therefore fall within the jurisdiction of the CFTC. The biggest SDR is operated by the Depository Trust & Clearing Corporation (DTCC); for this analysis its figures will be taken as representative of the market as a whole.

The DTCC trade data is viewable on the DTCC website. It is possible to download cumulative slice files for the last few weeks or to run searches on arbitrary periods. The NDF data is relatively straightforward to analyze, since many of the fields required for more complex instruments can be ignored. With the columns for NOTIONAL_CURRENCY_1 and NOTIONAL_CURRENCY_2 and some careful use of Excel’s COUNTIF() and SUMIF() functions, it is easy to construct a matrix with the first currency as the row and the second currency as the column.

With about the same amount of effort, a Python script can be written to iterate the slice files and count pairs of dictionary keys like “USD-EUR”, “HKD-MYR” and so on. This was the approach used to create the matrices provided on the web page referred to earlier.

LATEST ANSWERS

Have a look at "Quantum Computing for Everyone" by Chris Gernhardt (MIT Press). https://www.amazon.com/Quantum-Computing-Everyone-MIT-Press-ebook/dp/B07P7KN23F/ref=sr_1_2?crid=31CISZ7XVOUGF&dchild=1&keywords=quantum+computing&qid=1587034160&sprefix=quantum+com%2Caps%2C578&sr=8-2