One potential use I could imagine would be identifying paradigm shifts / regime change. Just as a quick toy example, maybe you're interested in how gold is often considered a hedge against downturns in the stock market. Say you are building a trading strategy based on that intuition, but want your model to be more flexible by identifying different regimes for which different approaches might work better. Clustering methods might help in that analysis. Here's a quick example of how one might visualize that type of thing.
I also found a few resources on the web after a quick search that you might find interesting.
- Dynamical analysis of clustering on financial market data
- Cluster Analysis for Evaluating Trading Strategies
- Survey of Deep Learning Techniques Applied to Trading (more general ML but still a good read)
R code used to make the plot:
library(Quandl)
syms = c(SP500="YAHOO/INDEX_GSPC.4", Gold="CHRIS/CME_GC1.6")
nmeans = 3
prices = na.omit(Quandl(syms, type='xts'))
df = as.data.frame(prices)
clusters = kmeans(df, centers=nmeans)$cluster
par(mar=c(2.5,2.5,0.5,0.5), mgp=c(1.5,0.5,0), family='mono', cex=0.7)
x = as.numeric(prices[,1])
y = as.numeric(prices[,2])
plot(x, y, pch=-1, xlab=names(syms)[1], ylab=names(syms)[2])
for (i in 1:nmeans){
xx = df[clusters==i,1]
yy = df[clusters==i,2]
points(xx, yy, pch=19, col=rgb(t(col2rgb(i)/255), alpha=0.2))
f = lm(yy~poly(xx, 3))
lines(x=xx, y=predict.lm(f, data.frame(x=xx)), col=i, lwd=2)
}
grid(lty=1, col=rgb(0,0,0,0.2))