Stefano Cerbioni:
MetaTrader records each trade as multiple events (deals), including entry, exit, commissions, swaps, etc., so a single trade can appear as several lines. If you simply sum all BUY or SELL deals without proper filtering, it's normal to get incorrect totals.
To avoid duplicates or irrelevant entries, it's best to also filter by DEAL_ENTRY == DEAL_ENTRY_IN, which ensures you only count actual market entries. This excludes commissions and partial closures, giving you a more accurate volume.
Stefano Cerbioni:
Metatrader not create a classical report with ticket side etc... but mix them all

MT4Orders QuickReport
- www.mql5.com
Fast JavaScript version of Report library from fxsaber for MT4-style trading commands implemented via MT4Orders or Virtual. Works up to 10 times faster, NTML file size is smaller, can upload and display up to 5.4 million report lines.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi i have this code for extract the history of the day
initially i suppose it work good but , hey murphy law is behind the corner ahhahah , return me always worng total of the day , but i try to export in xml for find a ticket or date but with my surprise i notice that Metatrader not create a classical report with ticket side etc... but mix them all , i dont know why complicate a simply things but , more complicate is much better ahahahaha , example:
i find operation date 2025.05.26 09:37:31
2025.05.26 09:37:31 8421178 EURUSD sell 0.1 1,14107 1,14103 2025.05.26 09:40:04 1,14147 - 0,70 0,00 - 4,00
and this
2025.05.26 09:37:31 8421178 EURUSD sell 0.1 / 0.1 market 2025.05.26 09:37:31 filled
and this
2025.05.26 09:37:31 8165316 EURUSD sell in 0.1 1,14107 8421178 - 0,70 0,00 0,00 0,00 1 156,73
always the same trade but one trade Metatrader split in 3 or many line why this complication ?o_O, but the strange effect is when i call history not return a correct value anyone have some idea ? thanks