Once an individual has been born, there must be some way to evaluate that individual's fitness, also known as the individual's desirability. Determining the fitness or desirability of a set of inputs to a strategy is as simple as running the strategy using those inputs and performing a calculation on the last bar of the strategy to compute fitness. You create the fitness computation in EasyLanguage and pass the fitness value to Optimax using a function call. When computing fitness, what you must do is assess your strategy's overall performance for this set of inputs and express that as a single floating-point number.

Fitness is the objective of your optimization expressed numerically. It is a floating-point value between -1E300 and 1E300. Positive fitness values are *fit* and negative values are *unfit.* Optimax considers higher values as fitter, and lower values as less fit. That doesn't mean you should attempt to have fitness values span the entire permissible range up to 1E300; values between 0.0 and 1.0 would work as well, given enough decimal places; it's up to you. Unfit values are excluded from mating and are not used when creating new individuals.

Sample fitness calculations you could use are:

Each of these computations reduce the strategy's performance to a single numerical value. Optimax includes several fitness functions for you to use right out of the box. You can also find standard formulae for all of the above ratios on the Internet.

You can change the fitness calculation to suit your needs at any time and it can be different for each optimization you perform if you like. And it can be as complex or as simple as you need it to be.

Related Topics: