Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
pattern finder

Hello, i am working on this idea of finding in the historical prices of a security some pattern that are similar to the current one
(more detailed explanation in the notebook)

I have this problem:
i choose correlation (spearman) to decide wether or not 2 patterns are similar, and i have done it just because i have a p_value that confirm the correlation.
The other condition in that the 2 patterns must have a performance quite similar (5% plus or minus) overall
The problem:
when i plot the patterns they don't seem very much correlated, so maybe someone can point me in a better direction to find patterns similarities

thank you
-Giuseppe

5 responses

what's odd that when you choose a short pattern you get less matches then if you create a long pattern. Intuition says it should be the other way?

hi Peter i think the problem is in the fact that the correlation is based on the p_value so it's not very efficent for short series like this.

I'm having lots of troubles to identify the right aproach to perform the correlation function because - for example - not all values of the series has to be correlated the same way, maybe high and lows or start and ends anr more important than the in-between noise

slightly improved, but still nothing special for now..

Anyone have some suggestion about the logic to apply to extract similar patterns beside correlation?

@ Giuseppe Moriconi how can we use this to find identical chart? say... I want to find.. identical chart of S&P500 for example... thanks.

Anyone can help to fix the code for Quantopian version 2?