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.