Guarda come scaricare robot di trading gratuitamente
Ci trovi su Twitter!
Unisciti alla nostra fan page
Script interessante?
Pubblica il link!
lasciare che altri lo valutino
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
Script

Export Closed Trades to CSV with a summary per magic number - script per MetaTrader 5

Northern Lights
Northern Lights
Trader e sviluppatore di RiskDeck per MetaTrader 5, pubblicato con il marchio Dojiwave. Creo strumenti per la parte del trading che decide se un conto sopravvive: dimensione della posizione, stop e limiti di perdita. Ogni versione viene testata su conti demo MetaTrader 5 prima di arrivare sul
Visualizzazioni:
66
Valutazioni:
(1)
Pubblicato:
Freelance MQL5 Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance

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.