Alım-satım robotlarını ücretsiz olarak nasıl indirebileceğinizi izleyin
Bizi Telegram üzerinde bulun!
Fan sayfamıza katılın
Kodu ilginç mi buldunuz?
Öyleyse bir link gönderin -
başkalarının da faydalanmasını sağlayın
Kodu beğendiniz mi? MetaTrader 5 terminalinde deneyin
Komut dosyaları

Export Closed Trades to CSV with a summary per magic number - MetaTrader 5 için komut dosyası

Northern Lights
Northern Lights
Trader ve Dojiwave markasıyla yayımlanan MetaTrader 5 aracı RiskDeck'in geliştiricisiyim. Trading'in bir hesabın ayakta kalıp kalmayacağını belirleyen kısmı için araçlar yapıyorum: pozisyon büyüklüğü, stoplar ve zarar limitleri. Her sürüm Market'e çıkmadan önce MetaTrader 5 demo hesaplarında test
Görüntülemeler:
77
Derecelendirme:
(1)
Yayınlandı:
MQL5 Freelance Bu koda dayalı bir robota veya göstergeye mi ihtiyacınız var? Freelance üzerinden sipariş edin Freelance'e git

The History tab in MetaTrader 5 lists deals and orders, not trades. This script rebuilds each closed trade from its deals and writes one row per trade to a CSV file you can open in Excel, LibreOffice or Google Sheets.


Inputs

  • Period: This month, Last month, This year, All history or Custom. A trade counts in the period by its close time.
  • Custom period: From and To. A To date with no time includes that whole day.
  • Symbol: one symbol or empty for all symbols.
  • Magic number: one magic number or -1 for all trades.
  • Column separator: comma, semicolon or tab.

File 1: ClosedTrades_<login>_<period>.csv

One row per closed trade: OpenTime, CloseTime, Symbol, Type, Volume, OpenPrice, ClosePrice, StopLoss, TakeProfit, Commission, Swap, Fee, Profit, NetProfit, Magic, Comment, CloseReason, PositionTicket.

File 2: ClosedTradesByMagic_<login>_<period>.csv

One row per magic number and one row for all trades: Magic, Trades, Wins, Losses, NetProfit, GrossProfit, GrossLoss, LargestLoss, LongestLosingStreak, WinRatePct.

How to use

  1. Copy ExportClosedTrades.mq5 to the MQL5\Scripts folder and compile it in MetaEditor.
  2. Drag the script onto any chart, set the inputs and press OK.
  3. The Experts tab shows where both files were saved and how many rows each has. To find them, use File > Open Data Folder > MQL5\Files.

Notes

  • A trade closed in parts is one row. Its exit price is the average of the exits, weighted by volume.
  • Open positions are not exported.
  • Files are UTF-8 with a BOM. Prices and money use a decimal point.
  • The script only reads the account history. It doesn't place, change or close orders.
  • If the terminal isn't connected, the journal says so, because the history may be incomplete.
  • If a file is open in another program, the script can't overwrite it and writes the reason to the journal.
Account Recorder - balance, equity and day drawdown to CSV every minute (service) Account Recorder - balance, equity and day drawdown to CSV every minute (service)

A service that writes your balance, equity, floating result, margin and the drawdown from today's highest recorded equity to a CSV file every minute. Runs without a chart and never trades.

GotobiDays - include file to find Gotobi days (Japanese payment dates) GotobiDays - include file to find Gotobi days (Japanese payment dates)

Include file with small functions to find the Gotobi days: the 5th, 10th, 15th, 20th, 25th and the last day of each month, moved back to the previous business day when they fall on a weekend or a holiday you list. Information only, no trading functions.

History Depth Check - how far back your EA can read on each timeframe History Depth Check - how far back your EA can read on each timeframe

Shows, for each timeframe and symbol, how many bars an EA, indicator or script can read on a live chart and from what date, and flags the timeframes where "Max bars in chart" cuts off older history that the terminal already has.

MACD Signals MACD Signals

Indicator edition for new platform.