ExportTradingDeals

ExportTradingDeals is a MetaTrader 5 script that exports your complete deal history to a CSV file. The file is consumed directly by the Trading Stats desktop application to produce charts and statistics about your trading performance. Trading Stats is a free, open-source application; pre-built Ubuntu / Debian and Windows packages are available on the project releases page (search: alinsoare/trading-stats on GitHub).

What it does

When you run the script, it reads all deals from your account history within the selected date range and writes them to a CSV file in the MetaTrader shared files folder. The file is always overwritten, so re-running the script gives you an up-to-date snapshot at any time.

Output file location

The CSV is written to MQL5\Files\trading_stats\deals_<login>.csv inside the MetaTrader terminal data folder. One file is created per account login number. Open the MetaEditor file manager or use File → Open Data Folder to browse to this path.

Main features

  • Full history export. Exports every deal type: buy, sell, balance, credit, commission, swap, and other non-trade entries. A dedicated column flags non-trade deals so they can be filtered in the dashboard.
  • Configurable date range. Choose a custom start date or export from the earliest available server history. By default the end of range is always the current server time, but a fixed end date can also be set.
  • One file per account. The output filename includes your account login number, so running the script on multiple accounts never overwrites a previous export.
  • Standard CSV format. Columns: ticket, time, time_msc, type, entry, symbol, volume, price, commission, swap, profit, magic, comment, position_id, reason, login, server, is_non_trade. Compatible with Excel, Python pandas, and the trading-stats application.
  • Safe on repeated runs. The file is opened with FILE_WRITE which truncates and rewrites. Running the script twice does not produce duplicates.

How to use

Drag the script from the Navigator onto any chart. The input dialog opens where you can set the history start date and choose whether to use the current server time or a fixed end date. Click OK and the script runs instantly. A message in the Experts log confirms how many rows were written and the full file path.

Input parameters

History from — start of the export range as a datetime value. Set to 0 (default) to begin from the earliest deal available on the server.

History to now — when enabled (default), the export always ends at the current server time. Disable this to use the custom end date below.

History to (custom) — end of the export range when History to now is disabled. Set to 0 to fall back to the current server time.

Notes

If the trading_stats subfolder does not yet exist, the script creates it automatically. The export runs on the history loaded in the terminal; if the server has not delivered older history yet, scroll the chart back or use Tools → History Center to load more data before running the script.

Trading Stats is a free, open-source desktop application. Pre-built Ubuntu / Debian (.deb) and Windows installer packages are available on the releases page of the project (search: alinsoare/trading-stats on GitHub). No build step is required when using a pre-built package.

Support

For questions, use the comments section on this product page or contact the author through the MQL5 messaging system.

Altri dall’autore
ChartMarker
Alin-marian Soare
ChartMarker is a chart-window indicator for marking up your charts with trend lines and order blocks. You draw directly on the chart with mouse clicks instead of switching MetaTrader drawing tools on and off. ChartMarker keeps markup fast and consistent during review and live trading. One compact panel controls the active tool, visibility, cleanup, and backup. Drawings stay on the chart as standard objects you can still select and adjust in MetaTrader when needed. Main features Trend lines fro
FREE
SimpleMACD
Alin-marian Soare
SimpleMACD is a clean, configurable MACD indicator for MetaTrader 5. It computes the classic three-component output — main line, signal line, and histogram — using a transparent EMA implementation with an SMA seed that matches the standard MetaTrader behavior. Why traders use SimpleMACD SimpleMACD gives you a straightforward MACD with no hidden modifications. All EMA periods and the applied price are configurable, so you can match any published MACD setup exactly. The histogram color flips autom
FREE
Filtro:
Nessuna recensione
Rispondi alla recensione