Trade History to Excel
- Yardımcı programlar
-
Mohamed-amine Baddir
MetaTrader 5 için Expert Advisor'lar geliştiriyorum ve gerçek işlemlerde kullanmadan önce bunları düzgün şekilde test ediyorum.
Yaptığım işler:
- Stratejinizi, TradingView scriptinizi veya yazılı işlem kurallarınızı temiz ve profesyonel bir MT5 Expert Advisor'a dönüştürmek - Sürüm: 1.0
Trade History to Excel turns saved Strategy Tester reports, or the trading history of your account, into a real Excel workbook (.xlsx). Every report goes into the same file: one summary row per report, every closed trade with its entry and exit price, every deal, and the results of each day and month with the balance. Dates are Excel dates, numbers are numbers, the header row is frozen and every sheet has filters, so you can sort, filter, build pivot tables and charts right away.
How To Use
- Backtests: in the Strategy Tester, right click on the Backtest tab > Report > save it as HTML into MQL5\Files\TradeExcel (File > Open Data Folder). Save as many reports as you like.
- Account: set "Trades to export" to the history of this account; filter by start date, magic number and symbol if needed.
- Attach Trade History to Excel to any chart. Open MQL5\Files\TradeExcel\Backtests.xlsx (or Account_<login>.xlsx) in Excel.
The Sheets
- Summary: one row per report: expert, symbols, period, first and last deal, deposit, net profit, gross profit and loss, profit factor, trades, win rate, average win and loss, expectancy, swap, commission, maximal balance drawdown in money and percent, deposits and withdrawals, final balance, and a check that the deals add up to the final balance.
- Trades: every closed trade: open and close time, symbol, side, volume, entry and exit price, profit, swap, commission, net profit, hours held, balance after the trade.
- Deals: every deal as in the report: time, ticket, symbol, type, direction, volume, price, order, commission, swap, profit, balance, comment.
- Daily: net profit, number of deals, deposits and withdrawals, balance at the end of each day.
- Monthly: the same by month with the balance at the start and the return of the month.
Checks
- For five test reports, net profit, profit factor and maximal balance drawdown (money and percent) are the same as in the Strategy Tester report.
- The workbooks open in Microsoft Excel without any repair message.
- Trades closed in parts and reversals are matched with their entries, oldest first (reports have no position numbers). In the account history, trades are matched by position.
- Files that are not Strategy Tester reports are listed as not read.
Inputs
- Trades to export: saved Strategy Tester reports, or the history of this account
- Folder in MQL5\Files with the saved reports, or the report files separated by ;
- Folder in the common Files folder of all terminals
- Account history: from date, magic number, symbol
- Workbook name
Good To Know
- Reports of any terminal language are read.
- Up to 50 reports and 200,000 deals per report in one workbook.
- Close the workbook in Excel before running the utility again, so the file can be replaced.
- The demo runs in the Strategy Tester: put saved reports into the common folder Files\TradeExcel (File > Open Common Data Folder); the workbook is written when the test ends.
- The utility reads files and history only. It does not trade and does not change any setting.
- The screenshots show tests of example strategies. They show the workbook, not trading results to expect.
- To see why an Expert Advisor earns a different amount live than in the backtest, trade by trade, see Backtest vs Live by the same author.
