Segmenting Market Regimes by Trend and Volatility
Summary
The document explores ways to divide price histories into regimes with different trend and volatility characteristics, motivated by subjective segments in a short-interval EURUSD chart. It notes that a single large price bar may be an outlier rather than evidence of a lasting volatility shift, so real-time segmentation can require multiple observations. Historical segmentation may still be useful for comparing strategies, while computational cost matters for long minute-level datasets.
Suggested approaches include trend scanning: fit regressions over multiple forward horizons and select the slope with the strongest statistical significance relative to its standard error. This captures trends but does not directly identify volatility changes, and lower volatility may inflate the statistic. Another proposal clusters rolling return-distribution summaries using volatility and skewness, producing regimes that differ along both dimensions. Other responses suggest volatility thresholds, statistical change-point tests for location and scale, or using known trading-session patterns. These are starting points rather than a validated best method; choices of window, features, thresholds, and timing require research for the intended market and use.
Key ideas
- Trend scanning compares regression slopes across forward horizons using slope relative to its standard error.
- Trend scanning alone may not distinguish volatility regimes and can favor lower-volatility periods.
- Clustering volatility and skewness together can describe return regimes along two dimensions.
- Change-point tests can target shifts in both return location and scale.
- Trading-session patterns may explain recurring changes in volatility and direction.
Tags
Full text
# Identifying "logical" segments on trading charts # Identifying "logical" segments on trading charts The chart below is the 15-minute EURUSD from earlier today. The blue lines represent dividers between three subjective but reasonable segments that can easily be made out by the eye. I would characterize the three segments as: - Low volatility (mostly) neutral/horizontal trend - Higher volatility neutral or slight down trend - Higher volatility linear up trend I'm wondering if there are any existing algorithms or methods that could be used to identify dividing points between segments. By comparison, it's relatively straightforward to divide a chart into up and down swings given some minimum price increment but dividing based on multiple factors (trend and volatility in this case) seems more difficult. In theory, one could use any number of characteristics, including indicators. Something like comparing multiple moving averages would be easy, whereas determining where real-time volatility changes is not as easy (e.g., one large bar after a series of small might just be one outlier rather than a change in market dynamics). I'm not necessarily concerned about being able to do this perfectly in real time. Again for something like volatility, it would likely take multiple bars to know that the dynamic has changed, but even being able to do this on historical data might be helpful in terms of backtesting different strategies. Bounty Update: I've read about a number of different algorithms but can't seem to find one that will best capture what I'm looking for here. I think I could use a dynamic sliding window algorithm that uses spikes in Wasserstein distance that exceed a threshold, but I haven't seen anything that says that specifically. I'd really like to be able to do this over a year of minute data so calculation time is a factor. There's so much scattered information about time series segmentation so I'm hoping someone can give some more direct advice. ## Answer by Sean Thoman (score 1) https://quant.stackexchange.com/a/57948 You could look into the trend-scanning method which is described in a new book by Marcos Lopez de Prado, "Machine Learning for Asset Managers". Essentially you fit a linear regression to multiple forward looking periods of increasing length (say you scan from 5 periods ahead, to 50 periods ahead) and choose the regression fit with the highest slope adjusted for standard error of the fit (Slope / SE) or t-statistic. The intent is to let trends run to the extent that they are more 'statistically significant' than others in the test, meaning they have less potential to be due to random chance or noise. This isn't exactly what you want but it is along the same lines, I think. The issue is that lower volatility would typically result in a higher t-stat given an equivalent slope (trend) and you actually want to capture changes in volatility as well. Regarding clustering you could cluster summary statistics from the distribution of returns in a 2-dimensional instead of a 1-dimensional space. Use volatility (or variance) as the 1st dimension and skewness as the 2nd dimension. Thus you are clustering 2D points in a 2D space along both axes, and including positive or negative skew (more positive versus negative returns or vice versa). This could capture at least 4 overall 'categories' or dimensions of the return distribution and at different granularities depending on how hyper-parameters are tuned, - Low volatility, negatively skewed - Low volatility, positively skewed - High volatility, negatively skewed - High volatility, positively skewed ## Answer by babelproofreader (score 1) https://quant.stackexchange.com/a/57951 I don't know, because your chart shows no time stamps, but I'd hazard a guess that the first third is the "overnight" session after the New York close until the London open, the second third is the London open until the London close, and the last third is the remaining part of the trading day until the New York close. If this is so, you don't necessarily need an algo to identify high/low volatility or trends, but can make use of some stylised "facts." A few might be:- - The "overnight" session will always tend to exhibit low volatility compared to London/New York trading hours. - Most of the time there will be a change of market type/direction on both the London and New York opens as new participants begin trading, with increases in volume at both times, compared to what has been the norm for the previous few hours beforehand. - Ranges/support/resistance/trends set up in the immediately preceding session hours can provide hints towards future market types/direction on breaks and bounces etc. My point being it's not necessary to throw computing power at this problem, but rather it is a problem of market understanding, based on some research of course. ## Answer by user24980 (score 0) https://quant.stackexchange.com/a/54133 Why not using a volatility indicator if volatility is the only factor? set 2 thresholds and you are done. Separately recommend the read of a time series analysis or econometrics book, which will provide you with a deeper understanding. ## Answer by user42108 (score 0) https://quant.stackexchange.com/a/58627 Seems you're trying to segment based on volatility and trend which might be two different/separate problems. Googling 'change point detection' might be a good start (or see https://arxiv.org/abs/2003.06222). There are tests which test for both changes in location and scale (i.e. trend and vol).
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.