Systems and executionIntermediate24 min read

The curve and the trades disagree: how to reconcile account equity

Trace portfolio equity through trades, cash flows, fees and open positions. A worked ledger explains discrepancies without hiding them in an adjustment.

Brass balance scales holding a blue notebook and a neat stack of cream receipts
Conceptual photograph: the summary should balance with the records supporting it.

The seventy-five dollars that do not belong on the chart

The report looks finished. Its portfolio curve is smooth, its ending value has two decimal places, and the spreadsheet of trades sits beside it. Then someone adds the amounts independently and finds a difference of seventy-five dollars. The difference is small relative to the account, but it changes the status of the report. There is now a number on the chart that the supporting records cannot explain.

In the hypothetical investigation used throughout this article, the account begins with USD 100,000, receives a USD 5,000 deposit, realizes USD 900 of gross trading profit, pays USD 60 in commissions and USD 15 in financing, and finishes with an open-position loss of USD 250. Its ending equity should be USD 105,575. The first chart shows USD 105,650 because it omitted the two charges. Presentation precision did not create accounting completeness.

This example is invented for teaching. It is not a result from a TradeAndRoll robot or an account statement. We will keep the arithmetic deliberately small, then introduce the issues that make real research records harder to reconcile: opening positions, partial exits, currency conversion, timing, duplicate messages and different definitions of profit. The purpose is to make the explanation inspectable, not to make every data source look as if it agrees.

A reconciliation is successful when the difference is explained by identified records and stated conventions. Setting the difference to zero with an unexplained adjustment is a different activity. Before asking whether a strategy earned an attractive return, we need to know what its curve is measuring and whether the events underneath it can reproduce that measurement.

Start with an identity, not a charting library

For our simplified account, define equity as cash balance plus the marked profit or loss of open positions. Cash balance changes through external transfers, realized trading results and charged costs. We use gross realized profit and list commissions and financing separately. Other products and statements may require additional assets, liabilities, accruals or settlement accounts; this is a narrow educational model, not a universal brokerage balance sheet.

With these definitions, the change in equity over a period equals net external cash flow, plus gross realized trading profit, minus separately charged costs, plus the change in unrealized profit or loss. The last term is a change between two observations, not simply the unrealized amount at the end. Write the identity beside the data dictionary so that each input has a unit, sign and period.

One economic event should enter the identity once. A fee already included in a net realized-profit column must not be subtracted again as a separate charge. A deposit should not become a winning trade. An open-position mark should not become a cash receipt. These distinctions sound elementary, but a beautifully styled report can combine exports that use different conventions without making the mismatch visible.

As a concrete reference, the OANDA account field documentation defines NAV using balance and unrealized P/L and exposes financing and commission fields separately. That is an example of a documented interface, not permission to assume that every platform or export uses identical definitions. Read the actual specification before mapping names into the identity.

Build the smallest complete bridge

Return to the invented account. Beginning equity is USD 100,000 because there are no open positions at the opening observation. The USD 5,000 deposit raises resources to USD 105,000 without creating a trading return. Gross realized profit adds USD 900. Commissions remove USD 60 and financing removes USD 15. The resulting cash balance is USD 105,825. Marking the remaining position at minus USD 250 gives equity of USD 105,575.

This is a bridge between two snapshots, not a claim that the events happened in the order shown. An actual event history must preserve its own chronology. The bridge groups contributions by economic type so that a reader can explain the endpoint. The event history explains how the account reached it and whether intermediate constraints or losses occurred along the way.

An illustrative bridge starts at 100000 dollars, adds a 5000 deposit and 900 gross profit, subtracts 60 commission, 15 financing and 250 open loss, and ends at 105575
Hypothetical USD bridge. The deposit changes capital; the other contributions explain trading and valuation changes under the stated convention.

The chart’s USD 105,650 endpoint is reproduced by leaving out USD 75 of costs. That is a useful diagnostic because the residual matches a known category. It is still a hypothesis until the missing charge records are located. A matching amount could also arise by coincidence or by two offsetting errors. Confirm which records the chart included before declaring the discrepancy solved.

Explain the residual before changing the displayed total. Preserve the original report, record the missing inputs, and regenerate the endpoint from the corrected ledger. This provides a trail from symptom to cause to correction. Typing the expected endpoint into the chart removes the symptom while leaving the underlying calculation untrustworthy.

Opening positions belong to the beginning of the period

Now consider a separate example. A reporting period starts with USD 100,000 cash and an existing position carrying USD 400 of unrealized profit. Opening equity is therefore USD 100,400. During the period the position closes for USD 600 of gross profit measured from its original entry. With no cash flows or charges, closing balance and equity are USD 100,600. The period’s equity gain is USD 200, not USD 600.

The identity explains the difference: realized profit increases by USD 600 while unrealized profit changes from USD 400 to zero, a decrease of USD 400. Combining the two contributions produces USD 200. Summing realized profit and the ending unrealized amount would count the full lifetime profit of the closed position as if all of it arose during the reporting period.

A period boundary cuts through position histories. An export of trades closed this month can contain profits accumulated before the month began. Conversely, a position opened this month may still be open when the export ends. The report needs an opening inventory with cost bases and marks, as well as closing transactions and a closing inventory. A list of exits alone cannot supply all three.

Interactive Brokers makes this distinction explicitly in its explanation of realized and mark-to-market performance: lifetime-to-close and statement-period measurements need not coincide. In our example the numbers are original and hypothetical, but the boundary problem is precisely why field definitions must precede reconciliation. Similar labels can describe different intervals.

Agree on a cutoff before comparing snapshots

Suppose one export uses the final available quote before midnight UTC and another uses the broker’s daily rollover boundary. Both can correctly report a daily endpoint and still disagree. The difference may include market movement, a financing entry or a transaction that falls on opposite sides of the two cutoffs. Calling one source wrong before aligning the period would confuse a convention difference with an error.

Record the timezone, the exact cutoff rule and the treatment of records at the boundary. An interval ending at a timestamp may include that timestamp or exclude it. Back-to-back intervals should not both include the same charge or both omit it. The same discipline applies to daylight-saving transitions, where a local-clock day does not always contain the usual number of hours.

A mark also has a provenance. It may be a bid, ask, midpoint, last transaction, settlement value or another platform-defined valuation. A long and short position may use different executable sides. When a quote is stale, carrying forward the last mark is an explicit assumption. It should not be disguised as a fresh observation simply because the chart continues to draw a line.

Two totals are comparable only after their clocks and valuation rules agree. Preserve the original timestamps and add normalized comparison fields rather than overwriting the source. That allows a later reviewer to distinguish an actual late record from a timezone conversion error and to repeat the reconciliation using the original evidence.

Separate a trade from its accounting events

The word trade can refer to an order, a fill, an opening position, a matched round trip or an aggregated strategy decision. These are not interchangeable identifiers. One order can produce several fills. One fill can reduce an existing position and establish a new one under a particular account model. A round-trip summary may combine events that occurred on different dates and attracted separate charges.

For a research ledger, keep a stable event identifier, event type, instrument, signed quantity, price, currency, event time and source reference. Add links to the order or position only when the source provides a defensible relationship. Preserve corrections or cancellations as explicit changes with references. Do not silently replace the first record and lose the explanation for why yesterday’s report differed.

The ledger is a record of events, not a list of winning and losing ideas. Strategy attribution can sit alongside it, but a missing strategy label should not cause an otherwise valid charge to disappear from account totals. Similarly, a strategy’s signal timestamp is not a substitute for a fill timestamp when reconstructing holdings and cash movements.

The practical payoff is diagnostic speed. If a reconciliation fails on one day, the reviewer can inspect the events admitted to that interval and the inventory carried into it. If the only available artifact is a cumulative profit column, there is no reliable way to distinguish a missing fee from a duplicated fill without returning to more detailed records.

Partial exits test whether the inventory really exists

Consider an invented position of 10,000 units bought at a price of 1.1000 in a contract whose profit is measured directly in USD. Sell 4,000 units at 1.1030. Gross realized profit on that portion is USD 12. The remaining 6,000 units retain the stated entry basis. If the closing mark is 1.1020, their unrealized profit is USD 12. Total gross profit relative to entry is USD 24.

A faulty summary might mark the original 10,000 units at 1.1020, report USD 20 unrealized profit and add the USD 12 realized result. It would claim USD 32, overstating the result by USD 8. The mistake is not in the multiplication. The remaining inventory was never reduced after the partial exit. Correct prices cannot rescue an incorrect position count.

An illustrative position of 10000 units separates into 4000 closed units with 12 dollars realized profit and 6000 remaining units with 12 dollars unrealized profit
The remaining quantity is 6,000 units. Keeping all 10,000 in the open inventory would count part of the position twice.

Multiple entry prices add another convention: which units does a partial exit close? FIFO, average cost and other permitted accounting methods can allocate realized and unrealized components differently. Under consistent assumptions their combined economic value should reconcile, but individual trade summaries can differ. The research report must state its matching rule rather than choosing whichever allocation produces the most attractive win rate.

Check quantity conservation independently of profit. Opening units plus signed fills should equal closing units, subject to explicitly recorded transformations. This simple invariant often identifies the problem before a full valuation calculation is necessary. It also makes an important distinction visible: a correct total profit does not prove that the underlying inventory is correct if other errors happen to offset it.

Costs need a dictionary as well as a total

Commissions, spread, financing, conversion charges and other fees enter records in different ways. A spread can already be embedded in the difference between executable entry and exit prices. A commission can be included in net trade profit or charged separately. Financing can arrive as a daily account event rather than as part of the round-trip row. Summing every field containing the word cost can double-count some categories and omit others.

Create a small mapping for each source: gross or net profit, embedded or separate cost, charge currency, event time and allocation rule. A blank field needs a meaning. It might mean zero, unavailable, not applicable or not yet charged. Those states should not collapse into one number merely because a spreadsheet formula is easier to write that way.

The Interactive Brokers trades reference illustrates the convention problem: commissions are incorporated differently in realized-profit and mark-to-market presentations. This supports checking the source definition, not importing its accounting method into every robot report. Our bridge deliberately uses gross profit and separate charges so that the reader can see each contribution.

Reconcile the account total before allocating costs to robots. If ten strategies share a financing or service charge, assigning it among them requires a separate analytical policy. An allocation can be useful for comparison, but it must sum back to the original charge. Changing the allocation should alter attribution, not create or destroy money in the combined account.

Currency conversion can move the residual without a new fill

An account reported in dollars may hold amounts or liabilities denominated elsewhere. A euro-denominated result and a dollar-denominated fee cannot be added until a conversion convention has been defined. The relevant rate may depend on the event type and timing. Converting every historical event at the final exchange rate creates a different report from converting events when they occurred.

For a separate hypothetical illustration, retain EUR 1,000 as cash. At a reporting rate of USD 1.10 per euro its value is USD 1,100. At USD 1.12 it is worth USD 1,120. No new strategy trade was required to create the USD 20 change in reported value. Whether that change is included in a particular trading-performance category depends on the report’s stated treatment of currency cash.

Keep the original-currency amount, conversion rate, rate timestamp and resulting account-currency amount together. That provides two checks: the currency sub-ledger can reconcile in its own units, and the conversion bridge can explain the reporting-currency total. If the source already reports an account-currency result, avoid converting it a second time because the instrument symbol happens to contain another currency.

Reconcile each currency before explaining the combined account. This separates missing economic events from changes introduced by translation into the reporting currency. It also makes rounding easier to diagnose: a collection of small conversions may differ from one conversion of an aggregated amount even when both calculations follow their stated precision rules.

Deposits explain equity growth but not strategy performance

Our main example ends USD 5,575 above its opening equity. Only USD 575 remains after removing the USD 5,000 external deposit. Reporting a 5.575% strategy return by dividing the full increase by USD 100,000 would describe contributed capital as trading performance. Reporting 0.575% without mentioning when capital entered would also hide a return-measurement choice.

The reconciliation answers a money question: where did the change in account value come from? A performance calculation asks how to measure results relative to capital over time. Time-weighted and money-weighted approaches answer different questions when cash flows occur. Choosing a method requires the timing and valuation information appropriate to that method; the endpoint bridge alone does not provide it.

Keep the accounting bridge and the return calculation as separate outputs. The first should reconcile exactly within declared precision. The second should document its treatment of cash-flow timing, starting capital and valuation intervals. A return series can be internally calculated correctly while relying on an incomplete ledger, which is why the money reconciliation comes first.

Withdrawals deserve the same treatment as deposits. If a researcher removes USD 2,000, the account may end lower despite positive trading results. That is not automatically a drawdown caused by the robot. At the same time, the withdrawal changes the actual resources available to support positions. Performance adjustment must not erase the capital constraint experienced by the account.

Use the shape of the discrepancy to locate the first break

Define the residual at each aligned observation as reported equity minus independently reconstructed equity. In our opening example, the final residual is plus USD 75. A single endpoint tells us the size of the disagreement. A residual series can show when it first appears, whether it grows gradually and whether it returns to zero after another event.

A step near a financing event suggests a missing or misclassified charge. A discrepancy that expands with position size may point toward a quantity or conversion problem. A difference that exists only between a fill and a later batch import suggests timing. These are investigative clues, not proofs. Several distinct mistakes can create the same pattern, and offsetting errors can make the residual temporarily disappear.

A hypothetical residual timeline remains at zero, rises to 60 after an omitted commission and then to 75 after omitted financing
The residual is reported minus reconstructed equity. Two omitted charges produce steps of USD 60 and USD 15 in this invented diagnostic example.

Work backward from the first divergent observation rather than from the most dramatic point on the final curve. Compare the inventory before that observation, the events processed during the interval and the mark used afterward. This bounds the investigation. Recalculating every annual metric each time usually adds activity without narrowing the cause.

A zero final residual can conceal a nonzero path. One omitted cost and one omitted gain of equal magnitude can cancel at the endpoint while distorting drawdown and period returns. The minimum useful reconciliation therefore checks both the final total and intermediate observations at the resolution needed for the report’s claims.

Independence means more than running the same function twice

If the chart and its verification both call the same cumulative-profit function, their agreement provides limited evidence. They may share the same omitted field or sign error. A useful independent reconstruction begins from event records and a separately stated identity, while the chart may come from the research engine’s own account snapshots. The two paths should meet at defined comparison points.

Independence is not absolute. Both paths may still share a corrupt source file, an incorrect contract multiplier or a missing initial position. Record shared dependencies instead of claiming that two calculations eliminate every uncertainty. A hand-worked case helps check the accounting logic; an external statement can provide another comparison where it is available and its definitions are understood.

Use examples that would fail in different ways. A no-trade interval tests whether costs and transfers are handled without fills. A partial exit tests inventory. A carried position tests the opening boundary. A duplicate record tests event identity. A currency cash balance tests conversion. These cases are more informative than repeatedly checking a simple round trip with no charges or open positions.

Do not repair both calculations simultaneously until they agree. Preserve the observed failure, correct the identified defect in one place, and rerun the independent comparison. If the expected amount changes, document why. Otherwise the validation can quietly become a negotiation between two implementations whose only objective is to print matching numbers.

Set tolerances from representation, not from convenience

Some differences arise from numerical representation or documented rounding. A source may round each charge to cents while another calculation sums higher-precision amounts before rounding. A currency conversion may retain more decimal places internally than the displayed statement. These details justify a declared tolerance, but they do not justify accepting any discrepancy that looks small relative to account size.

Specify where rounding occurs and what precision the source actually supports. Use exact decimal arithmetic where the accounting representation requires it, and keep unrounded intermediate values when permitted by the source. For each comparison, record the absolute residual and a scale-aware diagnostic if useful. A percentage alone can hide a missing fixed fee in a large account.

Suppose one hundred invented charges of USD 0.004 are rounded individually to zero in one convention, while their unrounded sum is USD 0.40 in another. The difference is explainable once the convention is known. It does not imply that forty cents should always be tolerated. The number of records, their precision and the method produce the bound; the desired outcome does not.

An accepted tolerance still needs an explanation. Keep exact-match, explained-rounding and unresolved categories separate. This prevents a widening threshold from becoming a substitute for investigation as the portfolio grows. A recurring residual can be operationally small and scientifically important if it reveals that the reported methodology is not the one actually implemented.

A late record should change the explanation, not erase history

Imagine that the financing charge in our main example arrives in an export the next morning. A report produced before that arrival can be complete relative to the records then available and still require revision. Keep both the economic event time and the time the research process received the record. The first determines where the charge belongs under the accounting convention; the second explains why an earlier report did not yet contain it.

A correction is different from a late first appearance. Suppose an original commission of USD 60 is later corrected to USD 55. The revised ending equity becomes USD 105,580, all else unchanged. An implementation can represent this as a reversal and replacement or another explicitly documented correction model. It must not retain both positive charge amounts and subtract USD 115. A correction links to the event it changes.

Duplicate delivery creates the opposite problem: the same economic record arrives twice without representing two charges. An identifier can help distinguish repeated delivery from a genuinely separate event, but its uniqueness scope matters. A transaction number unique within one account may collide with the same number in another account. Preserve the source and account scope when building the identity used for deduplication.

Repeated amounts and timestamps are not enough to prove duplication. Two separate fills can have the same size, price and timestamp resolution. Dropping one because its visible fields resemble another can remove real inventory. Conversely, a repeated record can contain a newly populated descriptive field while still representing the same event. Define identity from the source contract, then preserve the raw records needed to investigate ambiguous cases.

For each revised report, explain the bridge from the old result to the new one. In the correction example, the difference is five dollars of commission, not an unexplained improvement in the strategy. A versioned reconciliation makes that distinction clear and prevents a revised research curve from quietly overwriting the evidence on which an earlier decision was based.

Combining robots requires combining accounting conventions

Suppose two hypothetical robot reports each begin with USD 100,000 and end at USD 101,000. Adding their ending values gives USD 202,000 on USD 200,000 of separately assigned capital. Calling the same sum a portfolio that began with USD 100,000 would invent USD 100,000 of resources. To model a shared account, the research must specify which exposures are taken, when they overlap and how the common account is valued.

Add compatible contributions, not unrelated headline curves. A profit series based on fixed currency units cannot be treated as if it used fixed dollar exposure without reconstruction. A curve containing reinvestment cannot simply be rescaled into a constant-size portfolio after the fact. The signals may be the same, but the quantities producing the money changes differ. Reconciliation forces those assumptions into the open.

Shared positions can complicate attribution even when account equity reconciles perfectly. Two robots may request offsetting exposures that the account represents as one net position. An internal research ledger can retain the strategy-level intentions, but their attributed fills and costs must add back to the actual account events under a stated allocation policy. The existence of ten strategy labels does not imply ten independent cash accounts.

Keep an unallocated category for a valid event whose strategy attribution is unknown. That is more honest than omitting it or assigning it to whichever robot makes a comparison look cleaner. The combined account should include the amount while the attribution report flags the unresolved ownership. Account reconciliation and strategy attribution can therefore have different completion states.

This also gives the buyer of a robot package a practical question to ask: are the supplied outputs standalone studies, contributions under a common sizing convention, or an account-level reconstruction? Each can be useful. Confusing them is what causes trouble. The answer determines whether a combined curve can be formed by addition or requires a new chronological reconstruction with shared holdings and costs.

Test one deliberate error before trusting a clean report

A final exercise makes the reconciliation less ceremonial. Copy the invented ledger into a disposable worksheet and intentionally omit the USD 15 financing event. The reconstructed endpoint should become USD 105,590. Against the complete reference of USD 105,575, a residual defined as reference minus reconstruction is minus USD 15. This sign differs from our earlier example because the flawed object is now the reconstruction rather than the reported chart.

Next restore financing and duplicate the USD 60 commission. Reconstruction should end at USD 105,515, making the same reference-minus-reconstruction residual plus USD 60. The two exercises check that the report exposes both missing and duplicated costs and that the stated residual direction matches the calculation. A test that merely reports a nonzero number does not verify its interpretation.

Finally, use the partial-exit example and deliberately retain all 10,000 units in the open inventory. The gross result becomes the erroneous USD 32 rather than USD 24. A quantity-conservation check should identify 4,000 excess units, while the valuation comparison identifies the USD 8 overstatement. Two diagnostics describe different aspects of the same defect and help the reviewer locate its cause.

A reconciliation should demonstrate its ability to fail clearly. These controlled errors belong in copied educational data, never in original records. Keep the expected outcomes beside the cases. Passing them does not establish that every historical event is correct; it establishes that a few known defects are visible and interpretable through the chosen workflow. That is a stronger foundation than an unexplained green indicator.

Preserve a compact reconciliation packet

A useful packet contains the source-file identifiers, the accounting definitions, the opening and closing inventories, the classified event ledger and the residual series. Include the version of the reconstruction and a short list of unresolved items. A file hash can establish which bytes were used; it cannot establish that the data are complete or economically correct. Describe that distinction plainly.

The packet should let another reader reproduce a few selected observations without rebuilding an entire research platform. For our main example, a small table of the six contributions is enough to reconstruct USD 105,575. For the partial exit, the reader needs quantities, prices and the matching rule. For a currency conversion, the rate and timestamp are part of the evidence, not optional decoration.

Four parts of a reconciliation packet show source records, accounting definitions, reconstruction and residuals with unresolved items
A reproducible packet explains inputs, conventions, calculations and remaining differences. A checksum identifies a file; it does not certify its contents.

An AI assistant can help classify candidate event types or propose a reconciliation worksheet from documented fields. Give it a bounded, read-only task: explain how each supplied field enters the identity and flag anything that cannot be mapped confidently. Require references back to original rows. Do not accept invented conversion rates, guessed initial positions or balancing adjustments as a completed reconciliation.

The TradeAndRoll demo provides ten Forex systems, rules, source code and market CSVs for investigation. A productive first exercise is to ask what records are needed to reconstruct a portfolio curve and which assumptions must be supplied separately. The guides to portfolio exposure, overnight financing and withdrawals and recovery help develop those components. A useful curve is one you can explain from its records, including the small amounts that initially seemed too insignificant to question.

Back to the Blog