| Define: Threshold // cutting threshold |
| X_Thld // horizontal area |
| Y_Thld // vertical area |
| X // a time series |
| Y // stock price |
| 1: Procedure TBSM |
| 2: Let T be represented as , |
| 3: n = 0 |
| 4: Draw a line between and |
| 5: Max d = maximum distance of to the line |
| 6: If (Max > Threshold) |
| 7: Let be the point with maximum distance |
| 8: For j = |
| 9: If ( < X_Thld) and ( < Y_Thld) |
| 10: Then Point, n = n + 1 |
| 11: End If |
| 12: End For |
| 13: Select from Point: |
| 14: Return: S1 = T |
| 15: S2 = T |
| 16: End If |