Loading…

Day Of Week Return Study

Day-of-week seasonality gets repeated as folklore far more often than it gets measured. This script measures it directly: for a chosen symbol and timeframe, it computes the close-to-close percentage return of every bar, groups the returns by the weekday of the bar, and reports the count, mean, standard deviation and the percentage of days that closed positive for each day that actually has samples in the loaded history. Returns are computed as percentage change, not price or money, so results from a 4-digit forex pair and a 2-digit index are on the same scale and can be compared without any lot size or contract size entering the arithmetic at all. The sample count is printed next to every average deliberately. A weekday with eleven return samples and one with eleven hundred can show a similar mean, but they are not the same claim, and a table that hides the count behind a clean-looking percentage is the exact kind of overconfidence this script exists to prevent. Notes and limitations - A weekday with zero samples in the loaded history (Saturday and Sunday on most forex feeds) is left out of the table entirely rather than printed as an empty row. - This studies whichever timeframe is selected; running it on an intraday timeframe produces one return per bar, not one per day, so the weekday groups become the sum of many intraday moves rather than a single daily return. Use D1 for a genuine day-of-week study. - Standard deviation is the population figure over the samples in the loaded window, not an estimate with a confidence interval attached - treat it as descriptive, not as a hypothesis test. - This is a descriptive study, not a trading signal, and says nothing about spread, slippage or whether the pattern shown has been stable over time rather than concentrated in one period.

Script · MT4 · v1.0 · Free

About Day Of Week Return Study

Day Of Week Return Study is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Symbol, Timeframe and Max bars. MQL source code included.

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

Settings

SettingDefaultWhat it does
SymbolSymbol to study, blank = this chart's symbol
TimeframePERIOD_D1Timeframe to study
Max bars3000Most recent bars to include
Save csvtrueWrite the weekday 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