Skip to content

GetFitnessArgs.ProfitFactor

property · GetFitnessArgs · cAlgo.API

DesktopCLICloud

Gets the Profit Factor - the ratio of Total Net Profit divided by the Total Net Loss.

Definition

double ProfitFactor {get;}
getFitnessArgs.ProfitFactor: float

Returns double

Examples

protected override double GetFitness(GetFitnessArgs args)
{
    return double.IsNaN(args.ProfitFactor) ? 0 : args.ProfitFactor;
}
import math

def get_fitness(self, args):
    return 0 if math.isnan(args.ProfitFactor) else args.ProfitFactor