4 Useful Metrics for Algorithmic Traders

Introduction

As a part of our Open Crypto Data Initiative, we aim to provide traders and web3 enthusiasts with the tools to understand cryptocurrency markets and derive key insights into their mechanics. However, this data is limited by the knowledge of the traders using it, and so we’re providing a series of useful metris and indicators that algorithmic and high-frequency traders can add to their arsenal when developing a trading strategy.

1. Hurst Exponent

Description

The hurst exponent is a useful indicator for a time series that can give a trader insight as to whether the time series they are investigating is random walking, mean-reverting, or trending. This is obviously important for a trader to use — many algorithms and high-frequency trades base decisions on momentum and mean-reversion.

To put it simply, the Hurst exponent is a measure of the long-term memory of a time series. It determines how much a time series (in our case, the price of an asset) deviates from a random walk — a situation where previous events have no impact on future movements, where everything is independent.

The Hurst exponent scales from 0–1, and the results can be interpreted as followed:

  • H < 0.5: The time series is mean-reverting. In finance, this means that the asset price will tend to converge to the average. If you have a low value, you can expect the next value will be high
  • H = 0.5: Random walk. The trend is inconclusive, and the price of the asset can go anywhere
  • H > 0.5: The time series is mean-trending. The higher the value, the higher the strength of the trending pattern and the chance that it will continue. If you have a high value, you can expect the next value will be higher.

The Hurst Exponent is defined in terms of the asymptotic behaviour of the rescaled range of the timeseries:

Where:

  • E is the expected value
  • R(t) is the range of the first t cumulative deviations from the mean
  • S(t) is the sum of the first t standard deviations of the timeseries itself
  • t is the time span of the timeseries
  • C is some constant

Note that by dividing R(t) by S(t), we end up computing the rescaled range of the timeseries.

Use Cases

There are two main strategies that take advantage of the Hurst Exponent indicator:

  • Momentum Strategies: These are strategies that look for trends of the market and trade accordingly. They are looking for situations with high Hurst exponents as they can be predictably traded. For example, a momentum trader could notice that a coin has a relatively high hurst exponent over the past few years and has experienced upward trends in pricing, and so could make the assumption that the price action will continue.
  • Mean-Reversion Strategies: These are strategies that carry the assumption that the underlying asset will conform to some long-term pattern. A stock with a hurst exponent < 0.5 will imply to the trader that it will most likely revert to an average price as t is taken to infinity, and so traders can use this assumption to exploit slight deviations in the price. For example, if they saw that an asset had a very low hurst exponent, and the current price was lower than the average over the past few years, they may assume that the price will rise to the average eventually, reverting to the mean.

2. Abel Noser Momentum

Description

Abel Noser momentum is an indicator for the trend of the market, calculated by taking the opening price of a security and comparing it with its volume-weighted average price over the trading period. It has multiple levels that describe the extremity of the trend:

  1. Strong Momentum (>1%)
  2. Momentum (Between 0.25% and 1%)
  3. Neutral (Between -0.25% and 0.25%)
  4. Counter (Between -0.25% and -1%)
  5. Strong Counter (<-1%)

Abel Noser Momentum can be defined as:

Where P_o is the opening price and P_{VWAP} is the Volume Weighted Average Price, computed as

With P_j and Q_j being the price and quantity of trade j, respectively.

Use Cases

Momentum analysis plays a key role in high frequency and algorithmic trading. Strong momentum can be an indicator to buy up an asset, and strong counter can be an indicator to sell and wait for the price action to calm. It’s rare for a trader to only use momentum as an indicator for price action and market predicting, but it can be helpful when determining when a market is about to reverse or significant shifts in price action are about to occur.

3. and 4., Average Mid-Price Movement and Average time Until an Order is Filled

Every market participant always wants to predict how the price might move in the next instant, and whether or not they can capitalise on that price change. For more versed financial mathematicians, they might think of these metrics as the predicted change in mid-price, and the participant fill rate. Fortunately, extensive studies have been done in search of indicators which can be used to predict these two metrics.

A well researched predictor of these order book based metrics is the quote imbalance. It represents the normalised difference between the quantities of the best bid and ask prices of the order book.

Lipton, Pesavento and Sotiropoulos (2013) empirically observes that quote imbalance is an excellent predictor of average mid-price movement and the expected arrival time of the next trade which fills the near side of the order book. In the paper, they define it as:

where q^b and q^a are the bid and ask quantities posted at the top of the order book respectively.

I takes values between -1 and 1. Positive imbalance indicates an order book which is heavier on the bid side, while negative imbalance indicates the opposite. It’s intuitive that order sizes at the best bid and ask levels reflect the general intention of market forces. Therefore as a function of the order sizes, quote imbalance is a singular value which indicates how price is expected to move within a short time horizon.

Lipton, Pesavento and Sotiropoulos calculate some quantities related to order book microstructure conditional on its quote imbalance to show the efficacy of the value as an indicator. Specifically, they empirically calculate two metrics:

  1. The average mid-price movement normalised by spread as a function of the quote imbalance.
  2. The average time until an order posted on the book’s near side is filled as a function of the quote imbalance, directly leading to the fill rate of a particular order.

The figures in the paper clearly highlight the functional relationship between quote imbalance and mid-price movement.

Lets say that we’re a broker agency with the goal of buying or selling a given number of shares within a set time horizon at the best possible price. To optimise our trades, we need to know how how likely our limit orders are to be filled and how long it will take until our orders are filled.

More specifically, if we post a maker order on the buy side, our fill rate is influenced by the next incoming taker order from the sell side but not by taker orders from the buy side. We want to know how the price might change between when our order is placed and when our order is filled — and how long it will take.

The paper empirically models price movement with quote imbalance by:

  1. Recording the quote imbalance at a given point in time.
  2. Recording the mid-price at a given point in time.
  3. Finding the mid-price at the next matching trade event after the given point in time.
  4. Calculating the difference in mid-price between the two points in time, then normalising it based on the bid-ask spread.
  5. Create a data point (quote imbalance, mid-price difference) and average it across all timestamps.
  6. Average the mid-price difference for each quote-imbalance.

In pseudocode:

def mid_price_diff(orderbook_events, trades):
price_diffs = EMPTY_DATAFRAME
for event in orderbook_events:
original_midprice = midprice at time of event
imbalance = imbalance at time of event
for trade in trades:
if time of trade > time of event and side of trade != side of event:
tick_midprice = midprice at time of trade
midprice_diff = tick_midprice-original_midprice
add row (imbalance, midprice_diff) to price_diffs
break
group price_diffs by imbalance
average midprice_diff for every imbalance value
plot imbalance against average midprice_diff

Time before fill is calculated in a similar way by taking the difference in timestamps between the two points in time. The procedure above can be easily implemented in any framework which works with data, such as Pandas in Python and R.

Empirically, the papers obtain the following observations.

The figures clearly show the functional relationship between the quote imbalance, price movement, and time to fill. By further manipulating these results in the context of a possible post as a broker agency, we can determine the probability of a ‘good’ or ‘bad’ order book event occurring in a close time horizon based on empirically calculating the ratio between the number of ticks which cause the price to increase to the total number of price ticks observed.

Further information, including a stochastic model and more detailed explanations of the calculations can be found in Lipton et. al (2013). They use empirical evidence to justify a model using stochastic processes and queueing theory to describe the behaviour. Putting it in a simplified way, they model the incremental quantities at the top of the book as stochastic processes:

where q^b and q^a are the quantities posted at the top of the order book respectively, and w^b and w^a are Brownian motions. More detail is then given about solving the PDEs formulated by queueing theory through coordinate transformations which remove correlation and cast the problem into polar coordinates.

All quants will find it useful to use the up-tick, down-tick and near-side trade probabilities to calculate expected values and variances for how the market microstructure might change before their order is filled.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
GDA Fund

GDA Fund

222 Followers

GDA is developing the decentralized financial application development environment and rapid financial engineering protocol built on Ethereum.