This article is meant to be complementary to the next few articles where we look into some algorithms that identify liquidity zones in an assets price data. It is not absolutely necessary to read but, especially if you're not familiar with data analysis or machine learning it is highly recommend you familiarize yourself with this topic as it will help you understand the next couple of articles.
The concept of clustering is basically the means of grouping certain points in data in categories based on them being similar to each other. If you are familiar with machine learning you'll know that there are two broad categories: supervised learning and unsupervised learning. Since there are no labels in our data (the point is to label it in the first place) clustering comes in handy as it is part of the unsupervised learning methodology.
Clusters are nothing more than simply groups of data that are categorized together based on certain characteristics. There are two types of categorization methods or clustering:
- hard clustering: is one an element is placed in a certain cluster absolutely. This element will usually only be placed in a single cluster.
- soft clustering: rather than placing elements in clusters with certainty, element are "marked" with a probably of belonging in a certain cluster. These probabilities can be distributed across multiple
So in other words clustering is a way of ordering or homogenizing unstructured data. So in this context we can use prices levels, price movements, trading activity and volume to identify liquidity zones buy clustering prices ranges were a lot of activity occurs which will most likely be the place with most liquidity. So this can include support and resistance or areas where stop losses have accumulated. And based on these kinds of historical prices values, we can cluster them as high liquidity prices. This is a really way of analytically categorizing prices.
When prices revert to or hover around certain points, we can consider this a densely traded zone. Densely traded zones are usually associated with high liquidity. So we can cluster areas with high trading activity which we can infer are places where orders are placed. In most analytical trading systems we have a concept of "history repeating itself" or current activity "mirroring" past activity as a general assumption. So if we see price reacting to a certain level historically we can infer that it is an area of interest. Through these clusters we can see that price seems to tend towards certain levels which we will then consider to be our liquidity zones.
I want to cover the limitations of clustering also. First of all is that clustering depends a lot on parameters. So it may require a bit of extra work in terms of getting the goldilocks zone for these parameters just right. Also market structures are dynamic and sometimes change in this structure might not get picked up right away by our algorithms. This is why I like to combine many algorithms before confirming or taking a decision so that way i have more convergence and one method's weak points can be another method's strength.
There are many types of clustering algorithm. But one thing the have in common is the fact that they both use the concept of similarity measurements. In short, these similarity measurements are defined by the density of the clusters and the proximity of the data points within these clusters. This proximity can be literal distance between points in a 2D space and since this is how we can visualize price charts we will take this definition of proximity.
I could go on and on about clustering but I think this information is enough to get a grasp on the topic. Sp I'm going to shut up for now and start working on the actual implementation of this concept in a more practical way.