Skip to content

GetFitnessArgs

Summary

Represents the custom fitness calculation interface.

Signature

1
public abstract interface GetFitnessArgs

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
 using cAlgo.API;
 namespace cAlgo.Robots
 {
     // This sample shows how to use the GetFitnessArgs to change the default fitness metric of optimizer
     [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class GetFitnessArgsSample : Robot
     {
         protected override void OnStart()
         {
         }
         protected override double GetFitness(GetFitnessArgs args)
         {
             // Here we are using the win rate as fitness
             // You can use any other value by combining the values of GetFitnessArgs object properties
             return args.WinningTrades / args.TotalTrades;
         }
     }
 }

Properties

History

Summary

Gets all the historical trades.

Signature

1
public abstract History History {get;}

Return Value

History

Positions

Summary

Gets all open positions.

Signature

1
public abstract Positions Positions {get;}

Return Value

Positions

PendingOrders

Summary

Gets all pending orders.

Signature

1
public abstract PendingOrders PendingOrders {get;}

Return Value

PendingOrders

Equity

Summary

Gets the equity of the account (balance plus unrealized profit and loss).

Signature

1
public abstract double Equity {get;}

Return Value

double

NetProfit

Summary

Gets the net profit of all trades in account deposit currency.

Signature

1
public abstract double NetProfit {get;}

Return Value

double

MaxBalanceDrawdownPercentages

Summary

Gets the maximum amount of balance drawdown in percentage (ex: 40%).It can return a positive value between 0-100.

Signature

1
public abstract double MaxBalanceDrawdownPercentages {get;}

Return Value

double

MaxEquityDrawdownPercentages

Summary

Gets the maximum amount of equity drawdown in percentage (ex: 40%).It can return a positive value between 0-100.

Signature

1
public abstract double MaxEquityDrawdownPercentages {get;}

Return Value

double

MaxBalanceDrawdown

Summary

Gets the maximum amount of balance drawdown in account deposit currency.

Signature

1
public abstract double MaxBalanceDrawdown {get;}

Return Value

double

MaxEquityDrawdown

Summary

Gets the maximum amount of equity drawdown in account deposit currency.

Signature

1
public abstract double MaxEquityDrawdown {get;}

Return Value

double

WinningTrades

Summary

Gets the total number of winning trades.

Signature

1
public abstract double WinningTrades {get;}

Return Value

double

LosingTrades

Summary

Gets total number of losing trades.

Signature

1
public abstract double LosingTrades {get;}

Return Value

double

TotalTrades

Summary

Gets the total number of trades taken.

Signature

1
public abstract double TotalTrades {get;}

Return Value

double

AverageTrade

Summary

Gets the average profit for all trades in account deposit currency.

Signature

1
public abstract double AverageTrade {get;}

Return Value

double

ProfitFactor

Summary

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

Signature

1
public abstract double ProfitFactor {get;}

Return Value

double

Swaps

Summary

Gets the swaps of all trades in account deposit currency.

Signature

1
public abstract double Swaps {get;}

Return Value

double

Commissions

Summary

Gets the commissions of all trades in account deposit currency.

Signature

1
public abstract double Commissions {get;}

Return Value

double