There is already an indicator that exists that does something similar. It's called the '
Custom Pattern Indicator'. There are some little differences though. For example, it will draw a box around the pattern sequence instead of an arrow. You can also have it find different pattern sequences in case you change your mind. It will also go back in history and find statistics. You might want to check it out.