## GA for trading strategies

Let's apply our expertise in genetic algorithms to evaluate different strategies to trade securities using trading signals. Knowledge in trading strategies is not required to understand the implementation of a GA. However, you may want to get familiar with the foundation and terminology of technical analysis of securities and financial markets, as described briefly in the *Technical analysis* section in the Appendix A, *Basic Concepts*.

The problem is to find the best trading strategy to predict the increase or decrease of the price of a security given a set of trading signals. A trading strategy is defined as a set of trading signals *ts*_{j} that are triggered or fired when a variable *x = {x*_{j}}, derived from financial metrics such as the price of the security or the daily or weekly trading volume, either exceeds or equals or is below a predefined target value *α*_{j} (refer to the *Trading signals and strategy* section in the Appendix A, *Basic Concepts*).

The number of variables...