## 3 Proposed Approach
### AGBCPT Example  
In this section, the stock price series of the six companies in Table 4 are used as the input dataset to demonstrate AGBCPT. Each stock price series contains thirteen stock prices. The parameters used in this example are stated as follows. The population size was set at 5, the parameter for the MMA crossover operator was set at 0.7, and the crossover and mutation rates were set at 0.8 and 0.1. Below, the example is given and explained step-by-step. **STEP 1:**: The population is initialized. Since _pSize_ is 5, the initial population can be randomly generated according to the encoding schema and the predefined ranges of parameters. Take \(C_{1}\) as an example. The six parameters are generated as [\(-0.98\), \(1.0\), \(0.5\), \(10\), \(10\), \(1\)]. In the same way, the initial population is formed and shown in Table 5.  
**STEP 2:**: For every chromosome, the correlation coefficient matrix \(MT_{(n)}\) of the six companies is calculated by gene _cDayq_ of chromosome _Cq_. **STEP 2.1:**: Take \(C_{1}\) as an example. Because the value of _cDay1_ is 10, \(T\) starts from 11. The historical closing prices of \(S_{1101}\) and \(S_{1102}\) from trading days (\(T-10\)) to (\(T-1\)) are shown as  
\[CPS_{1101}=\{10.5,\,11,\,11.25,\,11.5,\,12,\,12.25,\,13,\,13.5,\,13.75,\,14.25\},\]  
\[CPS_{1102}=\{21,\,22,\,23,\,24,\,25,\,26,\,27,\,28,\,29,\,30\}.\]
**STEP 2.2:**: The correlation coefficient of the two companies \(CCS_{1101}\),\(S_{1102}\) is then calculated as 0.9941. **STEP 2.3:**: Steps 2.1 and 2.2 are repeated to generate the correlation coefficient of any two companies. The resultant matrix \(MT_{(n)}\) is shown in Table 6. \begin{table}
\begin{tabular}{c c} \hline
**Stock ID** & **Stock Price Series** \\ \hline \(S_{1101}\) & 10.5, 11, 11.25, 11.5, 12, 12.25, 13, 13.5, 13.75, 14.25, 15, 15.5, 17 \\ \(S_{1102}\) & 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 27, 24, 23 \\ \(S_{2317}\) & 45, 44.5, 44.75, 45.5, 46, 44.5, 45.15, 45.5, 45.5, 45.5, 45.4, 48 \\ \(S_{2412}\) & 71.5, 68, 66.5, 65, 63, 60, 57, 58, 56, 54, 59, 68, 69 \\ \(S_{2474}\) & 138.5, 135, 130, 120, 121, 115, 107, 100, 103, 98, 105, 114, 123 \\ \(S_{6605}\) & 10.5, 10.25, 10, 9.75, 9.5, 9, 8.5, 9, 8.5, 8, 7.75, 7.5 \\ \hline \end{tabular}
\end{table} 
Table 4: Stock prices of six companies. \begin{table}
\begin{tabular}{c c c c c c} \hline
**Chromosome** & _cLimit_ & _BBentryWidth_ & _BBoutWidth_ & _mDay_ & _cDay_ & _oDay_ \\ \hline C\({}_{1}\) & \(-0.98\) & 1.0 & 0.5 & 10 & 10 & 1 \\ C\({}_{2}\) & \(-0.5\) & 1.0 & 0.5 & 8 & 5 & 1 \\ C\({}_{3}\) & \(-0.38\) & 1.32 & 0.64 & 10 & 14 & 3 \\ C\({}_{4}\) & \(-0.7\) & 0.71 & 0.52 & 18 & 17 & 2 \\ C\({}_{5}\) & \(-0.15\) & 0.84 & 0.13 & 16 & 11 & 2 \\ \hline \end{tabular}
\end{table} 
Table 5: Initial population. \begin{table} \begin{tabular}{c c c c c c c} \hline \hline
**Company** & **1101** & **1102** & **2317** & **2412** & **2474** & **6505** \\ \hline
1101 & 1 & 0.9941 & 0.3869 & \(-\)0.9772 & \(-\)0.9771 & \(-\)0.9598 \\
1102 & 1 & 0.3946 & \(-\)0.9861 & \(-\)0.9819 & \(-\)0.9708 \\
2317 & & & 1 & \(-\)0.3244 & \(-\)0.423 & \(-\)0.2942 \\
2412 & & & & 1 & 0.9723 & 0.9881 \\
2474 & & & & 1 & 0.9466 \\
6505 & & & & & 1 \\ \hline \hline \end{tabular}   
* The \(cLimit_{q}\) value is used to find the qualified stock pairs and \(BBentryWidth_{q}\), \(BBoutWidth_{q}\), and \(mDay_{q}\) are used to generate the entry and exit bands. * Take \(C_{1}\) as an example. Because \(cLimit_{q}\) is \(-\)0.98 and the \(CCS_{1102}\),\(S_{2412}\) and \(CCS_{1102}\),\(S_{2474}\) are \(-\)0.9861 and \(-\)0.9819, meeting the condition, they are inserted into the trading pair candidate set \(TP_{set}=\{tp(S_{1102}\), \(S_{2412})\), \(tp(S_{1102}\), \(S_{2474})\}\). * 1) of companies \(S_{1102}\) and \(S_{2412}\) of \(tp(S_{1102}\), \(S_{2412})\) in \(TP_{set}\) are generated as \[S_{1102}\] : {21, 22, 23, 24, 25, 26, 27, 28, 29, 30}, and \[S_{2412}\] : {71.5, 68, 66.5, 65, 63, 60, 57, 58, 56, 54}.