Serving the Quantitative Finance Community

 
User avatar
CommodityQuant
Topic Author
Posts: 57
Joined: July 5th, 2007, 6:16 am

Spotting time of trend reversals

December 20th, 2022, 6:33 pm

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
 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Spotting time of trend reversals

December 22nd, 2022, 2:21 pm

I would start with a naive solution: minima/maxima of moving averages. 

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.
 
User avatar
CommodityQuant
Topic Author
Posts: 57
Joined: July 5th, 2007, 6:16 am

Re: Spotting time of trend reversals

December 22nd, 2022, 7:58 pm

I would start with a naive solution: minima/maxima of moving averages. 

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
 
User avatar
katastrofa
Posts: 7440
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Spotting time of trend reversals

December 24th, 2022, 2:40 am

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.
 
User avatar
katastrofa
Posts: 7440
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Spotting time of trend reversals

December 26th, 2022, 11:09 pm

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.
 
User avatar
tags
Posts: 3162
Joined: February 21st, 2010, 12:58 pm

Re: Spotting time of trend reversals

December 30th, 2022, 12:07 pm

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)
 
User avatar
katastrofa
Posts: 7440
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Spotting time of trend reversals

December 30th, 2022, 4:36 pm

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.
 
User avatar
katastrofa
Posts: 7440
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Spotting time of trend reversals

December 30th, 2022, 5:03 pm

Ps, I don’t understand the purpose of such a naïve data analysis, but that’s what OP requests.
 
User avatar
tags
Posts: 3162
Joined: February 21st, 2010, 12:58 pm

Re: Spotting time of trend reversals

December 30th, 2022, 7:41 pm

I works great according to the authors  :D
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).
 
User avatar
katastrofa
Posts: 7440
Joined: August 16th, 2007, 5:36 am
Location: Alpha Centauri

Re: Spotting time of trend reversals

December 31st, 2022, 2:30 pm

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? :-)
 
User avatar
tags
Posts: 3162
Joined: February 21st, 2010, 12:58 pm

Re: Spotting time of trend reversals

January 1st, 2023, 9:25 am

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).