multi-strategy trading with regimes
One of the challenges of algorithmic trading is that although there’s plenty of interest in the space, practitioners aren’t generally forthcoming about their observations. Academics, instead, focus on things that are frequently not very immediately practicable, or when they might be, always seem to set-up a little hedge-fund on the side while publishing colorful chum about how markets are ‘behavioural’ or somesuch.
Even if it’s hard to find good stuff, one must still look as there’s always more information that can help you than you can effectively process or retain. A few weeks ago I was trying to formalize the expected profit function of an algorithm I’m developing and wanted to see what people had written about the topic. I entered ‘define profit function for trading algo’ into google and was pleasantly surprised to see a paper entitled ‘Multi-strategy trading utilizing market regimes’ by Mlnarik, Ramamoorthy and Savani. It doesn’t directly cover the topic I was looking for, but instead addresses a number of related topics I’ve been interested in for some time:
- the treatment of a strategy as an instrument in its own right
- composing portfolios comprised of strategies
- using regime switching techniques to manage portfolios of strategies
In this post, I’ll briefly review their paper, illustrate how one can easily model strategies in relevant ways using the strategy ‘object model’ I’ve described previously through an example, and conclude with some thoughts on how these kinds of strategies might be implemented and further explored.
‘Multi-strategy trading utilizing market regimes’ by Mlnarik, Ramamoorthy and Savani
Their paper begins:
This paper considers the problem of dynamically allocating capital to a portfolio of trading strategies. The allocation should be robust, and the capital allocated to a trading strategy should reflect the confidence in the expected profit that the strategy will make in current market conditions.
Good trading strategies exploit recurring market dynamics that can be more prevalent in some time periods than in others. Indeed, the concept of regimes is fundamental to financial markets, and much research has focused on the detection of regime shifts. In this paper, we consider a regime as defined by a set of trading strategies that exhibit similar performance in a given time period.
We consider different parameterizations of the same strategy as distinct in our ground set of strategies. The trading problem is to pick a distribution over the ground set that will achieve good performance in the current time period.
They start with some interesting definitions. A trading strategy is defined as a function which takes a given market State and generates a convenient Answer “denoting all possible trading decisions”. Strategy functions can also be parameterized and different parameterizations of the same function/strategy are viewed as distinct qualitative strategies. They assume the existence of the set of all strategies. A regime is defined as a set of trading strategies who behave similarly over a given period of time where similarly is measured by the variance of a fitness function.
So they start with a set of strategies, a fitness function and some historical market data or state, and their first task is to identify the regimes. They do this by running the strategies against randomly selected partitions of historical data, quantifying their respective performances with the fitness function and identifying the clusters deemed statistically significant. Those sufficiently significant and similar sets of strategies are themselves the reasonable regimes while the set of strategies within all the reasonable regimes are themselves dubbed the reasonable strategies – the candidates for execution. This might sound strange, but as I’ll illustrate with a concrete example below, this is actually a pretty effective and even intuitive way of defining regimes.
They define function stFuncDist as, for any regime, generating a distribution or weighting of the strategies within the regime. While classifyMarket is a function that generates a distribution across all regimes for any given market state. Both models can be “trained” and they do so by again iterating randomly across chunks of historical data adjusting the weighting constants of these two functions.
Finally, it’s time to trade and they can effectively use classifyMarket to determine a predominant regime and allocate capital as indicated by stFuncDist to the appropriate set of “reasonable strategies.”
They claim to have utilized this technique to generate the results charted in Figure 1, but they give little detail on the initial universe of strategies. I believe they had one strategy which was parameterized into a set of qualitative strategies and run across one market, the CME’s Nasdaq emini. I have no reason to doubt that they had exactly this result, but without more details on what they actually did, it’s hard to view it as very meaningful, though it certainly is suggestive. An interesting thing about how they present their result, which I’ve seen in other academic papers, is that because they’ve precisely defined the set of possible strategies they look at, they can also calculate max and min possible returns over the relevant period.

Figure 1: Out-of-sample profit (middle line) versus possible min (bottom line) and max profit (top line) over all strategies for the period 2006-11-01 to 2008-08-28.
The paper continues with another section, but I’m going to stop my overview here as the last part is less interesting to me and the interested reader should of course read it themselves.
complex strategies or simple strategies combined
One of the broadest design questions I see for the development of effective trading algorithms is whether one should employ complex, customized algorithms or instead utilize simple algos which can be simply combined to produce emergent complexity. Although the authors of this paper allude to “Good trading strategies”, I wonder if one can even forget the “good” part and instead worry about applying – even bad! – strategies at the right times.
There are a lot of things I like about this paper, but probably most of all it’s their definition and use of a regime. One of my first posts describes a pair of strategies – a simple mean reverter and a simple trend follower. These two strategies are about as dumb as you please. And yet, their behavior is pretty interesting apart the observations I’d published at the time regarding the distribution of their returns. During the trading day, I’ve taken to running those two, old, dumb strategies across a variety of markets in simulation mode. Why? Because it’s easy, costs me nothing and actually is pretty interesting in that the strategies really do cluster in the way Mlnarik et al describe, effectively partitioning the market into visible regimes.
a simple example: identifying regimes with strategies
In order to illustrate this, I created a desktop within stratbox onto which I ran these two qualitative strategies parameterized differently and across six different markets. In total, I have 48 strategies running with 24 of the mean reverting (MR) variety and 24 of the trend following (TF). In figure 2 and figure 3, they are sorted by qualitative strategy – all of the MR strategies followed by all of the TF strats. In figure 4, they’re instead sorted by instrument at the end of the day after all of the strats had been rendered quiescent for the night by their schedulers. You can click to see a bigger version of these screenshots. On each, the left side of the screen shows simple charts of the relevant markets while the right contains a table in which each line item is a running strategy. The first is at the beginning of the day. the second is shortly before going silent at 4pm and the third is shortly after 4pm.

Figure 2: variously parameterized MR & TF strats run in realtime+simulation mode. Sorted with the MR strats first. (click)
You’ll note that at all times throughout the day, the MR and TF strategies effectively mirrored each other regardless of market. Although I’m not going to illustrate it, I’m going to just go right ahead and assert that this is almost always true based on what I’ve seen. And this is at the heart of the paper’s authors’ insight regarding regimes – they can be effectively identified by examining the performance of even simple but well-defined strategies.
This suggests a simple means of implementing a similar design to that they described right on top of this example I’ve put together.
modeling meta-strategies
We need one more element to manage all of this – a meta-strategy – that is, a strategy for managing other strategies. We support this idea in stratbox with what we call a controller strat. The cannonical example of a controller strat is our implementation of the (Don’t) Panic button (the bright red button with an ! in the upper right hand corner) which will get all strategies out of the market with varying degrees of urgency and finality. This is implemented as a controller strat which injects a stratpart into all running strategies. The injected stratpart first deactivates its peers and then cancels outstanding orders and then gets out of the market with whatever urgency the user has required.
allocating to portfolios of strategies
In my example above, I have 48 strategies running in simulation across 6 futures markets. Let’s imagine that at any moment in time, I will always have at least one strategy of each type (MR and TF) running for each market. Thus, I’ll always have 12 live strategies running against real money accounts and 36 candidates running against a simulator. Effectively, we’ve just described a portfolio of 12 elements where each element is itself a strategy.
It’s not difficult to imagine implementing a controller strat which on a regular schedule will simply adjust the parametrization of the running strategies and their allocation of cash based on the performance of the strategies running in simulation.
It’s not difficult to imagine, but implementing it inevitably poses a variety of challenges not least of which is finding the time! For now, we’re still finding new and interesting ways to express strategies which deal with portfolios of exchange-traded instruments. But I think that this is just a point on our technology’s maturation curve which will ultimately lead to the regular development of strategies which operate on portfolios of strategies themselves…
Anyway, it’s nice to see a bit of academic work formalizing what I expect is a natural step in the evolution of trading algorithms.
EMS Internals, dereferenced, portfolio management, regime-switching, strategy development


tito – Excellent post. I have I have been experimenting with this idea for a while now, albeit in less complex terms.
I have also been doing a lot of research on the idea of turning a strategy on/off on a live account based on its recent performance on a sim account and then re-estimating the dollar allocation to each strategy. I have been analyzing the results in terms of whether or not the strategy positively impacts the strategy as a whole.
Its always interesting to see new work in this area as the majority of anything that is found is never published.
Regards,
Eric
Thanks, Eric – I’m glad you enjoyed it.
What is the fitness function the authors use, and what is your favorite?
On another note, did I understand it correctly that you are running 48 strategies, half mean-reverting and half trend-following? Why did you pick only six markets, and why did you pick those six markets?
Are the 48 strategies just different parameter sets of two strategies, or are they unique on a more substantive level?
Interesting post, Tito. We should chat, given myself and several collaborators are working on very similar quant regime multi-strategies–as alluded to in the Market Regime Dashboard post.
Milk, I looked at your blog and saw that you have something of a fitness function fetish… I could hardly live with myself were I responsible for providing you another excuse not to read the source paper itself! ;^>
As for your interpretation re: strategies – you got it exactly right. Two distinct strategies, parameterized differently across six markets in four ways: 2 strats * 6 mkts * 4 paramChanges. My choice of markets was essentially random. I chose the # of total strats based on what would comfortably fit on one screen for display purposes.
@quantivity
Thanks – I’ll take a look at what you’re up to..
Tito, I recently discovered your blog by way of MarketSci. I am very focused on the concept of trading a strategy of strategies and search high and low for inspiration on “regime switching techniques”. Your work is very interesting to me and I am intrigued to see where this particular thread goes. Thanks for sharing your efforts thus far.
John
The concept of identifying regime change has been around quite a while.
But don’t forget that one risk is being traded for another. In this case, whipsaw risk. Still, I think more traders will start implemting some type of regime identification. That in turn will lead to more herding type of behaviour. It’s still tempting because if you get regime correct, you can use any set of rules and produce good returns.
@John French
Thank you – I’m glad you find it interesting. Check out the more recent posts ‘ready to launch’ and ’sensitivity testing’ as they continue the theme.
@mo
Good points!
Here is the pdf file with slides :
http://homepages.inf.ed.ac.uk/sramamoo/docs/AMLCFSlides.pdf