Performance By Weekday Report
"I trade badly on Fridays" is the kind of thing traders say to themselves without ever checking it against the actual numbers. Confirming or denying it by hand means scrolling the account history tab and sorting dates in your head. This script does the grouping properly, once, and prints every weekday in one table. The first trap is what counts as a trade. Balance and credit operations sit in the same history alongside real trades - a deposit or a withdrawal is not a market trade at all. A script that sums profit over the whole history without filtering by deal type first will fold a deposit straight into a weekday's gross profit and report numbers that do not reconcile with the account statement. This script checks the trade type before a history entry is counted anywhere, on both platforms. The second trap is the profit factor. It is gross profit divided by the size of gross loss, and a weekday that has only ever produced winners has a gross loss of exactly zero. Dividing by that either throws a runtime error or, depending on how the naive version is written, silently prints zero or a huge meaningless number. This script checks for a zero denominator first and prints "inf" when every trade on that weekday won, and "n/a" when the weekday has no result to divide at all. The third decision is what to do with Saturday and Sunday, and it is where this script deliberately behaves differently from a by-hour version of the same idea. A 24-hour table always prints all 24 hours, because every hour is structurally capable of holding a trade. A week is not symmetric that way - most retail brokers do not open on the weekend, so a Saturday or Sunday row is usually empty by construction, not because nothing happened to check. This script always prints Monday through Friday, padded with em-dashes when a weekday genuinely has zero trades, but only prints Saturday or Sunday at all when at least one trade actually opened there. A broker running on a server time offset a few hours from GMT can stamp a trade placed late on a Friday evening in one time zone as already Saturday in another, so a weekend row is not impossible - it is just conditional, and padding it in every report would manufacture two rows of "0" that mean nothing for most accounts. Notes and limitations - The weekday used for grouping is the broker's server time, not the trader's local time zone and not GMT. A trade you remember placing on Friday evening your time can land in the Saturday row if your broker's server is far enough ahead of you, and the reverse can happen just as easily. Check your broker's server time offset against your own clock before drawing conclusions from a weekend row. - Grouping is by the day a trade opened, not the day it closed. A trade opened late on Friday and closed the following Monday is still counted in the Friday bucket, which is deliberate - the entry decision is what a trader is usually trying to evaluate. - Saturday and Sunday rows are omitted entirely when the account has no trade opened on either day, rather than being printed with em-dashes like an empty weekday. Do not read a missing weekend row as "not checked" - it means checked and genuinely empty. - Only closed market trades are counted. Pending orders that were cancelled without filling, and orders still open at the time the script is run, are not part of this report. - Net profit per trade is the sum of profit, swap and commission, the same net-of-costs figure used across this catalogue. A trade with a net result of exactly zero is counted toward that weekday's trade total but affects neither the win count nor either gross figure. - The account history in the terminal can be pruned or limited by the broker and by the terminal's own history depth setting. This script reports on whatever history is currently loaded locally - it does not request a longer history from the server. - This is a read-only report. It never sends, modifies or closes an order.
Script · MT5 · v1.0 · Free
About Performance By Weekday Report
Performance By Weekday Report is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 2 settings, such as Write csv and Csv delimiter. MQL source code included.
Files in the download: PerformanceByWeekday.ex5, PerformanceByWeekday.mq5, PerformanceByWeekday.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Write csv | false | Also write the table to a CSV file |
| Csv delimiter | , | CSV field delimiter |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Alerts · MT5 Script · MQL5 Source Code