Calendar Effects
Calculate the calendar effects in every ticker’s daily returns: whether returns differ by weekday, around the turn of the month or before holidays, tested with standard errors that allow for volatility clustering and autocorrelation.
Each effect is a regression of the daily returns on calendar dummies, with Newey-West (1987) standard errors, as the plain t-statistics of get_seasonality assume independent returns of equal variance.
- Day-of-week effect: the average return per weekday from a regression on a dummy per weekday, and the joint test of whether all weekdays share one average (French, 1980; Gibbons and Hess, 1981). The Monday effect, a lower return over the weekend, was strong in US stocks until the 1980s.
- Turn-of-the-month effect: the average return of the last trading day of a month and the first three of the next against the other days (Ariel, 1987; Lakonishok and Smidt, 1988), which once held most of the month’s return.
- Pre-holiday effect: the average return of the trading day before an exchange holiday against the other days (Lakonishok and Smidt, 1988; Ariel, 1990). The holidays are read from each ticker’s own dates: a day of the week it regularly trades on without trading counts as a holiday.
The formula for the day-of-week effect is as follows:
\[\text{Return}_{t} = b_{\text{Monday}} \cdot D_{\text{Monday},t} + \ldots + b_{\text{Friday}} \cdot D_{\text{Friday},t} + e_{t},\;\; \text{with } b_{d} \text{ the Average Return of weekday } d\] \[\text{Equal Means} = \frac{W}{q},\;\; \text{the Wald statistic of}\; b_{\text{Monday}} = \ldots = b_{\text{Friday}} \;\text{under the Newey-West covariance over the number of restrictions}\; q,\;\; \text{against the} \;F(q,\; n - k) \;\text{distribution}\]The formula for the turn-of-the-month and the pre-holiday effect is as follows:
\[\text{Return}_{t} = a + b \cdot D_{t} + e_{t},\;\; \text{with}\;\; D_{t} = 1 \;\text{on the turn-of-the-month} \;(\text{or pre-holiday}) \;\text{days and 0 on the others}\] \[\text{Other Days} = a,\;\; \text{Turn of Month} \;(\text{or Pre-Holiday}) = a + b\;\;\text{and}\;\; \text{Difference} = b\]Every Test Statistic is the estimate over its Newey-West standard error with a two-sided p-value from the standard normal, apart from the F-statistic of the Equal Means row. The Newey-West covariance uses Bartlett weights over lags lags, by default floor(4 * (n / 100)^(2/9)) for n returns (Newey and West, 1994).
Also known as: calendar anomalies, day of the week effect, weekend effect, Monday effect, turn of the month effect, pre-holiday effect, holiday effect.
Example · AAPL, MSFT · 2000 to 2025
Install the Finance Toolkit with pip install financetoolkit -U, then call get_calendar_effects:
from financetoolkit import Toolkit
toolkit = Toolkit(
["AAPL", "MSFT"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2000-01-01",
end_date="2025-12-31",
)
calendar_effects = toolkit.technicals.get_calendar_effects(effect="turn_of_month")
calendar_effects.xs("AAPL", level=1, axis="columns")
Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:
Did Apple's daily return around the turn of the month differ from the other days between 2000 and 2025, tested with Newey-West standard errors?
Which returns:
| Item | Average Return | Standard Error | Test Statistic | p-Value | Observations |
|---|---|---|---|---|---|
| Turn of Month | 0.0011 | 0.0008 | 1.4431 | 0.1490 | 1,248 |
| Other Days | 0.0012 | 0.0003 | 3.9080 | 0.0001 | 5,291 |
| Difference | -0.0001 | 0.0008 | -0.0627 | 0.9500 | 6,539 |
3 rows
Parameters
get_calendar_effects accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
effect | str | The calendar effect to test. Options are: “day_of_week” (the day-of-week effect), “turn_of_month” (the turn-of-the-month effect), “pre_holiday” (the pre-holiday effect). Defaults to “day_of_week”. | "day_of_week" |
close_column | str | The name of the column containing the close prices. Defaults to “Adj Close”. | "Close" |
days_before | int | The last trading days of a month in the turn of the month. Defaults to 1. | 1 |
days_after | int | The first trading days of a month in the turn of the month. Defaults to 3. | 3 |
lags | int | None | The number of lags of the Newey-West covariance. Defaults to None, which uses floor(4 * (n / 100)^(2/9)) for n returns. | 2 |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit. | 2 |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |
References
- Paper French, K.R. (1980). “Stock Returns and the Weekend Effect.” Journal of Financial Economics, 8(1), 55-69.
- Paper Gibbons, M.R. and Hess, P. (1981). “Day of the Week Effects and Asset Returns.” The Journal of Business, 54(4), 579-596.
- Paper Ariel, R.A. (1987). “A Monthly Effect in Stock Returns.” Journal of Financial Economics, 18(1), 161-174.
- Paper Lakonishok, J. and Smidt, S. (1988). “Are Seasonal Anomalies Real? A Ninety-Year Perspective.” The Review of Financial Studies, 1(4), 403-425.
- Paper Ariel, R.A. (1990). “High Stock Returns before Holidays: Existence and Evidence on Possible Causes.” The Journal of Finance, 45(5), 1611-1626.
- Paper Newey, W.K. and West, K.D. (1987). “A Simple, Positive Semi-Definite, Heteroskedasticity and Autocorrelation Consistent Covariance Matrix.” Econometrica, 55(3), 703-708.
- Library Referenced against statsmodels’ OLS (HAC covariance and f_test)