Custom USD CSV mapping: gross, net and fee signs
See how declared gross/net meaning and fee signs change a custom USD CSV mapping, with two invented three-row reconciliations and explicit rejection counts.
Declare meaning before renaming columns
A column called Result does not establish whether fees have already been deducted. A proposed custom mapping must declare amountMeaning as gross_before_costs or net_after_costs, and costSign as positive_charge or negative_debit. With gross input, net = amount − normalized costs. With net input, net = amount and gross = amount + normalized costs. Positive charges stay positive; negative debits are negated into nonnegative costs. Subtracting fees from an already net amount counts them twice. These are structural and arithmetic conventions, not trading advice or performance claims.
Keep the fixed checker separate
The existing USD CSV checker accepts exactly date,pair,gross,costs,notes in that order, with real YYYY-MM-DD dates, uppercase AAA/BBB pairs, dot decimals with at most two places and nonnegative costs. Gross must exclude the costs being subtracted. It does not offer a gross/net or fee-sign selector for arbitrary columns. The custom mapping logic instead requires an agreed profile: eight distinct required fields for source ID, date, pair, amount, costs, currency, status and notes within at most 40 declared columns. Headers must match the declared order exactly; formats are not guessed. The examples below describe proposed profiles for that logic, not files to upload unchanged to the fixed checker.
Example 1: gross amounts with positive fees
Use this invented header in order: Ticket,ClosedOn,Symbol,Result,Fee,Currency,State,Comment. Map those columns respectively to sourceId,date,pair,amount,costs,currency,status,notes; declare YMD dates, slash pairs, USD currency, closedStatus Closed, gross_before_costs and positive_charge. Exactly three synthetic data rows are: A,2026-02-01,EUR/USD,120.35,2.10,USD,Closed,Synthetic A; B,2026-02-02,GBP/USD,-40.20,0.80,USD,Closed,Synthetic B; C,2026-02-30,USD/JPY,15.00,1.00,USD,Closed,Synthetic C. Each semicolon separates a CSV record here, not a field. C is rejected with DATE because February 30 is invalid. Count all records: 3 input = 2 accepted + 1 rejected.
Recompute gross-input totals in integer cents
Independently convert the written decimals to cents before calculating. A: gross 12035 − costs 210 = net 11825. B: gross −4020 − costs 80 = net −4100. Accepted source amount and gross are 12035 − 4020 = 8015; costs are 210 + 80 = 290; net is 11825 − 4100 = 7725 cents (USD 77.25). C would arithmetically contribute 1500 − 100 = 1400 cents, but is excluded. Arithmetic across all three is gross 9515 − costs 390 = net 9125 cents; the 1400-cent difference is the rejected record. Keep its rejection in the reconciliation; accepted-only totals do not establish completeness.
Example 2: net amounts with negative fee columns
Use the same declared header and column assignments, YMD dates, slash pairs, USD and closedStatus Closed, but declare net_after_costs and negative_debit. Exactly three invented rows are: N1,2026-02-01,EUR/USD,118.25,-2.10,USD,Closed,Synthetic N1; N2,2026-02-02,GBP/USD,-41.00,-0.80,USD,Closed,Synthetic N2; N3,2026-02-03,USD/JPY,14.00,1.00,USD,Closed,Synthetic N3 wrong fee sign. N3 has a positive fee under a negative-debit profile and is rejected with FEE_SIGN. Again, 3 input = 2 accepted + 1 rejected. A mixed sign must not be silently repaired: rebates and mixed conventions require a different agreed format.
Recompute net-input totals without a second deduction
In integer cents, N1 supplies net 11825 and signed fee −210: normalized costs = 210 and reconstructed gross = 11825 + 210 = 12035. N2 supplies net −4100 and signed fee −80: costs = 80 and gross = −4100 + 80 = −4020. Accepted source amount equals net: 11825 − 4100 = 7725 cents. Accepted gross 8015 − costs 290 = net 7725 cents (USD 77.25), matching Example 1 without subtracting costs twice. The raw source amounts of all three sum to 11825 − 4100 + 1400 = 9125 cents; 1400 belongs to rejected N3. Its fee violates the profile, so there is no accepted gross/cost reconstruction for N3 and no valid full-file mapped total. Do not use an absolute-value repair to hide that rejection.
Retain the report and respect the boundary
The mapping report records input, accepted and rejected counts, rejection details, accepted-only totals and the declared profile. Its accepted export is normalized CSV; source IDs remain in the local report rather than the five-column CSV. This is not a certified statement or proof of completeness. Scope is USD-only, already closed and aggregated rows, up to 1 MiB and 1,000 data rows. There is no fill matching or currency conversion. The fixed checker does not infer currency from numbers.
Describe a format without sending trading records
Open the existing checker using the tool link below. For other columns, use the format request checklist and format inquiry links in Sources and conventions. Describe column order, desired output, date format and timezone, currency, whether the amount is gross or net, fee signs and whether rows are closed and aggregated. Use invented examples only in inquiries; send no actual trading files, records, identifiers or credentials. The form has no attachments. An inquiry does not place an order or guarantee a quote; custom availability, scope and prices are unconfirmed. Replies and response times are not guaranteed.
Sources and conventions
Examples are hypothetical. Arithmetic follows the formulas documented in our methodology. Broker contract specifications determine actual lot, margin and execution conditions. These sources document definitions and data; a source link does not imply endorsement of SanForex or a trading service.
- SanForex: fixed checker and custom-format scope ↗
- CSV format request checklist ↗
- Ask about a format using invented examples only ↗
These materials are prepared with AI assistance and checked against worked examples and deterministic calculation tests where applicable. They are not an expert suitability assessment or investment advice.
Open trade csv checker tool ↗