Click here to Skip to main content
15,881,671 members
Articles / Artificial Intelligence / Machine Learning
Article

Finding Market Liquidity Insights with Data Science

18 Aug 2020CPOL6 min read 3.7K   1  
An often neglected — but ultimately fundamental — driver of financial markets is liquidity. Combining data science skills and techniques, the Refinitiv Labs Liquidity Discovery project provides in-depth market liquidity insights to enable more informed trading decisions.
In this article we look at the ways the Refinitiv Labs Liquidity Discovery project is helping to explore new ways to discover market liquidity, through concepts such as trading aggressiveness, price impact, volatility of liquidity, and pricing liquidity.

This article is in the Product Showcase section for our sponsors at CodeProject. These articles are intended to provide you with information on products and services that we consider useful and of value to developers.

  1. The Refinitiv Labs Liquidity Discovery project helps visualize historical and current Limit Order Book (LOB) liquidity using modern data science and visualization techniques.
  2. Traders can apply these market liquidity insights to improve their algorithms, and make more informed decisions.
  3. To learn more about how to leverage real-time liquidity analytics in trading, tune in to Refinitiv Labs’ virtual lab on Liquidity Discovery.

For more data-driven insights in your Inbox, subscribe to the Refinitiv Perspectives weekly newsletter.

A liquid market implies a significant trading volume, and a favorable market condition for investors and traders — high supply and demand for an asset, and low trade risk. Having visibility into market liquidity helps us understand where and when to make trades.

To get accurate liquidity data, we usually look for liquidity information in the venue limit order book (LOB). However, the order book is constantly changing as orders are added, filled, and canceled.

Algorithmic trading contributes significantly to trade volume in the order book, making it hard to follow in real time. Moreover, not all information is visible due to hidden and ‘dark’ orders.

Join Refinitiv Labs for a look at the data prep and visualization techniques behind a live innovation project for the trading community

How can we use data science to find a solution?

At Refinitiv Labs, we spotted this issue and spoke to a number of customers. They said that more insights into market liquidity conditions would help them understand past trades and improve future trading decisions. In times of increased uncertainty and volatility, caution is necessary when executing orders.

Following this customer feedback, the Refinitiv Labs team looked for a data-driven solution to understand historical and current LOB liquidity using modern data science and visualization techniques and skills.

The Refinitiv Labs Liquidity Discovery project grew out of this effort, offering a meaningful representation of liquidity in the LOB instead of just a blizzard of numbers.

So, who might benefit from deeper insight into order book liquidity?

Sophisticated traders

With markets getting smarter, many trading strategists use sophisticated models based on quantitative analysis for trading opportunities. According to the 2020 Algorithmic Trading Market report, over 60 percent of U.S. equity market trades are guided by algorithmic trading.

Theoretically, sophisticated trading can result in profits gained at a speed and frequency not possible for a human trader. However, algorithms are only as good as their input data. A more accurate view of market liquidity leads to better algorithmic trading decisions.

Execution analysts

Execution analysts are responsible for decision-making. Part of their job is risk management and developing predictions for future investments. They also analyze liquidity conditions post-trade to help explain abnormal impact and slippage.

An in-depth knowledge of market liquidity is key to enable them to answer questions such as “why did this trade move the share price more than expected?”, or “why did the execution price significantly differ from expectation?”.

Liquidity sourcing specialists

According to a 2019 survey by JP Morgan, “liquidity tops the list of daily trading issues” for the company’s foreign exchange clients.

Sourcing liquidity requires ongoing qualitative and quantitative assessment, and for a liquidity sourcing specialist, the only way to show leadership — and returns — is to have a complete understanding of a market’s liquidity situation.

Risk analysts

A better grasp of market liquidity also helps to mitigate liquidity risk. You wouldn’t want to end up in a situation where an instrument can’t be bought or sold quickly enough in order to avoid or minimize loss.

Refinitiv Labs Liquidity Discovery

The Refinitiv Labs Liquidity Discovery project started as a single Jupyter Notebook, with the goal of providing real-time insights into liquidity conditions encoded in LOBs.

The project began by capturing historical liquidity data available through the library of Refinitiv sources and API feeds. Data preparation and visualization refinements were an important early step.

Working in Jupyter allowed us to iteratively import and prepare order books data, and then test our hypotheses about what metrics might help us better understand LOB liquidity. We used libraries like Matplotlib and Seaborn to quickly prototype and refine meaningful visualizations of LOB data.

The end result is a series of visualizations that show liquidity over time, as well as data along multiple dimensions, including market depth, tightness, resilience, trading aggressiveness, order imbalance, the volatility of liquidity, market response, and so on.

These visualizations offer traders a comprehensive overview of liquidity conditions, both current and historical.

Traders can use these market liquidity insights to improve their algorithms and make better decisions on manual orders.

In addition, all of the liquidity metrics are available via a feed API, so Refinitiv customers can easily integrate the discovery data into their own platforms and algorithms.

Watch — FRTB calculations: Could months in Excel be seconds with machine learning?

Pricing liquidity

The costs of transacting and the notion of liquidity are considered a performance measure of market structure. Refinitiv Labs can present a visualization of liquidity via the pricing of limit orders.

Limit orders offer the right to trade up to a fixed quantity at a constant price for a certain period. Analyzing the price-over-time graph for LOBs allows you to gain a better understanding of market liquidity.

Image 1

Limit Order Book depth versus price profile

The LOB shows the number of open buy and sell orders at different prices. Plotting this data against the price profile provides a more in-depth view of market liquidity.

The spread may widen significantly if fewer consumers are placing limit orders (therefore generating fewer bid prices), or if fewer sellers are offering their services.

The plot indicates the shape of liquidity for a particular security, and may help traders determine where prices are headed in the near future.

Image 2

Volatility of liquidity

Market liquidity measures how smoothly and quickly large transactions are executed, which affects market volatility. The market tends to fluctuate more rapidly if a lack of buy or sell orders is observed.

Image 3

Price impact

Price impact indicates the correlation between incoming orders to buy or sell, and the corresponding price changes. Buy trades may push prices up and incur extra costs for large trading firms, which is why monitoring and controlling price impact is critical in quantitative finance.

Image 4

Trading aggressiveness

Trading aggressiveness looks at trading volume in relation to typical order size in the LOB. Unusually high volume relative to sizing is often an indicator of toxicity driven by informed orders.

Image 5

Market liquidity insights in financial data

In an increasingly uncertain market, market liquidity offers a valuable source of insights to make more informed trading decisions.

The Refinitiv Labs Liquidity Discovery project is helping to explore new ways to discover market liquidity, and we are continuously seeking customer feedback to fine-tune this living prototype.

Visit our website for more information on the work of Refinitiv Labs, and to learn more about the Liquidity Discovery project, join our virtual lab.

Image 6

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
Joel is a senior data scientist at Refinitv Labs NYC, working the area of market microstructure and analytics for liquidity, fragmented markets, trading, and execution.

He earned his PhD from New York University in Physics, and has worked extensively in technology in financial industry for Merrill Lynch BofA, Bloomberg and now Refinitiv.

His main interests center on applying physical concepts to markets that have resulted in multiple articles describing fast measurements of current market volatility and correlation (eVol, eCorr), and is co-inventor the latter.

He is currently working on a suite of derived liquidity analytics as a product feed that uses limit order book data.

Comments and Discussions

 
-- There are no messages in this forum --