I'm trying to detect patterns from [open-high-low-close (OHLC)](https://en.wikipedia.org/wiki/Open-high-low-close_chart) data, so here is what I did:

1. Find local minima and maxima on the dataset
2. Normalize my data by converting the array of local minima and maxima to an array of numbers, where every number is the variation from the previous point.

Until now, everything works, but I got stuck on the following part.
I defined an array of data, which is a **pattern**, that when is plotted on a chart will have a certain shape. I'm now trying to find, on other datasets, shapes that are similar to the pattern I specified.

Here is the pattern specified by me:

```
Pattern = [7.602339181286544, 3.5054347826086927, -5.198214754528746, 4.7078371642204315, -2.9357312880190425, 2.098092643051778, -0.5337603416066172]

```

And here is a sample dataset:

```
SampleTarget = [-2.2538552787663173, -3.00364077669902, 2.533625273694082, -2.2574740695546116, 3.027465667915112, 6.4222962738564, -2.647309991460278, 7.602339181286544, 3.5054347826086927, -5.198214754528746, 4.7078371642204315, -2.9357312880190425, 2.098092643051778, -0.5337603416066172, 4.212503353903944, -2.600411946446969, 8.511763150938416, -3.775883069427527, 1.8227848101265856, 3.6300348085529524, -1.4635316698656395, 5.527148770392016, -1.476695892939546, 12.248243559718961, -4.443980805341117, 1.9213973799126631, -9.061696658097686, 5.347467608951697, -2.8622540250447197, 2.6012891344383067]

```

I'm looking for a way to detect when, at a certain point, on `SampleTarget`, is spotted a series of values that are similar to `Pattern`.

In this case, for example, I need to detect, somehow, that there is a part of `SampleTarget` where the values are similar to `Pattern`, since it's the same dataset from which i extracted `Pattern`.

What I tried:

I've been suggested to use `numpy.correlate`, `python-dtw` (Dynamic time warping), or [stumpy](https://stumpy.readthedocs.io/en/latest/Tutorial_STUMPY_Basics.html) but the problem I encountered with those is the lack of practical examples on this particular matter.