Concept 10 / 52·Time & Sessions·Calendar effects
‹ Commodity Channel Index (CCI)Divergence ›

Day-of-Week Effects in Pine Script

weekday filter · weekday seasonality · Monday effect · weekend effect · calendar filter

Systematic differences in return, range or behaviour by weekday, used as a filter that allows a rule only on the days it has earned; most calendar patterns are weak and fade.

Reads best on: Daily and intraday charts on markets with a weekly calendar of events: index futures, US stocks and FX. On seven-day crypto markets the weekend is always blocked by the implementation.
On this page: the Pine v6 script, checked, drawn on real NVDA bars. Backtest it free, costs charged, every trade on the chart.
01

Definition

Day-of-week effects are systematic differences in how a market behaves on each weekday: average return, average range, volume, or the tendency to trend or reverse. They belong to the calendar effects family, alongside turn-of-the-month and holiday patterns, and they are used on a chart as a filter rather than a trigger. A weekday filter switches a rule on for the days where it has held up and off for the days where it has not. Examples are no breakout trades on Mondays, or no new positions on the Friday of a monthly options expiry.

Where the effects are real, they come from the calendar of events and behaviour that repeats each week. Weekend news is priced on Monday's open; US employment data usually arrives on the first Friday of the month; index options expire on the third Friday; central bank decisions cluster mid-week; traders reduce risk into weekends and rebuild it early in the week. Those structural facts shape range and volume by weekday more reliably than they shape direction. That is why a filter on range, or on a rule's own results, holds up better than a bet that a given weekday goes up.

The academic literature on the weekend effect, starting with French's 1980 study of lower Monday returns in US stocks, is the origin of the idea, and much of that early effect faded after publication. The standard practice now is empirical: measure a rule's results by weekday over a long sample, keep the days that carry the effect, and require a large enough sample per day before believing any of it. The implementation here is a switchboard: five weekday toggles, a tint on the blocked days, and a mark at the start of each allowed day, with no signal of its own.

On the chart, expect the blocked days to be shaded and the first bar of every allowed day to be circled, on intraday and daily charts alike, and no Long or Short marks. Expect the weekday to be read on the exchange's clock, so a bar just after midnight in New York belongs to the new day there. Expect Saturday and Sunday to be always blocked, since the filter has no weekend switches, which matters on crypto and on FX charts that open on Sunday evening. And expect the filter to do nothing visible until it is combined with a rule.

02

Reading the chart

A weekday effect is found in the numbers, not on the chart, so identification is a measurement followed by a sanity check.

  1. Choose the quantity to measure: the return of the day, the range of the day, or the results of a specific rule by the weekday of its entry. Rules and ranges give more stable answers than raw direction.
  2. Split a long history by weekday. Ten years of daily data gives roughly 500 samples per weekday; one year gives about 50, which is too few to separate a pattern from luck.
  3. Compute the average and the spread for each day, and a t-statistic for the difference from the overall average. A weekday with a t-statistic under about 2 is noise until more data says otherwise.
  4. Look for a structural reason. A Friday effect tied to weekly options expiry, or a Monday effect tied to weekend news, is more likely to persist than a pattern with no story.
  5. Check the pattern out of sample. Split the history, measure on the first half, and see whether the same days carry the effect in the second half; most calendar effects fail this test.
  6. Encode only what survives as a filter. Switch off the weak days for the rule and leave everything else about the rule unchanged, so the filter can be removed if the effect fades.
03

The maths

The measurement is an average by weekday with a test of whether the difference is larger than chance; the filter is a membership test on the bar's weekday.

rˉd=1nd∑i∈Sdri\bar{r}_d = \frac{1}{n_d} \sum_{i \in S_d} r_i
sd=1nd−1∑i∈Sd(ri−rˉd)2s_d = \sqrt{\frac{1}{n_d - 1} \sum_{i \in S_d} (r_i - \bar{r}_d)^{2}}
td=rˉd−rˉsdndt_d = \frac{\bar{r}_d - \bar{r}}{\frac{s_d}{\sqrt{n_d}}}
allowedt={1weekday(t)∈A0otherwise\mathrm{allowed}_t = \begin{cases} 1 & \mathrm{weekday}(t) \in A \\ 0 & \text{otherwise} \end{cases}
filteredt=signalt×allowedt\mathrm{filtered}_t = \mathrm{signal}_t \times \mathrm{allowed}_t
rir_ithe return, range or trade result of sample i
dda weekday, Monday to Friday
SdS_dthe set of samples that fall on weekday d
ndn_dthe number of samples that fall on weekday d
rˉdr̄_dthe average of the samples on weekday d
rˉr̄the average over all weekdays
sds_dthe sample standard deviation on weekday d
tdt_dthe t-statistic for weekday d against the overall average
weekday(t)\mathrm{weekday}(t)the weekday of bar t on the exchange clock
AAthe set of allowed weekdays, chosen with the Monday to Friday switches
allowedt\mathrm{allowed}_t1 when bar t falls on an allowed day
signalt,filteredt\mathrm{signal}_t, \mathrm{filtered}_tanother rule's output, and the same output allowed only on permitted days

The weekday is read on the exchange's clock, so the day boundary is the exchange's midnight, not GMT; an FX or crypto bar late on Sunday evening in New York is still Sunday there.

The implementation has switches for Monday to Friday only. Saturday and Sunday are always blocked, so on seven-day markets the weekend is shaded whatever the settings.

Five t-tests on the same data will produce a false positive one time in several by chance alone, so a single significant weekday deserves less confidence than the number suggests.

Effects on range and volume by weekday are far more stable than effects on direction, and a rule filtered on its own weekday results is more robust than a bet on a weekday's return.

04

Inputs that matter

InputTypicalWhat changing it does
Monday to Friday switchesall onSwitching a day off shades it and removes it from the allowed set. Off days are where a combined rule will take no trades.
Mark the first bar of an allowed dayonDraws a circle on the first bar of each allowed day, which shows on intraday charts where each permitted session starts.
Sample length for the measurement10 years of daily dataShorter samples produce weekday patterns by chance; longer ones dilute effects that only held in one regime. Split the sample and test both halves.
05

In practice

  • As a filter on a strategy: switch off the days where a rule's results are weak, for example no Monday breakout trades, and leave the rule itself unchanged so the filter can be removed later.
  • As an event-day guard: block the Friday of the monthly employment report or the third Friday of options expiry for rules that rely on normal range and volume.
  • As a range map: measure average range by weekday and expect breakout rules to do better on the wider days and mean-reversion rules on the narrower ones.
  • As a weekend-risk rule: allow no new positions on Friday afternoon for a rule that holds overnight, so the weekend gap is never inside a trade the rule was not designed to hold.
  • As a crypto and FX calendar: with the weekend always blocked in the implementation, the filter isolates weekday behaviour on seven-day markets, where weekends are thin and Monday opens can gap.
  • As a research check: run a strategy with each weekday switched off in turn; if the results swing wildly, the strategy's results live in a few days and deserve suspicion.
06

Where it goes wrong

  • Believing a pattern from a short sample. A year of data gives about 50 samples per weekday, and one of the five will look special by chance; use many years and test out of sample.
  • Betting on direction by weekday. Return effects are the weakest and most likely to fade; range and volume effects, and a rule's own weekday results, are the usable ones.
  • Forgetting the exchange clock. The weekday changes at the exchange's midnight, so a session that crosses midnight, or a chart in another time zone, can put a bar on a different day than expected.
  • Overfitting with the toggles. Switching days on and off until a backtest looks best is curve-fitting with five switches; keep only days that fail for a structural reason.
07

Compared with

Time-of-Day Windows. A time-of-day window switches hours inside each day; a weekday filter switches whole days inside each week. They stack, so a rule can be limited to the first hour of Tuesday to Thursday, and both are conditions on another signal rather than signals themselves.

Opening Range Breakout. The opening range is a price level built each session; the weekday filter decides whether a session is traded at all. A common combination is an opening range rule that skips the weekdays where its results are weakest.

Mean Reversion. Mean reversion is a statistical property of price returning to an average; day-of-week effects are a statistical property of the calendar. Both are measured, not seen, and both fail when the regime that produced them changes.

Multi-Timeframe Trend Filter. A higher-timeframe trend filter gates trades by market direction; a weekday filter gates them by the calendar. The trend filter responds to price and adapts; the weekday filter is fixed until the trader re-measures it.

08

Build it in Quant

Type one of these in the Quant desk, or click it. A request that fits a checked template is assembled on the spot without a credit; anything beyond the blanks goes to the copilot, which edits on top of the checked script.

Open Day-of-Week Effects on the workbench chart
Drawn on real data; then audit, backtest and refine in conversation.
Open in Quant →
09

Questions

  • Is the Monday effect still real?

    The strong version, lower average returns on Mondays in US stocks, was documented from 1980 and has largely faded since. What persists is structural: Monday opens carry the weekend's news, so gaps and early range are larger, and volume builds through the week. Treat weekday effects as range and behaviour patterns rather than a directional bet, and measure them on the market you trade.

  • How many years of data do I need?

    Enough for several hundred samples per weekday. Ten years of daily data gives about 500 per day, which can separate a real pattern from noise; one year gives 50, which cannot. Then split the sample and check that the same days carry the effect in both halves. A pattern that holds in one half only is a regime, not a calendar effect.

  • What does the implementation do?

    It is a filter, not a signal. Five switches allow or block Monday to Friday; blocked days are shaded, and the first bar of each allowed day is circled. There are no Long or Short marks and no alerts. Combine it with a rule, for example an EMA cross that counts only on allowed days, or use it as a strategy filter.

  • Which time zone decides the weekday?

    The exchange's. The weekday is read from the bar's time in the symbol's own time zone, so the day changes at the exchange's midnight. On a New York-time chart, a Sunday evening FX bar is still Sunday and is blocked; on a crypto chart the exchange time zone may differ, so check it before assuming when Monday starts.

  • Can I use it on crypto, which trades at weekends?

    Yes, with one fact in mind: the implementation has no Saturday or Sunday switches, so weekends are always blocked and shaded. That suits most rules, since weekend crypto volume is thin and Monday opens can gap, but a rule that is meant to trade weekends needs the filter edited rather than switched.

  • Which days should I switch off?

    Only the days your rule fails on for a reason you can name. Measure the rule's results by the weekday of entry over a long sample, look at the days that lose, and ask whether an event explains it: expiry Fridays, report days, weekend news. Switch those off, keep the rest, and re-measure a year later, because calendar effects fade.