Pith. sign in

REVIEW 4 major objections 6 minor 7 references

Calculating Profits and Losses for Algorithmic Trading Strategies: A Short Guide

T0 review · 4 major / 6 minor · reviewed 2026-08-12 · deepseek-v4-flash

Pith's one-line read This paper aims to show that a spot-trading sequence's total PnL, spread included, can be read off at any time from two running balances.

desk verdict Useful practitioner note on spread-aware PnL bookkeeping, but the printed conversion rules contradict the worked example and need correction before it can be trusted. read the letter →

arxiv 2411.14068 v1 pith:UDPJPVF7 submitted 2024-11-21 q-fin.TR

classification q-fin.TR
keywords profitandlosscalculationalgorithmictradingbid-askspreadrealizedunrealizedPnLbasequotecurrencyspotbalance-sheetbookkeeping
verification ladder T0 review T1 audit T2 compute T3 formal

The pith

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

The reading

This paper puts forward a bookkeeping method for scoring spot-trading strategies. It keeps two running balances—one in the base currency, one in the quote currency—marks buys at the ask and sells at the bid, and reads the total realized and unrealized PnL off those balances at any time. The payoff is that an algorithm's performance can be reduced to one number, in either base or quote units, with the spread included and without waiting for positions to close. A six-trade SOL/USDT example walks the equations through to a final profit of 1.527165 SOL (260 USDT), and the authors present the formalism as a basis for evaluating trading-model algorithms.

What carries the argument

The load-bearing object is a two-column balance sheet that tracks the base and quote positions as trades happen, $b_i$ and $q_i$ as in Eq. (1), with buys marked at the ask and sells at the bid. Eq. (2) defines $\bar{x}_i$, the unrealized average price; Eq. (3) converts the position into PnL in base units, including a separate branch for the moment a position closes, $b_i = 0$. The closing branch is the delicate part: whether $x_i$ or $x_i'$ is used depends on the direction of the prior position and on whether the close realizes a gain or a loss. Eq. (9) provides an equivalent route by benchmarking wealth against a portfolio with no trading.

What would settle it

Recompute the six-trade SOL/USDT example literally from Eq. (10) as printed; if the printed condition is followed, the final base-currency PnL will not equal 1.527165 SOL. Re-running the same trades while converting the closing quote profit at the other side of the spread will change the base PnL, confirming that the convention, not the market prices, determines the number.

Watch

Extended reading notes

Core claim

The central claim is that the total profit or loss of any sequence of spot trades, realized and unrealized, is completely determined by two running sums, $b_i = \sum_{j=1}^i u_j$ and $q_i = -\sum_{j=1}^i x_j u_j$, where $x_j$ is the bid or ask price actually transacted at each step. The unrealized average entry price is $\bar{x}_i = -q_i/b_i$, and PnL in base units follows from Eq. (3); in quote units it is $p_i^q = p_i^b x_i'$, where $x_i'$ is the opposite side of the spread. The same result emerges from Eq. (9), which compares wealth to a no-trading benchmark. The worked SOL/USDT table shows all three routes landing on the same final profit: 1.527165 SOL, or 260 USDT.

Load-bearing premise

Everything rests on a sign-dependent bookkeeping convention: when a position closes, quote-denominated profit is converted to base units at the ask for profitable closes and the bid for losing closes; the paper's Eq. (10) prints the opposite sign condition from the one its own example uses.

Editorial extensions

If this is right

  • Any sequence of spot trades can be scored at any moment; total PnL is available before positions close.
  • PnL can be reported in base or quote currency, so strategies running on different currency pairs can be compared on one number.
  • Dividing trade sizes by initial balance turns the PnL into percentages, and those percentages can be compounded into a total return.
  • Trading fees can be folded in by deducting them from the per-trade PnL in the currency they are charged.
  • Wealth can be separated into a market-driven component and the algorithm's contribution by benchmarking against a no-trading portfolio.

Reading between the lines

Editorial extensions of the paper, not claims the author makes directly.

  • This reader's extension: the close-case conversion is an accounting convention rather than a market identity, so two backtesters can report different base-currency PnL on identical trades by converting quote profit at bid instead of ask; a tool built on these equations should state which of the four cases maps to which price.
  • This reader's extension: Eq. (10) as printed contradicts the worked example's use of the closing convention, so an implementation should pin the four cases from the table in Eq. (3) rather than copy Eq. (10) verbatim.
  • This reader's extension: running the equations on recorded exchange order history and comparing against the exchange's settlement records would test the convention's practical adequacy; any mismatch would show where the sign-dependent conversion diverges.
Share X Bluesky LinkedIn Reddit HN

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, and a circularity audit.

Referee Report

4 major / 6 minor

Summary. The paper presents a bookkeeping framework for computing realized and unrealized profits and losses (PnL) of algorithmic spot trading strategies, explicitly incorporating the bid/ask spread. The authors define base and quote balances, an average entry price, and formulas for PnL in base and quote units, as well as a wealth-based formulation and performance measures. A worked SOL/USDT example is used to illustrate the formulas.

Significance. The paper addresses a practical need: consistent PnL calculation for algorithmic trading. The core bookkeeping identity, once the conventions are fixed, is sound and would be useful for backtesting and live monitoring. The worked example, despite errors, helps illustrate the intended meaning. The main value is pedagogical and practical, not a novel research result. However, the current manuscript contains several internal inconsistencies in the central equations, and a reader cannot implement the formulas as printed. The potential utility is real, but only after corrections.

major comments (4)
  1. [Section 2, Eq. (10) vs. Eq. (3)] The replacement rule in Eq. (10) is the opposite of the table in Eq. (3). Eq. (10) states that x'_i should be replaced by x_i for b_i=0 exactly when (b_{i-1}>0 ∧ q_i>0) or (b_{i-1}<0 ∧ q_i<0); however, Eq. (3)'s table sets \hat{x}=x'_i in precisely those two cases and \hat{x}=x_i in the complementary cases. Therefore, following Eq. (3) and following Eq. (10) produce different PnL values for the same closing trade. For instance, in the worked example row 6, b_{i-1}>0 and q_i>0, so Eq. (10) instructs using x_i=170.00, whereas Eq. (3) correctly uses \hat{x}=x'_i=170.25 to obtain 1.527165 SOL; implementing Eq. (10) would give a different result. This is a load-bearing inconsistency that must be fixed.
  2. [Section 2, Eq. (5a)] The universal statement p^q_i = p^b_i x'_i does not hold for closed positions in which Eq. (3) uses \hat{x}=x_i. The worked example row 4 reports p^b_4=1.25 and x'_4=159.75, which would give 199.6875, but the table correctly gives p^q_4=200.00, equal to q_4. The paper should restrict Eq. (5a) to b_i≠0 and define p^q_i generally by Eq. (9b), i.e., p^q_i = x'_i b_i + q_i, which yields the correct closed-position value. As written, Eq. (5a) is not a valid general identity.
  3. [Worked example in Section 2] The example contains several numerical errors that obscure the verification of the formulas. Row 3 lists q=-1000, but the displayed \bar{x}_3=200 requires q=+1000 (since q_3 = -2600 + 180×20 = 1000). The second row of the first table has u=5 while the action states 'Buy 10 SOL'; the correct u=10 appears in the Section 3 table. The second table's row 2 gives x'=174.25, which should be 174.75 to reproduce p^b_2=0.121602. These typos need correction for the example to serve as a reliable check.
  4. [General convention (Section 2 and 4)] The conversion convention for closed positions—converting quote-denominated PnL to base units at either the bid or ask depending on the sign of the prior position and the final quote balance—is presented as the unique calculation, but it is an accounting choice. A different convention (e.g., always at mid-price or always at the transaction price) would yield different base-currency PnL figures. The paper should explicitly acknowledge that this is one possible convention and note that the claimed PnL values are convention-dependent, not unique market invariants.
minor comments (6)
  1. [Eq. (4) and Eq. (5b)] The subscripts 'i-i' should be 'i-1' in both equations.
  2. [First table in Section 2] The second row's 'u' column shows 5, but the action text says 'Buy 10 SOL'; the correct value is 10, as used in the Section 3 table.
  3. [Second table in Section 2] The x' value for row 2 is printed as 174.25, but the first table shows 174.75; these should be consistent.
  4. [Sentence following Eq. (4)] The word 'caclculated' is a typo for 'calculated'.
  5. [Section 3 notation] The symbols ~b_i and ~q_i are used without a clear inline definition; consider defining them as b_i/B and q_i/B, respectively, before the performance table.
  6. [Eq. (2) usage] The paper uses \bar{x}_i = -q_i/b_i even when b_i=0 (where it is undefined) in the context of Eq. (3); this should be stated as applying to b_i≠0, with the closed-position case handled separately by the table.

Circularity Check

0 steps flagged · score 0.0 of 10

No circularity: the PnL formulas are bookkeeping definitions verified by a worked example; the noted Eq. (10)/Eq. (3) conflict is a consistency issue, not a self-referential reduction.

full rationale

The paper's central derivation is a set of balance-sheet accounting identities, not an empirical prediction. Equations (1a)-(1b) define cumulative base and quote positions from trade quantities and prices; Eq. (2) defines the average entry price; Eq. (3) defines base-currency PnL as a closed-form function of those quantities plus a stated conversion convention for closed positions; Eqs. (5), (6), and (7)-(9) are algebraic rearrangements or definitions of performance and wealth in base or quote units. There are no fitted parameters, no calibrated inputs, and no load-bearing self-citations: the literature references are contextual only. The worked example is a numerical consistency check of the definitions, and the closing remark that the total PnL follows from Eqs. (1) and (9) is a restatement of the same bookkeeping identity rather than a circular inference. The skeptical observation that Eq. (10) states the opposite replacement rule from the table in Eq. (3), and that the displayed example appears to use yet another convention, is a genuine internal consistency and correctness concern; however, inconsistency between two stated conventions is not circularity, because the derivation does not assume what it purports to derive. Similarly, a sign error in the example table would be an implementation error, not a self-referential reduction. Therefore the appropriate circularity score is 0.

Assumptions & free parameters 0 free parameters · 4 assumptions · 0 invented entities

The central formulas rest entirely on accounting definitions and on a particular convention for converting quote PnL into base PnL at bid or ask prices. No free parameters are fitted and no new entities are postulated. The only debatable ingredient is the conversion-price convention, which the paper states inconsistently in Eqs. (5a) and (10).

assumptions (4)
  • domain assumption A trading position can be represented as cumulative base units b_i and cumulative quote cash flow q_i, with b_i = sum u_j and q_i = -sum x_j u_j (Eq. 1).
    This is the balance-sheet bookkeeping convention the whole formalism builds on; it assumes no fees, no funding costs, and no interest, and that all trades are executed at the stated bid or ask.
  • domain assumption The traded price x_i is the ask for buys and the bid for sells, and x'_i is the opposite quote; the spread is |x_i - x'_i|.
    A standard market microstructure convention, but it is an input to the model, not derived.
  • ad hoc to paper When a position is closed, quote-denominated PnL is converted to base units at either the bid or ask depending on the sign of the prior position and the final quote balance (Eq. 3 table and Eq. 10).
    This conversion convention is introduced specifically to express PnL in base units and is not a market identity. The paper's Eq. (10) states it incorrectly; the intended rule must be inferred from the example.
  • domain assumption Wealth is the sum of base and quote balances, with the quote balance converted at the current opposite price x'_i (Eqs. 7-8).
    A mark-to-market valuation assumption; it ignores transaction costs of converting the whole quote balance and assumes the conversion rate x'_i applies to the entire balance.

how reviews work

0 comments
Cite this review

Pith. "Pith review of Calculating Profits and Losses for Algorithmic Trading Strategies: A Short Guide." pith.science (2026). https://pith.science/paper/UDPJPVF7

@misc{pith2026241114068,
  author       = {Pith},
  title        = {Pith review of: Calculating Profits and Losses for Algorithmic Trading Strategies: A Short Guide},
  year         = {2026},
  howpublished = {\url{https://pith.science/paper/UDPJPVF7}},
  note         = {Machine review of arXiv:2411.14068}
}
read the original abstract

We present a series of equations that track the total realized and unrealized profits and losses at any time, incorporating the spread. The resulting formalism is ideally suited to evaluate the performance of trading model algorithms.

Discussion (0). Continue with ORCID to comment.

Reference graph

Works this paper leans on

7 extracted references · 7 canonical work pages

  1. [1]

    Bouchaud, J.-P. (2008). Economics needs a scientific revolution. Nature , 455(7217):1181--1181

  2. [2]

    Chan, E. (2013). Algorithmic trading: Winning strategies and their rationale . John Wiley & Sons

  3. [3]

    M., Gen c ay, R., , M\"uller, U

    Dacorogna, M. M., Gen c ay, R., , M\"uller, U. A., Olsen, R. B., and Pictet, O. (2001). An introduction to high-frequency finance . Academic Press

  4. [4]

    Hull, J. C. (2000). Options, futures, and other derivatives . Prentice-Hall International

  5. [5]

    Labini, F. S. (2016). Science and the economic crisis: Impact on science, lessons from science . Springer

  6. [6]

    Voit, J. (2005). The statistical mechanics of financial markets . Springer

  7. [7]

    Ziemann, V. (2021). Physics and finance . Springer

Pith tools

Reviewed August 12, 2026 · model on record in the stance chip above.