Automated Trading
Trading bot profit factor: calculation and limitations

Updated 22 October 2026: downloadable CSV workshop on closing executions, position grouping and Profit Factor.
Profit factor answers a limited question: how do the total positive and negative results in a selected trade sample compare? It is useful when examining a report, but it does not reveal the order of losses, open positions or the number of attempts behind a successful backtest.
Rather than searching for a universal “good” value, we will calculate the ratio, compare two identical values with different drawdowns and examine costs. All figures are hypothetical and do not represent New Hope trading accounts.
The formula and its boundaries
Profit factor = total positive results / absolute total negative results. The MetaTrader 5 testing-report documentation defines it using Gross Profit and Gross Loss. A value of 1 means their magnitudes are equal.
For example, +$120, +$80, −$50 and −$50 produce $200 in gains and $100 in losses. PF is 2, with a monetary difference of $100. This does not mean the deposit doubled: starting account capital is absent from the formula.
Define the sample first: dates, instrument, account, strategy version and how executions are grouped into trades. Then establish cost treatment. A ratio above 1 means the selected gains exceed the selected losses; it does not automatically establish a positive result after every relevant expense.
The same PF can hide different loss concentration
Consider two short ledgers. Both start with a $10,000 balance, contain no deposits or withdrawals and have no open positions between trades. The stated results include all costs assumed in this example. We observe balance after each closed trade; these numbers do not show equity fluctuations during a trade.
Measure | Ledger A | Ledger B |
|---|---|---|
Trades, $ | +200, −100, +200, −100, +200, −100 | +600, −300 |
Gains, $ | 600 | 600 |
Losses, $ | 300 | 300 |
Profit factor | 2 | 2 |
Net, $ | +300 | +300 |
Max. balance decline, $ | 100 | 300 |
Ledger B concentrates the entire recorded loss in one trade. A divides it among three trades, with balance reaching a new peak between losses. But reorder A so that its three profits come first and its three losses follow: balance drawdown becomes $300 as well. PF and final profit remain unchanged.
The aggregate ratio therefore contains no event sequence. This does not establish that A is superior; both samples are too short to support that conclusion. It demonstrates which questions disappear when a history is compressed into one number.
How commissions change the calculation
Return to the four outcomes +120, +80, −50, −50. Now treat them as before-commission amounts and assume a $10 charge for each completed trade. They become +110, +70, −60, −60. After those commissions, gains total $180 and losses total $120. A PF calculated on that basis is 1.5, with a $60 net result.
This is a separate calculation with its method stated explicitly. In the MT5 trading-report documentation, Gross Profit/Gross Loss exclude commissions and swaps, while other sections include them. Similar labels on different screens therefore need their definitions checked. Never subtract an already included charge twice.
If costs turn a small gain into a loss, move the trade into the negative group rather than simply reducing aggregate profit. Costs allocated across partial executions also need consistent treatment. Use the order, fill and cost audit to reconcile the underlying records.
Downloadable workshop: the same results, two profit factors
What changes when several closing executions belong to one position? This separate synthetic exercise contains five net realised results in USD. All three positions are fully closed within the same illustrative period. Each row already includes its allocated share of all costs exactly once, including any entry costs. There are no deposits, withdrawals or open-position results in the calculation.
Download the five-row Profit Factor workshop CSV · UTF-8, comma-separated, decimal point. This is teaching data, not a broker statement or a promised platform import format.
Closing execution | Position | Net result, USD |
|---|---|---|
E1 | P1 | +120 |
E2 | P1 | −100 |
E3 | P2 | +80 |
E4 | P2 | −50 |
E5 | P3 | −25 |
The CSV supplies execution_id, position_id, net_realized_pnl and currency. Its remaining fields explicitly mark fully closed positions, costs allocated once in net results, one synthetic period and synthetic data. The identifiers are invented grouping labels.
Calculate before looking at the answer
Sum positive and negative closing results separately, then divide the positive total by the absolute negative total.
Group the same five rows by position. P1 = 120 − 100 = +20; P2 = 80 − 50 = +30; P3 = −25.
Repeat the ratio using these three position totals. Confirm that the net monetary result is unchanged.
Metric | Five closing executions | Three positions |
|---|---|---|
Gains, USD | 200 | 50 |
Loss magnitude, USD | 175 | 25 |
PF | 200 / 175 = 8/7 ≈ 1.14 | 50 / 25 = 2.00 |
Net, USD | +25 | +25 |

Open or download the full-size grouping diagram
Synthetic educational data, not New Hope performance. All allocated costs are already included once. The same results and currency are used in both calculations; only the grouping changes.
The larger PF does not create extra profit. Within P1 and P2, gains and losses offset before the positions are classified as positive or negative. Both calculations retain every row and give +25 USD. Neither is automatically the correct reproduction of a platform's displayed PF: its documented grouping and cost rules decide that.
Use the grouping rule before comparing reports
These five rows represent closing results. An entry fill is not another realised winning or losing trade; associated entry costs still need accounting for. MT5 deal properties distinguish entry, exit and reversal records and provide a position identifier. Other platforms and account modes require their own mapping. Do not infer a position merely from a shared symbol or trading day.
Choose and record the grouping rule before inspecting which PF looks better. Use it consistently for both reports, with the same period and currency. Do not drop a losing partial close or regroup only selected rows. In real history, verify that each included position is complete and reconcile separately charged costs. The MT5 history-report documentation is one example of why the exact report and its definitions matter.
Connect the worksheet to the Myfxbook review
Our dated review of two public Myfxbook accounts recorded displayed PF values of 1.09 and 1.12 on 22 October 2026. Those rounded figures do not reveal the exact underlying positive and negative totals. This workshop does not claim to reproduce either account or Myfxbook's calculation method.
For a real comparison, request the relevant history, date range, grouping definition and cost treatment. Myfxbook's statistics guide points readers to the metric tooltips. When discussing a report for New Hope PRO, ask which account and software configuration it describes, then check the calculation alongside drawdown and open positions. A higher reconstructed PF alone does not demonstrate a better setup.
High values and samples without losses
One $100 win and one $10 loss produce PF 10. Another $90 loss reduces it to 1. The formula was correct both times; the very small sample changed. A high value with a small denominator is particularly important to examine alongside the actual trades.
With no negative outcomes, the denominator is zero and there is no finite ratio. Software may display a special value or an infinity symbol. That describes the calculation for the observed sample, not an absence of future losses.
Open positions may also be excluded from closed-trade statistics. Read PF alongside balance and equity: profitable closures can coexist with a current unrealised loss.
A checklist for comparing reports
Do the boundaries match? Compare dates, instruments, currency and account type.
What counts as a trade? An execution, partial close or complete position cycle can group outcomes differently.
Which costs are included? Record commissions, financing and the rules used for each group.
Is the history complete? Check trade count, distribution over time, open positions and missing data.
How did losses occur? Inspect their sequence, the largest loss and the account-value curves.
How was this version selected? Ask for unsuccessful candidates and independent evaluation conditions.
Many trades do not automatically mean many independent observations: several operations may belong to one position or one market event. A high PF selected from numerous tests also needs out-of-sample evaluation. Comparing demo and live trading clarifies which execution environment the report represents.
What to discuss before choosing software
When considering New Hope PRO, ask about a specific report’s period, configuration, costs and open positions. “The PF is high enough” is less useful than being able to reconstruct its numerator, denominator and capital path. That turns a headline statistic into a checkable description of a past result.
More articles


