Serving the Quantitative Finance Community

CommodityQuant
Topic Author
Posts: 54
Joined: July 5th, 2007, 6:16 am

### Spotting time of trend reversals

Suppose we have a graph of noisy real-world data such as market tick data of midprices of a given instrument.
The naive human eye can readily spot trend reversals (these may be random noise but they are trend reversals
nevertheless).  For example, an uneducated observer can say:  "Hmmm, the prices kept increasing until 14:16 but
then they suddenly started decreasing."  I want to know how to algorithmically locate the time of a trend reversal
(14:16 in this case) in such a way that will match ordinary common sense and human judgment.
Of course, this is a difficult problem, but I'd love to have a gateway into industry approaches.
Obvious naive solutions don't work.  You can look at local minima/ maxima but they will identify time points in a sequence
like 100 101 100 101 100 101 etc.
Obviously, the problem is not completely well-defined so there's not a unique solution.   Signal processing and linear regression
are obvious tools.  Maybe the best help is just to give a phrase that will lead to the correct google search.

Thank You

CommodityQuant

Alan
Posts: 2767
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

### Re: Spotting time of trend reversals

The default has to be a random walk, however, so that you are simply constructing time points that may be visually suggestive but have no out-of-sample predictive implications.

For (attempting to find) predictive models, the starting google phrase is probably "autoregressive moving average". Generally, one doesn't use prices, but returns, in that case.

CommodityQuant
Topic Author
Posts: 54
Joined: July 5th, 2007, 6:16 am

### Re: Spotting time of trend reversals

The default has to be a random walk, however, so that you are simply constructing time points that may be visually suggestive but have no out-of-sample predictive implications.

For (attempting to find) predictive models, the starting google phrase is probably "autoregressive moving average". Generally, one doesn't use prices, but returns, in that case.
Thanks a lot.  I'd agree that that seems like a good approach.  The aim is not predictive at all.  The aim is to algorithmically identify peaks and troughs
(after the fact) in the way that a naive human eye would.  For confidentiality reasons, I can't talk much about this but maxima/minima of moving averages
seems a great proxy for peaks and troughs.  I have spotted some academic literature on detecting slope changes which is along the lines of what I need,
but I think those papers are a bit too sophisticated.

Thanks Again,

CommodityQuant

katastrofa
Posts: 7162
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

### Re: Spotting time of trend reversals

I’d definitely go for a neural network model if classification is the main goal. Label your data or generate a synthetic dataset (semi-supervised training is an option too) and start from a simple RNN model. Use moving average etc. as baseline. Once you understand the data more, you’ll change the network of build a more complex architecture.

katastrofa
Posts: 7162
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

### Re: Spotting time of trend reversals

Second thoughts, recurrent network - if deep enough - can find more complex trends, spreading across different time periods and overlapping. If you want to imitate a guy with a marker, though, make graphs out of your data trends, frame what you consider a “trend change” and train an object detection network to recognise such objects.
Search for tutorials on object detection using neural networks. Should be some CNN architectures.

tagoma
Posts: 2738
Joined: February 21st, 2010, 12:58 pm

### Re: Spotting time of trend reversals

Hello kata.
Based on a few recent posts of yours you’re pro NN with structured data?
Regarding the last part of your last message, don’t you think visual detection is super inefficient / resource consuming for this use case? (There is a paper of jpm or another IB I don’t remember well that applies such technique)

katastrofa
Posts: 7162
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

### Re: Spotting time of trend reversals

Yeah, labelling the training data takes time but can be easily outsourced these days. Also if the data is very noisy NN may not train well (another model to preprocess it?).

Do you have a link to that paper? Curious how it worked.

katastrofa
Posts: 7162
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

### Re: Spotting time of trend reversals

Ps, I don’t understand the purpose of such a naïve data analysis, but that’s what OP requests.

tagoma
Posts: 2738
Joined: February 21st, 2010, 12:58 pm

### Re: Spotting time of trend reversals

I works great according to the authors
The paper I was thinking of this one Trading via Image Classification .
Maybe the idea of the authors it slightly different from what you had on your mind, I don't know.
I thought this paper was a joke the first time I stumbled upon it, to be honest (you know like sometimes there are fake research papers on arXiv).

katastrofa
Posts: 7162
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

### Re: Spotting time of trend reversals

Thanks. That’s basically the same idea. Do you know by any chance of they made some money on it or was it just as bad as technical analysis?

tagoma
Posts: 2738
Joined: February 21st, 2010, 12:58 pm

### Re: Spotting time of trend reversals

Thanks. That’s basically the same idea. Do you know by any chance of they made some money on it or was it just as bad as technical analysis?

hey kata. I have no insiders on the Banking World. My little theory though is that such piece of research is for marketing purpose (only).