I have been live trading using algorithmic strategies for a year. I have good periods, lasting about two months, followed but bad periods of few weeks. I did the necessary statistical tests to ensure that good periods are not the result of sheer luck, but rather consistent and significant performance.

I am now wondering whether I could identify market regimes that are correlated with my trading performances. This would provide a tool to decide when to start/stop my algos. I will start with what seems obvious to me: volatility and asset correlations.

I have little experience in this field so I would like to find standard methods if they exist, papers or discussions.

  • 2
    $\begingroup$ Aside from regressing your strategy features/performances on the market's features (like returns, volatility and so on) to find some meaningful threshold, when I read "market regimes" I'm used to think about Hidden Markov Models. So take a look at some library which makes the dirty job for you (like this) and give a look at a 2 or 3 states model: by investigating a link between the market state and your strategy performances you should find what you're looking for. $\endgroup$
    – Lisa Ann
    Apr 26 '19 at 13:11

I think you are right in saying that under certain market states your models perform poorly. There are a few useful tools that you could make use of.

Starting off we look at useful financial features, one being structural breaks.

Structural breaks are generally split into two groups (de Prado 2018):

  1. CUSUM Tests
  2. Explosiveness Tests

For CUSUM tests you can have a look at:

  1. Brown-Durbin-Evans CUSUM test on Recursive Residuals.
  2. Chu-Stinchcombe-White CUSUM Test on Levels, which follows Homm and Breitung 2012

For Explosiveness Tests:

  1. Chow-Type Dickey-Fuller Tests, Chow, 1960
  2. Supremum Augmented Dickey-Fuller, Peter C. B. Phillips Yangru Wu Jun Yu, 2011
  3. Sub- and Super-Martingale Tests, Greene, 2008

It would be even better if you train a secondary ml model to help filter out the false positives. I have advocated for this technique before:

"Whilst reading this I realized that it would be a really good application for meta-labeling. The idea behind meta-labeling is to build a second model that determines if the signals {0, 1} from the primary model are correct or not.

By doing this the secondary model outputs a value between 0 and 1 indicating how confident the model is that the primary model is correct or not. This output can then be passed to a bet sizing algorithm which maps the output to a position size. The core idea being that we want to take large positions on trades that are likely to be true and smaller positions on trades when we are unsure.

To give some intuition behind this. Lets take a trend following strategy as an example. Now moving average crossover strategies are known to under perform when the market moves sideways. The choppy nature causes a lot of transaction fees.

The secondary model will pick up that under some volatility conditions and perhaps a low auto correlation, that we are in a side ways trend and thus the primary models signal (a 1 in this case) is likely to be false and so it assigns it a low probability.

More about this technique can be read about in Chapter 3 of Advances in Financial Machine Learning. A toy example of meta-labeling can be found here "Meta-Labeling on MNIST Data."

  • $\begingroup$ Thanks for that, I'm exploring your last suggestion. $\endgroup$
    – David
    May 22 '19 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.