## 3 Proposed Approach
### Proposed AGBCPT
\]
**STEP 3.3:**: Calculate the moving average values \(MA_{i}(T)\) and \(MA_{j}(T)\) of \(s_{i}\) and \(s_{j}\) using the closing prices generated in the previous step as  
\[MA_{i}(T)=\frac{\sum_{k=T-mDay_{q}}^{T-1}cp_{k}^{s_{i}}}{mDay_{q}},\text{ and }MA_{j}(T)=\frac{\sum_{k=T-mDay_{q}}^{T-1}cp_{k}^{s_{j}}}{mDay_{q}}.\]
**STEP 3.4:**: Use the moving average value and \(BBentryWidth_{q}\) to calculate the entry upper and lower bands of \(s_{i}\) and \(s_{j}\) on day \(T\) based on Formulas (1) and (2) as  
\[ \begin{array}{l}UB_{i}(T)=MA_{i}(T)+BBentryWidth_{q}\ *\ \sqrt{\frac{\sum_{k=T-mDay_{q}}^{T-1}\left(cp_{k}^{s_{i}}-\mu \right)^{2}}{mDay_{q}}},\end{array}  \tag{11}\]  
\[ \begin{array}{l}LB_{i}(T)=MA_{i}(T)-BBentryWidth_{q}\ *\ \sqrt{\frac{\sum_{k=T-mDay_{q}}^{T-1}\left(cp_{k}^{s_{i}}-\mu \right)^{2}}{mDay_{q}}},\end{array}  \tag{12}\]  
\[ \begin{array}{l}UB_{j}(T)=MA_{j}(T)+BBentryWidth_{q}\ *\ \sqrt{\frac{\sum_{k=T-mDay_{q}}^{T-1}\left(cp_{k}^{s_{j}}-\mu \right)^{2}}{mDay_{q}}},\text{ and }\end{array}  \tag{13}\]  
\[ \begin{array}{l}LB_{j}(T)=MA_{j}(T)-BBentryWidth_{q}\ *\ \sqrt{\frac{\sum_{k=T-mDay_{q}}^{T-1}\left(cp_{k}^{s_{j}}-\mu \right)^{2}}{mDay_{q}}}.\end{array}  \tag{14}\]  
**STEP 3.5:**: Use the moving average value and \(BBoutWidth_{q}\) to calculate the exit upper and lower bands of \(s_{i}\) and \(s_{j}\) on day \(T\) based on Formulas (3) and (4) as  
\[US_{i}(T)=MA_{i}(T)+BBoutWidth_{q}\ *\sqrt{\frac{\sum_{k=T-mDay_{q}}^{T-1}\left(cp_{k}^{s_ {i}}-\mu\right)^{2}}{mDay_{q}}}, \tag{15}\]  
\[LS_{i}(T)=MA_{i}(T)-BBoutWidth_{q}\ *\sqrt{\frac{\sum_{k=T-mDay_{q}}^{T-1}\left(cp_{k}^{s_ {i}}-\mu\right)^{2}}{mDay_{q}}}, \tag{16}\]  
\[US_{j}(T)=MA_{j}(T)+BBoutWidth_{q}\ *\sqrt{\frac{\sum_{k=T-mDay_{q}}^{T-1}\left(cp_{k}^{s_ {j}}-\mu\right)^{2}}{mDay_{q}}}, \tag{17}\]  
\[LS_{j}(T)=MA_{j}(T)-BBoutWidth_{q}\ *\sqrt{\frac{\sum_{k=T-mDay_{q}}^{T-1}\left(cp_{k}^{s_ {j}}-\mu\right)^{2}}{mDay_{q}}}. \tag{18}\]
**STEP 4:**: Use the following steps to determine whether to start pairs trading. **STEP 4.1:**: Determine whether all trading pairs \(tp(s_{i},s_{j})\) in _TPset_ meet the following two entry conditions: Condition 1: The (\(T-oDay_{q}\)) closing price of the stock \(s_{i}\) crosses the _upper band of buy_ (_LIB_) downward on \(T\) day:  
\[cp_{T-oDay_{q}}^{s_{i}}>UB_{i}(T)>cp_{T}^{s_{i}}.\]  
Condition 2: The (\(T-oDay_{q}\)) closing price of the stock \(s_{j}\) crosses the _lower band of buy_ (_LB_) upward on \(T\) day:  
\[cp_{T-oDay_{q}}^{s_{j}}<LB_{j}(T)<cp_{T}^{s_{j}}.\]  
when the two entry conditions are met, as shown in Figure 2, it is expected that \(s_{i}\) will continue to fall, and \(s_{j}\) will continue to rise. Hence, short \(s_{i}\) and long \(s_{j}\). **STEP 4.2:**: Short one unit of stock \(s_{i}\) and buy an integer number of stock \(s_{j}\) at the same cost to stock \(s_{i}\) when \(cp_{T}^{s_{i}}>cp_{T}^{s_{j}}\); otherwise, buy one unit of stock \(s_{i}\) and short an integer number of stock \(s_{i}\) at the same cost as stock \(s_{j}\). **STEP 4.3:**: Record the cost \(tpC(s_{i},s_{j})\) of this trading pair \(tp(s_{i},s_{j})\). **STEP 4.4:**: Remove \(tp(s_{i},s_{j})\) from _TPset_ if the entry conditions are not met. **STEP 4.5:**: Go to Step 4.1 to determine the entry conditions of the next pair in _TPset_. **STEP 5:**: Use the following steps to determine whether to finish every trading pair in _TPset_. Figure 2: The two entry conditions. **STEP 5.1:**: Determine whether all trading pairs \(tp(s_{i},s_{i})\) in _TPset_ meet the following exit conditions: Condition 3: The \((T-oDay_{q})\) closing price of the stock \(s_{i}\) crosses the _lower band of sell_ (\(LS\)) downward on the closing price at day \(T\):  
\[cp_{T-oDay_{q}}^{s_{i}}>LS_{i}(T)>cp_{T}^{s_{i}}.\]  
Condition 4: The \((T-oDay_{q})\) closing price of the stock \(s_{i}\) crosses the _upper band of sell_ (\(LS\)) upward on the closing price at day \(T\):  
\[cp_{T-oDay_{q}}^{s_{i}}<US_{j}(T)<cp_{T}^{s_{j}}.\]  
when the above exit conditions are satisfied, as shown in Figure 3, the transaction is closed.