Hello. I am doing a paper on technical analysis pattern recognition using Stata. Below is my initial work.

Array

I also attached the data set. I am trying to replicate a paper titled "Technical Analysis," which is also attached to this post.

Now I want to code in order to detect the following patterns.
Array