# An Application of the Associate Hopfield Network for Pattern Matching in Chart Analysis
## 5 Discussion  
We proposed a lightweight pattern matching method by utilizing the learning associative Hopfield network, which is a non-distance-based approach that combines the segmented representation method. By using the synthetic data generated from the 11 traditional trading chart templates, we conduct experiments with different levels of noise and distortion. We discover that the scaling PIP performs better than the ED and the traditional PIP methods. Its matching results are slightly worse than DTW but cost less time during the matching process. Furthermore, when the number of stored patterns does not exceed the memory capacity of the LAHN, the N-equal-part method performs steadily. It can be concluded from the experimental results that the scaling PIP is a robust and efficient matching method and the Hopfield network has a potential advantage over other distance-based matching methods. The proposed Hopfield network based algorithm can be applied in some pattern matching trading systems to detect the patterns in the daily or hourly financial market. With fewer training datasets and less processing time the trader can efficiently capture the specific signals and make the transaction. Future work could consider how to leverage the characteristics of DTW and the methods we proposed to construct a more accurate and scaling matching method. Moreover, the memory capacity limits the performance of the Hopfield network based pattern matching. Future studies can also explore the retrieval reliability of the LAHN and different segmentation algorithms like PLA, PAA or TP (turning points), which could distinguish different stored templates. Conceptualization, W.M. and R.S.T.L. ; Methodology, W.M. and R.S.T.L. ; Formal analysis, W.M. ; Visualization, W.M. ; Writing--original draft, W.M. ; Writing--review and editing, R.S.T.L. All authors have read and agreed to the published version of the manuscript. This research received no external funding. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & & **ED** & **DTW** & **PIP** & **PIP-TG** & **N-Equal-Part** & **Scaling PIP** \\ \hline \multirow{8}{*}{Normal data} & H\&S & 0.845 & 0.985 & 0.955 & 0.890 & 0.345 & 0.820 \\  & Tria-A & 0.835 & 1.000 & 0.975 & 0.945 & 0.705 & 0.870 \\  & CWH & 0.965 & 1.000 & 0.580 & 0.685 & 0.960 & 0.730 \\  & Reverse CWH & 0.960 & 0.990 & 0.605 & 0.675 & 0.860 & 0.785 \\  & Trip-B & 0.550 & 1.000 & 0.985 & 0.990 & 0.790 & 0.985 \\  & Doub-T & 0.935 & 0.955 & 0.510 & 0.480 & 0.980 & 0.940 \\  & Doub-B & 0.965 & 1.000 & 0.520 & 0.425 & 0.990 & 0.905 \\  & Spike-T & 0.870 & 0.965 & 0.775 & 0.695 & 0.860 & 0.720 \\  & Spike-B & 0.885 & 0.920 & 0.760 & 0.650 & 0.885 & 0.675 \\  & Flag & 0.990 & 0.815 & 0.905 & 0.815 & 1.000 & 0.990 \\  & Wedges & 0.990 & 0.995 & 0.910 & 0.515 & 0.925 & 0.665 \\ \hline \multirow{8}{*}{Noisy data} & Overall & 0.890 & 0.966 & 0.771 & 0.706 & 0.845 & 0.826 \\  & H\&S & 0.465 & 0.875 & 0.465 & 0.925 & 0.215 & 0.845 \\  & Tria-A & 0.410 & 0.820 & 0.410 & 0.925 & 0.720 & 0.905 \\  & CWH & 0.640 & 0.850 & 0.640 & 0.700 & 0.725 & 0.680 \\  & Reverse CWH & 0.635 & 0.865 & 0.635 & 0.680 & 0.600 & 0.735 \\  & Trip-B & 0.170 & 0.810 & 0.170 & 0.985 & 0.460 & 0.945 \\  & Doub-T & 0.585 & 0.655 & 0.585 & 0.475 & 0.800 & 0.865 \\  & Doub-B & 0.620 & 0.835 & 0.620 & 0.435 & 0.890 & 0.875 \\  & Spike-T & 0.605 & 0.780 & 0.605 & 0.685 & 0.750 & 0.720 \\  & Spike-B & 0.535 & 0.670 & 0.535 & 0.655 & 0.650 & 0.685 \\  & Flag & 0.855 & 0.580 & 0.855 & 0.795 & 0.995 & 0.985 \\  & Wedges & 0.750 & 0.835 & 0.750 & 0.300 & 0.820 & 0.675 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The overall accuracy of each model on the synthetic data. **Acknowledgments:** This paper was supported by Beijing Normal University-Hong Kong Baptist University United International College (UIC) research grant R202008 and R201948. **Conflicts of Interest:** The authors declare no conflict of interest.