# Determining up/down market trends in timeseries data

I want to divide the time series data into two subsets (upside and downside markets) using some statistical methods.

From the graph, it looks like

early 2004 to mid 2008 : upside

mid 2008 to early 2009 : downside

early 2009 to early 2011: upside

early 2011 to early 2012: downside

early 2012 to mid 2015: upside

mid 2015 to mid 2016: downside

mid 2016 to late 2017 : upside.

Is there any method to divide the dataset into two (upside and downside) in a logistic and systematic manner?

Thank you.

Such a computation is implemented in the function streaks in the R package PMwR (which I maintain). An example, taken from the package docs: the upper graphic shows an equity index (the DAX) for the years 2014 and 2015; the vertical lines show the period of maximum drawdown. The second graphic shows the split into up and down moves, for a threshold value of 10%. The vertical scale is a log scale, i.e. a drop of 50% takes the same vertical distance as a rise of 100%.