거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
스크립트

Trade History Exporter for MT4 - closed trades to CSV with costs, MAE and MFE - MetaTrader 4용 스크립트

Daniel Reynolds
Daniel Reynolds
MQL4 and MQL5 developer building Expert Advisors, indicators, trade panels and utilities for MetaTrader 4 and 5.
What I build:
조회수:
302
평가:
(1)
게시됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

MT4's Account History tab is hard to analyse. Trade History Exporter writes one row per closed trade to a CSV file you can open in a spreadsheet.

Columns: ticket, symbol, type, lots, open time, open price, close time, close price, points, profit, commission, swap, net, duration, stop loss at close, MAE points, MFE points, magic number and comment.

How the figures are worked out

  • A trade closed in several parts is one row. MT4 gives the rest of a part-closed trade a new ticket with the comment "from #..."; the script follows those links back to the first ticket, and only joins parts with the same symbol, side and open time. The close price is the lot-weighted average.
  • Commission and swap from every part are added up, so "Net" is the real result.
  • MT4 does not keep the stop loss a trade was opened with, so the file shows the stop loss at close (there is no R multiple column, because it could not be worked out honestly).
  • MAE (maximum adverse excursion) and MFE (maximum favourable excursion) are the largest move against and in favour of the trade, in points, from M1 bars. This is an approximation: the first and last minute can include prices just before the entry or just after the exit, and the bars are built from Bid prices, so for sell trades the spread is not included. MT4 keeps little M1 history, so for older trades they are left blank.
  • Brokers' archive summary rows (for example "Archived Transactions") are not trades and are left out; the report says how many.
  • Dates are written as yyyy-mm-dd hh:mm:ss (server time). The file is UTF-8 with a byte order mark. A comment that starts with =, +, - or @ gets a ' in front, so a spreadsheet does not run it as a formula.

Important: the script reads the history the terminal has loaded. In the Account History tab, right-click and choose All History first if you want everything.

Inputs

Trade History Exporter for MT4 inputs

The script's inputs

  1. Days back: 0 = all loaded history.
  2. Which symbols: all symbols or this chart's symbol only.
  3. Magic number: -1 = any, 0 = no magic number (usually manual trades), any other number = only that magic number.
  4. Work out MAE and MFE from M1 bars: true by default.
  5. File name.
  6. Save in the common Files folder (shared by all terminals) instead of this terminal's MQL4\Files folder.
  7. Column separator: comma, semicolon or tab.
  8. Decimal comma: writes 1,0950 instead of 1.0950. Used only with the semicolon or tab separator.

When it finishes, a message shows the file's full path, the number of trades, the number of winners, the net result, and how many rows were left out and why.

Currency Strength Free MT4 - Eight Currency Scanner Currency Strength Free MT4 - Eight Currency Scanner

Free MQL4 currency-strength dashboard with eight major currencies, ranking across up to 28 FX pairs, broker-symbol discovery and closed-bar data-quality checks. Standalone MIT-licensed source; no trading operations.

Trade Journal Trade Journal

An advanced MT4 trade journal featuring automatic CSV logging, detailed performance statistics, per-symbol analytics, searchable trade history, and comprehensive CSV reports.

StrictJson: RFC 8259 JSON parser and writer for MQL4 StrictJson: RFC 8259 JSON parser and writer for MQL4

One include file that reads and writes JSON in MQL4. It refuses broken JSON and tells you the line and column of the mistake, keeps numbers exact, reads and writes UTF-8 files, and saves your EA's settings to a file and loads them back.

CustomStopOut: your own margin call and stop-out levels, worst order closed first CustomStopOut: your own margin call and stop-out levels, worst order closed first

A script that sets your own margin call and stop-out levels above the broker's. It alerts when the margin level falls below your margin call level and, below your stop-out level, closes open orders one at a time, the worst net result first, until the level is back up, the way a broker stop-out works.