In this article
After this article, you can
- Preserve complete identifiers through import and export.
- Distinguish matching keys from reconciling prices, charges and balance.
Terms at hand: Order execution · Balance · Commission
A broker report and a spreadsheet can have identical row counts and financial totals but different operation identifiers. This can happen when a program turns a long ID into a number and loses its final digits. A subsequent table join may then attach a fee to the wrong execution. The two fictional IDs below let you check an import and export round trip without guessing which digits should be restored.
Why should a trade identifier remain text?
An ID answers which record, not how much money. Adding order numbers is meaningless. Every character can matter, including a leading zero. Profit, commission and volume are separate fields intended for arithmetic. Decide their types before building formulas in your trading spreadsheet. An attractive dashboard does not resolve an ambiguous record key.
Microsoft describes Excel's 15-digit numerical precision and recommends text for longer codes. This does not mean every broker uses long tickets. We are examining an import mechanism affecting an execution ID, order ID or another key. Inspect the raw representation rather than relying on an abbreviated cell display or a familiar-looking number.
Establish what the column identifies. In MT5, order and execution identifiers are distinct; DEAL_ORDER and DEAL_TICKET have different meanings. The same order number appearing alongside several fills need not be an error. Deduplication requires the appropriate key and a stated record definition. Removing every repeated label can remove legitimate operations.
How can two operations acquire the same key?
Own model: losing the sixteenth digit
Take two fictional IDs: 2026101300000001 and 2026101300000002. Our controlled numeric-import variant keeps the first 15 digits and replaces the sixteenth with zero. Both become 2026101300000000. The text variant preserves both complete strings. This is a supplied model, not a real account export or proof that your Excel settings perform the conversion.
| Original ID | Model's numeric conversion | Text import |
|---|---|---|
| 2026101300000001 | 2026101300000000 | 2026101300000001 |
| 2026101300000002 | 2026101300000000 | 2026101300000002 |
The original has two distinct keys; the revised list has one. Both still contain two rows. Deduplicating would remove an operation, while joining another table on the damaged key could create ambiguous matches. A matching profit total does not automatically expose the error. Record identity and monetary reconciliation are separate checks.
Two IDs, one damaged key
Compare complete character strings. Scientific notation in a display alone does not establish lost data: inspect the value and export. Do not append 1 to the first row and 2 to the second based on their order. Real history may be reordered, incomplete or contain additional operations. A damaged key does not retain enough information to choose the correct original.
How do you import without losing characters?
Keep an unchanged source copy outside the working workbook. Inspect a sample in a text editor, including the heading and complete IDs. Distinguish the provider download from a copy already saved by Excel. Calling a file original does not establish its provenance; record retrieval time and report scope separately. Use copies for experiments so the reference remains available.
Use a controlled text/CSV import and explicitly assign text type to identifier columns. Microsoft's guide describes this in Power Query. Inspect the query steps: if an earlier step converted the value numerically, changing to text afterwards cannot recover missing characters. Restart from the preserved source and correct the conversion sequence rather than formatting damaged values.
Excel's import options include automatic conversions for long numbers, leading zeros and some date-like strings. Availability varies by edition, so inspect your version. A setting on one computer does not establish settings on another. A shared workbook needs a documented import procedure, not only an assurance that it worked for its creator.
After loading, inspect a sample, save a copy and export it again. Read that file as text and compare it with the reference. This tests the whole source → import → export route. Showing all digits in a workbook is insufficient if a different representation later reaches your journal, another program or a joined table. Check the artifact actually used downstream.
What does the local ID comparator check?
Paste two lists: original IDs and IDs after the spreadsheet round trip. Use one identifier per line, without a CSV heading, other columns or quotation marks. Allowed characters are ASCII letters, digits, underscore, dot, colon and hyphen. Each list permits 10,000 nonempty lines and each ID permits 128 characters. Leading or trailing whitespace is an error; it is not silently trimmed. Each list also permits at most 20,000 total lines, including blank lines, and 1.5 MB. Letter case matters: ABC and abc differ.
Check whether IDs survived import
Our teaching example runs locally in your browser: it does not connect to an account or API, send your entries or save them persistently. Do not enter passwords or personal details.
The tool preserves zeros and compares occurrences of exact strings rather than numerical sums. It reports missing and additional identifiers and repetitions. In our example, both original IDs disappear and the new key occurs twice. A pattern consistent with truncation after digit 15 is a diagnostic hypothesis, not proof that Excel caused the difference. Reordering alone should not change occurrence counts.
The checker operates locally on pasted lists. It does not sign in to a broker, verify identifier authenticity or reconstruct trades. Matching lists do not validate prices, amounts, dates or fees. Compare appropriate scopes separately when reports cover multiple accounts. The same label outside a defined scope does not automatically refer to the same operation. Do not merge unrelated reports to force a match.
For a discrepancy, preserve both copies and locate the first transformation. Do not guess corrections. Linking executions to a shared position needs reliable relationships; checking identifiers prepares that input but does not itself allocate profit to robots. Record the reconciliation in your journal before using its statistics to assess performance.
What should you do before calculating from the report?
- Select one identifier column and state the record it identifies. Preserve the source before opening a workbook. Inspect the longest IDs and leading zeros. Without the initial export, disclose that limitation instead of treating a later copy as a reliable reference.
- Repeat the import with explicit text type for IDs, retaining appropriate numeric types for monetary fields. Check automatic-conversion steps and the exported result. Compare complete lists and occurrence counts, rather than only the first few cells displayed on screen.
- If characters were lost, obtain the original file or request a fresh provider export. Do not reconstruct suffixes from row order. After reconciling keys, check joins, prices, costs and balance separately. Passing one check does not replace the others.
Check your understanding
One short exercise
About 2 min · you can try again
The model's two distinct IDs both end in 0 after import. Row count and monetary total match. What should you do?
- Remove one row as a duplicate.
- Return to the original, repeat text import and compare complete IDs.
- Append 1 and 2 in row order.
Check the answer and explanation
Return to the original, repeat text import and compare complete IDs.
Correct. Recover missing characters from a reliable source rather than guessing from the total.
Frequently asked
Does an E+15 display prove Excel damaged an ID?
Not by itself. Scientific notation may be only a display choice, so compare the complete value and exported file with the original. If numeric conversion removed final digits, widening the column or changing its format cannot reconstruct those digits. Keep identifiers as text from the import stage. For a discrepancy, return to the source and locate the transformation rather than diagnosing the problem solely from cell appearance or a matching monetary total. Those are different checks.
Does changing to Text after import restore missing digits?
It cannot recover characters already lost during conversion. In our model, two complete IDs became the same string ending in zero; that string cannot tell you which row originally ended in 1 or 2. Obtain the appropriate source export or use an unchanged preserved copy. Assign text type before conversion and check the subsequent export. Do not repair identifiers from row order: sorting, missing fills and other operations can change that order without preserving the original relationship.
Should every repeated ID be removed from a report?
No. Establish whether the column identifies an order, execution, position or another object. Several fills of one order may legitimately repeat its order ID. The checker reports occurrences but does not know your report's record definition. Removing a damaged-key duplicate may erase a separate operation; removing a legitimate repeated order label may omit a fill. Compare the appropriate fields and report scopes, preserve the original and reconcile quantities and monetary amounts as separate checks before discarding anything.
Do matching ID lists validate the whole trading journal?
They establish only agreement between the identifiers and occurrence counts you checked within the selected scope. They do not establish correct prices, currencies, charges, dates or quantities. Two files can retain identical IDs while changing their amounts. After checking identifiers, inspect table joins, cost totals and balance using a consistent data version. Record the report scope and key definition too: an identical list without account or operation-type context can still lead to inappropriate matches in a wider dataset.
Sources & bibliography
-
Microsoft Format numbers as text · Numerical precision up to 15 digits and text storage for longer codes. support.microsoft.com ↗
-
Microsoft Keeping leading zeros and large numbers · Text import using Power Query, leading zeros, limitations of formatting after digit loss and edition-specific features. support.microsoft.com ↗
-
Microsoft Data import and analysis options in Excel · Automatic conversion options for long numbers, leading zeros and date-like representations. support.microsoft.com ↗
-
MetaQuotes Ltd MQL5 Reference — Deal Properties · DEAL_TICKET identifies a deal and DEAL_ORDER its order; they are different keys. www.mql5.com ↗
