Loading…

Payroll Day Behaviour Study

"Payroll Friday trades differently" is common trading folklore, but it deserves an honest comparison rather than a chart glance. This script reads a plain text file of confirmed non-farm payroll (NFP) release dates, matches each one to its D1 bar, and reports average range in pips, average absolute open-to-close drift, and the rate of two-sided ("reversal") days, split into two groups: listed payroll Fridays versus every other Friday found in the same scanned history. NFP is usually the first Friday of the month, but not reliably enough to hard-code that rule - US holidays occasionally push the release to the second Friday, and the historical calendar has had genuine exceptions. Rather than guess, this script trusts an explicit dates file the user maintains and states plainly, in the Experts log, how many listed dates it could not match to a Friday bar in the loaded history - a wrong date in the file shows up as an honest "unmatched" count instead of silently corrupting the comparison. The reversal flag is intentionally simple: a day counts as two-sided when both its open-to-high move and its open-to-low move exceed a configurable fraction of the day's own range. It is a rough proxy for "the day didn't just walk in one direction", not a claim about intraday tick sequencing, which D1 bar data cannot reconstruct. Notes and limitations - The script does not compute or guess payroll dates itself - it only compares against dates the user supplies, and reports unmatched entries rather than silently dropping them. - A listed date that does not fall on a Friday, sits outside the scanned history, or has no D1 bar (e.g. a broker gap) is counted as unmatched and excluded from the comparison. - The reversal flag is a same-day open/high/low proxy, not a genuine tick-by-tick reversal count - D1 bar data has no finer resolution. - This script does not distinguish "beat expectations" from "missed expectations" NFP releases - it treats every listed date as one group. A user wanting that split would need two separate dates files and two runs.

Script · MT4 · v1.0 · Free

About Payroll Day Behaviour Study

Payroll Day Behaviour Study is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Symbol, Dates file name and Max days. MQL source code included.

Files in the download: PayrollDayStudy.mq4, PayrollDayStudy.txt.

Settings

SettingDefaultWhat it does
SymbolSymbol to study, blank = this chart's symbol
Dates file namenfp_dates.txtFile in MQL4\Files\, one date per line, format yyyy.mm.dd
Max days1000Most recent D1 bars to scan
Reversal fraction0.30Both open->high and open->low must exceed this fraction of the day's range to count as a two-sided (

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