Loading…

Performance By Symbol Report

"Which symbols are actually making me money" is a question the terminal's own Account History tab cannot answer directly - it shows every trade in one long list with no grouping and no aggregate. This script does the grouping and prints one row per symbol, sorted so the worst performer is the last thing you read. The classic bug in a report like this is counting a deposit as a trade. The history pool holds balance and credit operations alongside real trades, and a script that does not filter them out will show a symbol column with a mysterious win, or worse, silently inflate every trader's win count by one each time they top up the account. This script only ever counts a real closed BUY or SELL (MQL4) or a fully paired position built from BUY/SELL deals (MQL5). Every money column keeps its true sign. Gross loss, average loss and largest loss are all negative numbers here, not the unsigned magnitude the platform's own report prints for gross loss - net is then a plain addition of gross profit and gross loss, and no column secretly needs mental re-negation to read correctly. Profit factor is still the usual unsigned ratio, and prints "inf" rather than crashing when a symbol has no losing trade at all. Notes and limitations - MT4 can only see what the Account History tab has loaded. If a symbol you know you traded is missing, right-click that tab, choose All History, and run the script again. - Win % is winning trades divided by total trades. A breakeven trade (net result exactly zero) counts toward the total but not toward wins or losses - it is rare but real, for example a trade closed exactly at cost. - Average win/loss and largest loss print "n/a" rather than 0.00 when a symbol has no trade of that kind - a symbol with only winners has no largest loss, and 0.00 would misreport that as a trade that broke even. - The TOTAL row sums every symbol shown; it is not itself a symbol and is not part of the sort.

Script · MT4 · v1.0 · Free

About Performance By Symbol Report

Performance By Symbol Report is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 6 settings, such as Magic filter, Symbol filter and From date. MQL source code included.

Files in the download: PerformanceBySymbol.ex4, PerformanceBySymbol.mq4, PerformanceBySymbol.txt.

Settings

SettingDefaultWhat it does
Magic filter-1Magic filter (-1 = all)
Symbol filterSymbol filter ("" = all)
From date0From close time (1970.01.01 = no lower bound)
To date0To close time (1970.01.01 = up to now)
Export csvfalseAlso write the table to a CSV file
DelimiterDelimiterCommaCSV column separator

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: Alerts · MT4 Script · MQL4 Source Code

MQL4 & MQL5 scripts · PolyMaria