1

I am trying to write the code to find the following pattern anywhere in the chart.

It is very hard for me to understand how to do it or how to start or how to think about coding it.

As an example, I want to detect the following pattern, where there are 5 higher highs and higher lows.

The issue is that among the pattern and inside each line there might be several small highs/lows that makes me confuse how to filter them .

I tried to provide several examples of the pattern. The pattern has 5 higher highs, the lows are higher lows, I would like to cluster every 5 highs as one pattern, now if there is 7 higher highs, there will be two of this pattern with overlaps (but that is the next step, at te moment I dont even know how to start).

enter image description here

I would really appreciate any help on how to start coding and thinking about the solution for such a pattern detection.

sey eeet
  • 229
  • 2
  • 8
  • 1
    The easiest start is to define what patterns you want to find and write "algorithms" if you will to detect them. So you would write a function or something that would read the data and store the values in a way to identify a pattern when completed searching. Then get more complicated as you go along. This is an oversimplification but hopefully makes sense. – Mike Q Feb 01 '23 at 15:21

1 Answers1

0

Start by learning what solutions there are already. You can find many Built-ins by tradingview here that may even satisfy your needs.
Next you can search among the community scripts and learn from them:

From a programmatic perspective, pivot points could serve as a base for pattern recognition. So check out the pivot and zig zag indicators for some ideas.

elod008
  • 1,227
  • 1
  • 5
  • 15