Building Statistical Arbitrage Trading Strategies: Market Making in Bitcoin & Gold Futures Contracts

To the memory of Darrin Joss, a well-respected CME pit trader who also went on to master the art of market making through electronic execution and algorithmic trading strategies. Darrin was my mentor and taught me the foundation for nearly everything I have learned in the futures markets.

Written by John Divine

[email protected]

Contents

1. Bitcoin & Gold Futures Markets (Chicago Mercantile Exchange)

2. Bitcoin & Gold Calendar Spreads

3. Gold Futures: Building an Algorithmic Market Making Trading Strategy

4. Bitcoin Futures: Building an Algorithmic Market Making Trading Strategy

5. Making Markets for Rolling Contracts & Implied Orders

6. A+B=C: Expanding Statistical Arbitrage “Down the Curve” in the Gold Futures Complex

7. A+B=C: Expanding Statistical Arbitrage “Down the Curve” in the Bitcoin Futures Complex

8. Aggregating Gold & BTC Market Making Strategies into a Single System

Computer Science/IT/Data Science Professionals and Students: this book aspires to bridge the gap between financial markets and computer programing by exploring the mechanics of markets and trading terminology in detail that can be understood even by an individual who has no trading experience or formal business education. The text should be of great assistance to someone who is interested in developing algorithmic trading strategies or simply curious about the structure. Liquidity is opportunity, risk management is priority. Whether a student in CS/IT or a professional with interest in algorithmic trading, look under the hood of futures markets and develop a working algorithmic trading strategy with this book.

Professional Traders: Building Statistical Arbitrage Trading Strategies: Market Making in Bitcoin & Gold Futures Contracts is a guide into a fundamental strategy that market makers in futures contracts can deploy to either diversify their trading desk or use as a training manual for new employees – traders, analysts or programmers. Options market professionals who are interested in learning more about futures calendar spread and outright market making will also find value.

Professional Brokers: For a Series 3 or Series 7 broker who is curious about market making, market mechanics and liquidity providing strategies for futures contracts, this read will bring you up to speed. The material covered here can serve as a fine primer into futures outright and calendar spread trading techniques for new employees or seasoned veterans.

Retail Traders: Many retail platforms now offer the ability to trade futures calendar spreads and synthetics – if you don’t know what a calendar or synthetic spread is then you need to read this book. If you are already familiar with calendar spreads and synthetics but have never traded them, this book should boost your learning curve and confidence in market mechanics. Calendar spreads typically have lower requirements than outright positions as the of a calendar spread position is often less than the corresponding outright. For retail traders seeking to make the jump onto a professional desk, understanding basic futures market mechanics and being able to talk about structure will put you ahead of the pack.

Business Students: Building Statistical Arbitrage Trading Strategies: Market Making in Bitcoin & Gold Futures Contracts is a must read for those who are interested in risk management, financial markets, accounting and economics. Understanding the fundamentals of futures contracts is critical in understanding how the world prices commodities, currencies, stocks and bonds. If you aspire to become knowledgeable about trading and markets, many valuable lessons await. For business students seeking to make the jump onto a professional trading desk, understanding basic futures market mechanics and being able to talk about orderbook structure will put you ahead of the pack.

Chapter 1. Bitcoin & gold futures contracts

The material covered in this book will attempt to teach you how to build algorithmic trading strategies based on statistical arbitrage strategies in futures markets that can be deployed as a speculative strategy, but more importantly, as a market making strategy in attempt to provide liquidity to bitcoin and gold futures markets as a service to the exchange and other market participants.

The material is presented in a way that assumes the reader is already very familiar with futures markets, calendar spreads, the practical uses of futures contracts and intricate knowledge such as “rolling” positions, hedging positions, initiating orders and closing orders.

The book focuses on bitcoin & gold futures contracts listed on the Chicago Mercantile Exchange (CME) as it is the worlds largest regulated futures exchange. The principles and strategies described throughout are not only for CME listed futures contracts, rather the logic can be applied to other venues that host futures contracts and marketplaces for trading. Each venue will have unique contract specifications, thus tailoring execution strategies to each venue will be unique.

If you are not familiar with these topics, stop and first read:

1. Introduction to Futures Markets 2. Digital Gold: bitcoin Vs. Bitcoin

CME Bitcoin Futures Contract Specifications:

o Contract Symbol / Product Code: BTC o Contract Unit:5 bitcoin as defined by the CME Bitcoin Reference Rate (BRR) o Price Quotation: $US dollars and cents per bitcoin o Trading Hours: Sunday - Friday 6:00 p.m. - 5:00 p.m. EST. 60-minute pause at 5:00 p.m. o Minimum Price Fluctuation (tick size): Outright 5.00 per bitcoin = $25.00/tick o Listed Contracts: Monthly contracts listed for 6 consecutive months and 2 additional Decembers.

o Termination of Trading ( Date): Trading terminates at 4:00 pm London time on the last Friday of the contract month. If that day is not a business day in both the U.K. and the US, trading terminates on the preceding day that is a business day for both the U.K. and the US.

o Settlement Method: Financially (cash) settled

o Settlement Procedures: All contract months settle to the volume-weighted average price (VWAP) of outright trades between 14:59:00 and 15:000 CT, the settlement period, to the nearest tradable tick. If the VWAP is equidistant between two ticks it will be rounded towars the prior day settlement price.

o Delivery Procedures: Delivery is by cash settlement by reference to the Final Settlement Price, equal to the CME CF Bitcoin Reference Rate (BRR) on the Last Day of Trading.

o Minimum Price Fluctuation (Tick Value): The CME bitcoin futures contract moves in increments $5.00/bitcoin per tick. Since the CME bitcoin futures contract specification outlines the quantity of bitcoin per contract as 5 bitcoin, the dollar value of an open outright position moves in increments of $25.00/contract.

BTC SEP-20 Bid Price Offer 9675 2 9670 1 9665 5 9660 7 9655 9650 9645 4 9640 8 9635 2 9630 3 9625

o Normal Daily Settlement procedure: CME Group staff determines the daily settlements for Bitcoin futures based on trading activity on CME Globex between 14:59:00 and 15:00:00 Central Time, the settlement period.

o Final Settlement Procedure:

Delivery is by cash settlement by reference to the Final Settlement Price, equal to the CME CF Bitcoin Reference Rate (BRR) on the Last Day of Trading.

CME Bitcoin Reference Rate (BRR)

o A daily reference rate that aggregates data from many bitcoin exchanges, including Bitstamp, Coinbase, Kraken, Gemini and Itbit during a 1-hour window beginning at 4pm Greenwich Mean Time.

o The one-hour window is split into 12 five-minute intervals, where the BRR is calculated as the equally weighted average of the volume-weighted medians from all 12 five-minute intervals

Bitcoin Listed Contracts: **** Monthly contracts listed for 6 consecutive months and 2 additional Decembers. **** As a major focus of this reading is on designing trading strategies for bitcoin futures markets, lets look at the # of unique trading accounts entering the CME bitcoin futures market since inception.

Chapter 2. bitcoin and Gold Calendar Spread Markets

Futures Market Symbols

Each futures contract month has a symbol that needs to be memorized.

Contract Month

F - January N - July

G- February Q - August

H - March U - September

J - April V - October

K - May X - November

M – June Z – December

It is important to become familiar with these symbols to the point where a Dec 2020 contract is a Z20 contract, or a J21 contract is an April 2021 contract. Memorizing these monthly symbols allows a market participant to grasp a futures contract ticker symbol.

Futures Contract Ticker Symbols

The ticker symbol combines product symbol of a futures contract and the contract month symbol, followed by the year of the futures contract.

▪ Bitcoin November 2020 Futures Contract = BTCX20 BTC is the product code, X is the symbol for November, 20 is the year 2020

▪ Bitcoin October 2020 Futures Contract = BTCV20 BTC is the product code, V is the symbol for October, 20 is the year 2020

▪ Gold August 2020 Futures Contact = GCQ20 GC is the product code, Q is the symbol for August, 20 is the year 2020.

▪ Gold December 2020 futures contract = GCZ20 GC is the product code, Z is the symbol for December, 20 is the year 2020

Simple Symbols

The + symbol = Long The – symbol = Short

Note: Going forward, we will refer to futures contracts by their ticker symbol and we will also use the contract month symbols. We will designate the direction of a position with the simple symbols.

For example:

+BTCV20 = Long BTC October 2020 Futures Contract

-BTCX20 = Short BTC November 2020

-BTCV20+BTCX20 = Short the BTC October 2020 / November 2020 Calendar Spread

-GCQ20 = Short GC August 2020 Futures Contract

+GCZ20 = Long GC December 2020

+GCQ20-GCZ20 = Long the GC August 2020 / December 2020 Calendar Spread

Calendar Spreads As calendar spreads consist of two contracts in the same product complex, we must label each contract.

o Leg 1: The first contract in a spread. The Feb/Mar spread has February as the first leg.

o Leg 2: Second Contract in a spread. The Apr/May spread has May as the second leg.

Calendar Spread Markets Below we have raw data taken from the CME on January 30th, 2020. We can see the 6 consecutively listed contract months along with a range of other data. To understand calendar spreads, or the price differential between each contract month, lets look at the settlement column, which has been plotted on the graph below.

Exchange Raw Data (BTC Jan 30th, 2020) Month Last Change Settle Open High Low Volume Open Int 20-Jan 9375 330 9390 9040 9480 9040 12,121 2,095 20-Feb 9505 350 9525 9290 9605 9250 1,328 1,452 20-Mar 9595 345 9620 9315 9675 9315 344 1,222 20-Apr 9655 360 9685 9590 9735 9545 21 64 20-May 9720 370 9750 9755 9805 9615 1 12 20-Jun 9765 375 9795 - 9820 - 0 72

Each listed futures contract in a product complex will have a daily settlement price and a final settlement price once the contract expires and is taken off the board. Throughout each trading session the prices of individual contract months will change and the price differential between two contracts is likely to change also. Many professional traders seek to profit from the net change in the relative value of two listed futures contracts in the same product complex.

Market makers can identify the relationship between each contract month and provide bids and offers down the forward curve based on the relative value between each listed contract month.

The Forward Curve (BTC Jan 30th, 2020) CME Bitcoin Forward Curve

9800 9795 9750 9700 9685

9600 9620 9525 9500

9400 9390

9300 JAN FEB MAR APR MAY JUN

Chapter 3. Gold Futures: Building an Algorithmic Market Making Trading Strategy

Algorithmic Trading The basic concept of algorithmic trading is setting up automated execution systems for trading strategies based on predefined rulesets that can be built to execute initiating, hedge and closing orders automatically through a computer program.

“If – then - else”, order of operations and conditional instructions are used as inputs, which are determined by a trader based on the underlying strategy being deployed in the market.

Input variables can include ratio, tick size, initiating leg, hedging leg --- tailoring inputs can be broken down to a very low level. The output is the rule-based execution that runs on a continuous loop unless instructed by the trader to cease execution.

High Frequency Trading (HFT) Algorithmic trading strategies can be of low frequency, where the strategy is not dependent on large volumes of transactions, medium frequency, or high frequency – where large volumes are executed through a predefined strategy (or attempted to be executed) continuously throughout a trading session.

Low Latency Execution Low latency can be used as a term to describe a computer system that is connected to a network in a way that maximizes the speed at which data can be processed for operations that are rooted in real- time fluctuations of a rapidly changing data feed (time & price data). For high frequency trading systems, the ability to process time & price data from an exchange (Chicago Mercantile Exchange) can be the difference between a profitable strategy and an unprofitable strategy.

For statistical arbitrage algorithmic trading models, the ability to process rapidly changing pricing data of outright futures markets and the relative value between different contract months allows a trader to be competitive when repricing synthetically created relative value calendar spread trading strategies.

Server Co-Location The competition for speed in statistical arbitrage trading strategies is so intense that many proprietary trading firms that deploy these types of strategies rent server space at the Chicago Mercantile Exchange data center (located in Aurora, Illinois) and build their strategies on localized servers as to minimize data transmission latency between the traders server and the exchange server to near zero.

Trading strategies can be deployed onto servers at the CME colocation data center and executed through an algorithmic execution portal (AEP) on a traders desktop PC that is directly linked with the server at the CME data center in Aurora, IL.

Proprietary trading shops worth their salt will already have access to this type of setup for their trading desks. With the knowledge learned in this book, you can look to these companies for opportunities to join existing trading desks, or to setup your own trading desk and deploy strategies built around the framework explained in this material.

Setting Up an Algorithmic Execution Portal (AEP) There are numerous professional trading platforms available to the public and many in-house proprietary trading platforms at professional trading shops that are equipped with Algorithmic Execution Portals (AEP’s). An AEP allows a trader to create a ruleset and define a strategy that can be executed automatically once deployed into a live market (or test environment).

Gold Calendar Spread AEP To understand the concept of an AEP, we are going to design a basic calendar spread trading strategy within the gold futures market. This trading strategy will focus on creating a synthetic calendar spread position using individual gold futures outright markets that will lean against the calendar spread price in the listed calendar spread market.

As the CME lists gold futures outright markets, the CME also lists gold calendar spread markets to trade.

Skewing Risk / Reward By observing the listed calendar spread for CME Gold M20/V20, we could simply setup a pure arbitrage strategy as we did with the CME Gold M20 / Q20 relative value trade, however as market makers, we can encourage more participation in the CME Gold October futures contract outright market IF we can tighten the spread relative to June.

As we tighten the spread, more market participants may look to buy and sell in the October outright market, and as we synthetically buy and sell the CME Gold M20/20 listed calendar spread market by initiating a relative value trading strategy in the LEG 2 market of CME Gold October, we may be able to turn our spread for 6 ticks of profit (Buying -18.6 , selling -18.0) over and over again.

RISK = 1 TICK (-$10):

o Work to BUY the spread at -18.6, if unable to turn for a profit at any price above -18.6, or scratch at -18.6, the trader can sell to close at -18.7 for a loss of 1 tick

o Work to SELL the spread at -18.0, if unable to turn for a profit at any price below -18.0, or scratch at -18.0, the trader can buy to close at -17.9 for a loss of 1 tick

MAX REWARD = 6 TICKS (+$60)

o Work to BUY the spread at -18.6 & SELL the Spread at -18.0

Gold M20 /V20 Listed Calendar Spread GC M20/V20 Bid Price Offer -17.8 5 -17.9 9 -18.0 x -18.1 -18.2 -18.3 -18.4 -18.5 x -18.6 8 -18.7 24 -18.8