# Hybrid Crow Search Algorithm-LSTM System for Enhanced Stock Price Forecasting
## 4 Results
### Backtesting  
Subsequently, we verified whether the model prediction results can be used to generate profits through simple decision-making. The data are presented in Table 8. First, moving average convergence divergence (MACD) was used with the predicted values to determine the timing at which the trade was executed. If it is identified as buying, two shares are purchased. If it is identified as selling, all shares are sold with a handling fee of 0.1425% and a transaction tax of 0.3%, applicable only to selling transactions in accordance with Taiwan's financial regulations. Based on data provided by Masterlink Securities Corp ([[https://www.masterlink.com.tw/transaction-costs](https://www.masterlink.com.tw/transaction-costs)]([https://www.masterlink.com.tw/transaction-costs](https://www.masterlink.com.tw/transaction-costs)), accessed on 3 December 2024), a corporation based in Taiwan, most securities corporations in Taiwan align with this standard. This revision ensures better readability while maintaining the intended meaning.  
The profits gained after the operations are denoted as \"mine\", whereas those gained by no operations but selling all shares at the last time point are denoted as \"keep\". The following three assumptions were made in the backtesting experiment;  
1. Initially, two shares of each stock are held;
2. The stocks can be purchased at the opening price or sold at the closing price at any time point;
3. All stocks held can be sold at the closing price at the last time point.  
Based on the above assumptions, the results for \"mine\" and \"keep\" were compared, as shown in Figures 17 and 18.  
Predicting the price does not necessarily mean that we can profit from the prediction. As we can observe, for some stocks, we can achieve successful profits, while for others, profit is difficult to realize. In the future, it may be necessary to design better methods for executing quantitative trading.  
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline  & RMSE & MSE & MAE & RMSE & MSE & MAE & RMSE & MSE & MAE \\ \hline RNN & 12.448 & 154.952 & 10.467 & 1.169 & 1.366 & 0.98 & 9.542 & 200.417 & 7.183 \\ \hline RNN+corr & 8.344 & 69.627 & 6.263 & 0.903 & 0.815 & 0.791 & 6.843 & 114.509 & 4.541 \\ \hline GRU & 10.983 & 120.626 & 7.966 & 1.599 & 2.556 & 1.408 & 7.251 & 103.912 & 4.760 \\ \hline GRU+corr & 8.427 & 71.022 & 6.461 & 1.027 & 1.055 & 0.882 & 5.947 & 76.290 & 4.060 \\ \hline LSTM & 9.367 & 87.748 & 7.435 & 0.842 & 0.712 & 0.684 & 6.832 & 92.974 & 4.760 \\ \hline LSTM+corr & 8.092 & 65.448 & 5.813 & 0.642 & 0.412 & 0.513 & 4.290 & 34.620 & 3.014 \\ \hline VMD-LSTM & **3.227** & **10.412** & **2.493** & 0.381 & 0.145 & 0.313 & 2.062 & 7.613 & 1.658 \\ \hline CSLSTM & 4.074 & 16.612 & 3.047 & **0.332** & **0.109** & **0.253** & 1.940 & 6.614 & 1.472 \\ \hline \end{tabular}
\end{table}
Table 7: _Cont._  
\begin{table}
\begin{tabular}{c c c} \hline
**Stock Code** & **Period** & **Total Number of Transactions** \\ \hline
0050 & 2020/09/29–2021/04/01 & 120 \\ \hline
2330 & 2020/09/29–2021/04/01 & 120 \\ \hline
1216 & 2020/09/29–2021/04/01 & 120 \\ \hline
2454 & 2020/09/29–2021/04/01 & 120 \\ \hline
2882 & 2020/09/29–2021/04/01 & 120 \\ \hline \end{tabularFigure 15: Stock price predictions by different models for various stocks, including the COVID-19 period.  
Figure 16: Stock price predictions by different models for various stocks, excluding the COVID-19 period.