Inside this article

Orders, deals and positions are different

MetaTrader 5 separates an order instruction, an executed deal and the resulting position. One trade idea may include multiple executions. A journal that counts every deal as a separate trade inflates activity metrics, win rate and possibly the displayed performance of a strategy. Trace the lifecycle before calculating statistics.

Define the account boundary

Start reconciliation with login, server and linked account identifier. Two accounts may reuse the same symbol or numeric ticket without representing the same exposure. Every imported record needs a stable scope and origin. Switching an MT5 account must never mix the old account history with the new account dashboard.

Open positions versus historical executions

An open-position feed describes current exposure; deal history records execution events. Importing only closed deals hides an active trade. Importing both position rows and opening deals without linking them duplicates a trade. Maintain separate raw datasets and then aggregate by the relevant position identity.

Partial closes and reversals

A partial close reduces the remaining volume and generates its own execution and financial result. In netting mode, another order may reduce or reverse a position, while in hedging mode separate positions can coexist. Grouping only by symbol is therefore unsafe. Use lifecycle evidence and position identifiers.

Time zones and close dates

Broker server time is not necessarily UTC or Europe/Rome. Store normalized ISO timestamps with explicit timezone information or epoch milliseconds, and preserve the original value for diagnostics. Never interpret an ambiguous local date as a global instant. The same close must belong to a consistent reporting day.

Net profit has several components

Useful account metrics include gross profit, commissions, swaps and possible fees. Some charges appear as separate account-history events. Avoid charging a fee twice and preserve the source deal identification. Reconcile the final total against the MT5 History tab instead of trusting a polished performance chart.

Provider lag and pending closure

A close may already be visible in the trading terminal before a third-party provider delivers it. A pending close check is a statement of missing confirmation, not permission to mark the trade closed. Request incremental updates and compare position IDs and timestamps. Repeated reconciliation must be idempotent.

Measure missing records explicitly

Choose a sample of trading days and compare raw deals, live positions, normalized open and closed trades, fees and aggregate net result. Contrast terminal, provider and what the journal actually renders. Track precisely where counts diverge. A small UI list is not evidence that the back-end records are complete.

Add behavioral context

Once execution data is reconciled, annotate setup, session, confirmation, planned risk, reasons for entry and emotional state. Correct synchronization does not establish a correct decision. A Discipline Score should be based on decision quality and trading rules rather than the raw count of transaction events.

Troubleshoot without deleting history

Trace a problematic ticket from original order through deals, position and journal aggregation. Inspect cache behavior in the browser and Android separately, then check date parsing, pagination and connection cutoffs. Do not reset an entire account or delete records before identifying the precise failure path.

Technical reference: MQL5 Orders, Positions and Deals and the MetaTrader 5 terminal. Educational workflow: think, measure, act and review.

## Two fills, one trading idea

A trader may open a position and add volume when a second planned area is reached. These are distinct executions with different fill prices and charges, but potentially one decision process. Preserve both levels: the raw event ledger for costs and the aggregated journal trade for behavior. Deleting one deal to improve the trade count destroys useful evidence.

## Partial-close accounting

When only part of a position is closed, maintain the remaining exposure as open and recognize the realized result on the closed portion. Do not recognize that same cash flow again when the remainder closes. Map swaps and commissions to their source records. Compare the total with actual MT5 account history rather than a visual equity graph.

## An apparently missing close

The terminal can display a close before a data service supplies it. Before adding a manual substitute, check server time versus UTC, account selection, import cutoff and sync window. Inspect UI caches too: records may be stored but not rendered. Adding a duplicate trade as a latency workaround makes subsequent reconciliation harder.

## Use diagnostic counters

Track raw provider deals, unique deals after deduplication, normalized trades, confirmed closes, live positions and visible journal rows independently. A difference between deal count and trade count can be legitimate, or it can reveal broken filtering. Investigate individual identifiers and lifecycle events instead of relying on total rows.

## Preserve the event ledger

An immutable raw-event ledger allows the aggregation algorithm to be corrected without erasing the original evidence. Every displayed journal trade should be traceable to its constituent deals. That matters for reversals, partial exits and charges represented by separate ledger events.

## Definition of a passing test

Reconciliation is convincing when groups and positions are explainable, monetary totals agree within documented differences, account boundaries are respected and repeated syncs produce no duplicate trades. Recheck browser and Android separately. Manual emotion notes are a different source of information and must survive the data refresh.