Custom GetFitness for Backtesting

Created at 29 Jan 2025, 02:49
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
TH

thecaffeinatedtrader

Joined 22.07.2020

Custom GetFitness for Backtesting
29 Jan 2025, 02:49


Hi, 

I'm interested in trying out the “custom” feature in Optimization Criteria section during back testing. It states you need to write your own “Get Fitness Method” in your cBot. 

Does anyone know how to properly write this because I've been racking my brain trying to figure this out for days now. 

I want to use a method called “Average Profitability Per Trade” or APPT.

This method measures: 

  • PW = Probability of Win
  • AW = Average Win
  • PL = Probability of Loss
  • AL = Average Loss

Therefore, when creating this Get Fitness Method, it needs to calculate

  • Win Percentage
  • Loss Percentage
  • Average Win Dollar Amount
  • Average Loss Dollar Amount

 And then with these numbers, compute the following formula to determine the best parameters to use:

  • APPT = (PW×AW) − (PL×AL)

If anyone has experience in creating these Get Fitness Methods it would be GREATLY appreciated if you help me figure this out or if it's even possible to do so. 

Thanks in advance! 


@thecaffeinatedtrader