Have you realized that the results of the expectancy formula is exactly the same as the average returns (including loses)?

That means that the value is already in the built in report => “Avg. Profit/Loss %” under “All Trades”, and that there is no use in adding it as a custom backtest proc.

Hi All,
I have this example bactesting report.
Would like to confirm my understanding the calculation of Avg. Profit/Loss % (or Expectancy (%).

From the manual, Avg. Profit/Loss %, also known as Expectancy (%) = (% Profit of winners + % Loss of losers)/(number of trades)

So I tried doing the following calculation:
A = % Profit of winners: 4,160.35/ 30,000
B = % Loss of losers: -13,106.30/30,000
Number of Trades = 5

Avg. Profit/Loss (%) = (A+B)/5
Is this correct?
Somehow the above only give me -5.98% instead of the correct answer in the Backtesting report (-6.10%).

You should be using the % P/L per trade, not the dollars of P/L divided by 30,000 because it is unlikely (actually impossible in this example) that all of your trades had an initial value of exactly 30,000. even if they had, your calculation is incorrect because it's not weighted by the number of winning and losing trades. Therefore, the correct math is:

(2 * 6.98% - 3 * 14.81%) / 5 = -6.094%

The difference between -6.094 and -6.10 is rounding error.