How to Evaluate Profit Factor and Recovery Factor Before Choosing a Gold EA in MT5
Evaluating a gold Expert Advisor (EA) for XAUUSD solely by its backtest net profit can hide important risks. Two trading systems may earn the same profit while experiencing very different losses and declines in account value. Profit Factor and Recovery Factor in the MetaTrader 5 (MT5) Strategy Tester help explain these differences when considered alongside equity drawdown and testing conditions.
1. What is Profit Factor in MT5?
Profit Factor (PF) is the ratio of aggregate profits from profitable trades to the magnitude of aggregate losses from losing trades, as reported by the tester.
PF = Gross Profit ÷ |Gross Loss|
Hypothetical example: gross profit of USD 1,500 and gross loss of USD 1,000 produce a PF of 1.50 and net profit of USD 500 in this example. For every dollar of aggregate loss, the system generated USD 1.50 in aggregate profit during the test. This does not mean a 50% return on starting capital.
When the magnitude of gross loss is positive, a PF above 1 means gross profit exceeds gross loss; a PF of 1 means they are equal; and a PF below 1 means gross loss is larger. None of these values guarantees future performance. MQL5 documents that STAT_PROFIT_FACTOR returns DBL_MAX when gross loss is zero. This special case should not be compared with ordinary finite ratios without examining the number of trades.
2. What is Recovery Factor?
Recovery Factor (RF) compares net profit with the maximum decline in account balance during a test. The MQL5 reference defines STAT_RECOVERY_FACTOR as STAT_PROFIT divided by STAT_BALANCE_DD, the maximum monetary balance drawdown rather than a percentage.
RF = Net Profit ÷ Maximum Balance Drawdown
Hypothetical example: net profit of USD 500 and maximum balance drawdown of USD 250 give an RF of 2.00. Net profit over the test is twice the largest monetary balance drawdown. This does not indicate how many days the account took to recover its previous peak. A zero denominator must be treated separately rather than interpreted as an ordinary ratio.
3. Comparing two gold EAs with identical net profit
Assume systems A and B are tested on XAUUSD with USD 2,000 in starting capital under identical dates and conditions. These figures are hypothetical illustrations, not actual product test results.
| Metric | EA A | EA B |
|---|---|---|
| Gross Profit | USD 1,500 | USD 2,500 |
| Gross Loss (magnitude) | USD 1,000 | USD 2,000 |
| Net Profit | USD 500 | USD 500 |
| Maximum Balance Drawdown | USD 250 | USD 500 |
| Maximum Equity Drawdown | USD 400 | USD 900 |
| Profit Factor | 1.50 | 1.25 |
| Recovery Factor | 2.00 | 1.00 |
System A has higher ratios and lower monetary drawdowns in this example. However, these figures alone cannot establish greater future robustness: the trade count, return sequence, sensitivity to costs, and out-of-sample performance remain unknown.
4. Why grid and hedge EAs also require equity drawdown analysis
Balance reflects realized account results, whereas equity includes floating profits and losses. A system that regularly closes profitable trades while retaining losing positions may show a smoother balance curve than its equity curve. Holding opposing positions does not erase existing losses and may introduce costs and margin constraints.
Suppose system C earns USD 300 in net profit, with a maximum balance drawdown of USD 100 and a maximum equity drawdown of USD 800. Its Recovery Factor under the documented MQL5 definition is 3.00. A separate net-profit-to-maximum-equity-drawdown ratio is only 0.375, or approximately 0.38. This second ratio is a supplementary analytical measure, not the MT5 STAT_RECOVERY_FACTOR statistic.
5. How to review an MT5 Strategy Tester report
Open Strategy Tester, select the EA and the broker's gold symbol, and configure starting capital, test dates, leverage, and other conditions to reflect the intended account. After the test, inspect the results report and balance/equity graph together.
Record Total Net Profit, Gross Profit, Gross Loss, Profit Factor, Recovery Factor, Balance Drawdown Maximal, Equity Drawdown Maximal, Equity Drawdown Relative, and the number of trades. Verify the account denomination, especially for cent accounts, and do not confuse monetary drawdown with percentage drawdown.
6. Testing system robustness
Use real tick data where available. Check whether commission, swap, spread and execution delays reflect the conditions being studied. Separate parameter optimization from out-of-sample testing, and compare results under different trading costs and market conditions, including sustained trends, repeated reversals and widening spreads.
No universal PF or RF threshold can certify every type of EA. A system with few trades or profits concentrated in a handful of events can produce attractive but unstable statistics. Review the equity curve, sample size, time to recover previous peaks, and risks associated with accumulated position sizes alongside both ratios.
Frequently asked questions
Does a high Profit Factor imply a high win rate? Not necessarily. A system with infrequent but large profitable trades may have a high PF.
Does a Recovery Factor of 2 mean recovery within two days? No. It is a profit-to-drawdown ratio, not a measure of elapsed time.
Can PF and RF compare EAs tested over different periods? They can be calculated, but comparisons are more meaningful under comparable testing conditions.
Conclusion
Profit Factor describes the relationship between gross profit and gross loss. Recovery Factor relates net profit to maximum balance drawdown. Considering both alongside equity drawdown gives a clearer view of backtest limitations, particularly for grid and hedge systems.
Further reading: How to backtest a gold EA and the Thai-language guide Understanding EA drawdown. Product information and usage requirements are available at the official PK Tech Solutions website.
Trading involves risk. EAs do not guarantee profits. All numerical examples are hypothetical, not actual test results or investment advice.
References
- MetaTrader 5 — Testing Report
- MQL5 — Testing Statistics
- MetaTrader 5 — Strategy Testing
- MetaTrader 5 — Real and Generated Ticks
This article was prepared with AI assistance and reviewed against the cited documentation. MetaTrader and MQL5 are third-party trademarks; no affiliation with or endorsement by MetaQuotes is implied.