Skip to content
All strategies

Strategies

Treasury Month-End Index-Extension Flow on IEF: Long the 7-10Y Treasury ETF for the LAST 3 Trading Days of Each Month, Flat Otherwise (IEF.USEQ 1-DAY, long-only, 2x Reg-T, flat ~86% of the time, pure calendar, 1 parameter)

Outcome: Abandoned

IefMonthEndIndexExtensionLong

Outcome Summary

IefMonthEndIndexExtensionLong tested a documented month-end Treasury index-extension flow by holding IEF for the last three sessions of each month. The 256-trade backtest confirmed a positive per-trade edge of about 0.21% of notional, and the strategy was sent to optimization, where it posted an apparently strong Sharpe of 2.0. The analyst traced those headline statistics to a suspected USEQ daily-returns artifact. From the realized ledger they found a Sharpe of about 0.46, heavy modeled impact, drawdown and leverage above the pre-registered limits, and 7 losing years. The run was abandoned after 2 iterations. The mechanism was not falsified, and the analyst flagged an engine review of the USEQ mark-to-market, Reg-T enforcement and impact calibration.

Hypothesis

A single-instrument, single-leg calendar trade on a US Treasury ETF. The economic cause is not a price pattern. It is a known institutional flow, the month-end duration extension. At every month-end the Bloomberg US Treasury / Aggregate indices drop bonds that have fallen below one year to maturity and add the new auctions. Index duration therefore jumps up on the last business day of the month. The trillions of dollars benchmarked to those indices (index funds, ETFs, liability-matched pension and insurance……Show moreShow less

A single-instrument, single-leg calendar trade on a US Treasury ETF. The economic cause is not a price pattern. It is a known institutional flow, the month-end duration extension. At every month-end the Bloomberg US Treasury / Aggregate indices drop bonds that have fallen below one year to maturity and add the new auctions. Index duration therefore jumps up on the last business day of the month. The trillions of dollars benchmarked to those indices (index funds, ETFs, liability-matched pension and insurance mandates, benchmarked active managers) have to buy duration into that date so they don't show a short-duration tracking error at the month-end valuation snapshot. That buying is concentrated in the final days of the month, it is predictable, and it pushes intermediate and long Treasury prices up. It is paid by the benchmarked managers, who are price-insensitive because tracking error, not price, is what they are measured on. Their counterparties are dealers and anyone who sells duration into month-end. This mechanism has never been run in this factory: the corpus contains no bond-ETF calendar hypothesis. TLT/IEF appear only as defensive legs in abandoned SPY/QQQ regime rotations, and the equity turn-of-month runs (SPY/QQQ) are a different cause, payroll/401k equity inflows. Those equity runs also show weak statistics (SPY last-3 t = 1.36), whereas bonds show t > 4. POINT-IN-TIME PRE-STUDY (L166). I ran this on the catalog's own USEQ 1-DAY bars, 2002-07 to 2026-09, 289 months. The trade is to hold from the close of the 4th-to-last trading day to the close of the last trading day of the month: - IEF last-3: mean +0.216% per trade, hit rate 62%, t = 5.52, calendar Sharpe 1.04 (1x, zero days included). Pre-2014 mean 0.209%, post-2014 0.221%, so the effect is stable across both halves. 88% of years are positive. At 1x the max DD is 6.0% and the worst calendar year is -1.3%. The final-20% holdout window (Dec 2021 onward) has calendar Sharpe 0.85. It made money in 2022, the worst bond bear market in 40 years (+9.0% at 2x), which shows it is not duration beta. - The effect holds on every bond ETF tested with the same fixed window, so it is not tuned to IEF: AGG t = 6.65 (Sharpe 1.14), TLT t = 4.53 (0.83), LQD t = 4.88 (0.62). Last-5 and last-7 windows also work on IEF (0.254%, 0.264%), so the effect is not a knife-edge. - Not carry: IEF's coupon accrual is about 1.3-1.6bp per day, roughly 4-5bp over 3 days. The measured 21.6bp is about 5x that. - DIVIDEND ARTIFACT AVOIDED BY CONSTRUCTION: iShares Treasury ETFs go ex-dividend around the FIRST business day of the month. Because dividends are not in USEQ PnL, holding across that date would book a fake ~-0.2% price drop, which is visible as the first-3-day mean of -0.28%. This design exits at the close of the LAST trading day, so it never holds across the ex-date. I deliberately did NOT add a 'short the first days of the month' leg: that return is mostly the unpaid distribution, not an edge. I chose IEF over TLT because it has the higher calendar Sharpe and far lower volatility per unit of flow. The single parameter N = 3 was fixed from the index-rebalance timing argument (flow concentrates in the last few sessions), and the neighbouring values N = 5 and N = 7 are reported above. FEE ARITHMETIC: USEQ has zero commission. Cost is about 0.02-0.05% round trip (spread plus impact) on IEF, one of the most liquid bond ETFs with a ~1bp spread. The gross per-trade move is 0.216%, which is 4-10x the round trip. At 2x Reg-T the per-equity return per trade is about 0.43%. RISK PROFILE: 2x Reg-T gross leverage (IEF's daily vol is about 0.4%, so a 3-day hold at 2x risks roughly 1.4% of equity at 1 sigma). The position is 200% of equity notional. Stop: the position is exited at the close if the open trade is down more than 2.0% of notional (about 4% equity). This almost never triggers for a 3-day IEF hold and exists only to cap a Treasury-auction or FOMC shock. There is no other exit except the calendar. Max exposure is one position. Expected flat state: about 86% of trading days (3 of ~21 sessions per month). Expected lifetime trades: about 285 on 1-DAY history from 2002, and about 100 on the 20k-bar sandbox window. Source: the mechanism is documented in the fixed-income literature as the 'month-end index extension' effect (dealer research, and e.g. Hartley and Schwarz, 'Predictable End-of-Month Treasury Returns', 2019). It is restated here from first principles; there is no code port.

Iteration 2 fixes QA's critical fill-timing defect. USEQ market orders fill at the next bar's open, so the previous exit (decided at days_left==0) filled at the open of the first day of the next month. That day is the ex-date, so every trade booked the unpaid distribution. All decisions now happen one bar earlier: entry at days_left==hold_days+1 (late-entry guard 2<=left<=hold_days+1) and exit at days_left<=1. The trade now runs from the open of the 4th-to-last day to the open of the last day. QA replayed that……Show moreShow less

Iteration 2 fixes QA's critical fill-timing defect. USEQ market orders fill at the next bar's open, so the previous exit (decided at days_left==0) filled at the open of the first day of the next month. That day is the ex-date, so every trade booked the unpaid distribution. All decisions now happen one bar earlier: entry at days_left==hold_days+1 (late-entry guard 2<=left<=hold_days+1) and exit at days_left<=1. The trade now runs from the open of the 4th-to-last day to the open of the last day. QA replayed that window at +0.149%/trade (t=4.1, 2002-2026) and +0.183% on 2020-2026, which is still 3-7x the USEQ round trip. The last session's open-to-close move (about +0.06%) is given up because there is no market-on-close fill. The analyst should judge against about 0.15%, not the 0.216% close-to-close pre-study figure. QA's warning is also fixed: the month is marked as traded only once a position exists (in calculate_signal), so a dropped entry no longer uses up the month. The 2%-of-notional stop (about 3.8% of equity) is kept as pre-registered. The expected trade count is unchanged: about one per month, about 80 on the 2020-2026 sandbox window.

Suspected backtest artifact: the reported Sharpe, WF-OOS and DSR come from a USEQ daily_returns series with paired MTM swings while flat. The ledger truth is a real but sub-floor edge: realized Sharpe about 0.46 (holdout about 0.44), 0.087% of notional per trade (above the 0.05% USEQ floor, so this is not fee_edge), 59% impact share, 21.4% drawdown against a 13% pre-registration, 7 losing years out of 22. The book is flat about 87% of the time, so it cannot reach the 1.0 promote floor (L134/L165). The mechanism is not falsified; it could be re-proposed as an ensemble or with a higher duty cycle at a hard 2x cap once the engine is fixed. Engine review is needed for the USEQ MTM artifact, the unenforced Reg-T limit (trade leverage reached 4.7x), and the impact calibration ($291k capacity on IEF).

Implementation

Long IEF (7-10Y Treasury ETF) at 2x Reg-T over the final trading days of each month to capture the month-end index-duration-extension flow; flat otherwise. The entry order is decided at the close of the 5th-to-last NYSE trading day and fills at the open of the 4th-to-last. The exit is decided at the close of the 2nd-to-last day and fills at the open of the last trading day, so the position never spans the early-month iShares ex-dividend date. The 2%-of-notional stop is checked at the close. One trade per month; the schedule is a pure calendar function of the bar date.

Verification Results

No change needed. The analyst should use about 0.15%/trade as the pre-registered comparison, not 0.216%.

The hypothesis holds from the close of the 4th-to-last trading day to the close of the last trading day. Because USEQ fills at the next open, the code holds from the open of the 4th-to-last day to the open of the last day. That window gives up the last session's open-to-close move and adds the 4th-to-last day's open-to-close move. This is a documented and deliberate execution-realism adaptation. It keeps the structure (last ~3 sessions, calendar exit, flat across the early-month ex-dividend date), so it is not a mechanism swap. The shift is needed to avoid booking the unpaid distribution.

Optional: source the session grid from src/data/market_calendar.py so the backtest matches the catalog. Otherwise accept the difference as point-in-time behaviour.

The NYSE calendar includes only scheduled holidays. It omits unscheduled closures: 2004-06-11 (Reagan), 2007-01-02 (Ford), 2012-10-29/30 (Sandy), 2018-12-05 (Bush), 2025-01-09 (Carter). In the affected months days_left is off by one, so the entry or exit shifts by one session. This is point-in-time correct, since those closures were not known in advance, but 2012-10 and 2018-12 fall near month-end. It affects only a handful of the ~285 trades.

Keep as pre-registered. The analyst should check the worst single-trade loss in the full backtest (the sandbox's largest was -$3.35k, about 3% of equity).

Per-trade risk (L148/L156). Gross notional is 0.95 x 2.0 = 1.9x equity. It is bounded by constants with no dynamic scalar and stays within the USEQ 2x Reg-T cap. The 2%-of-notional stop is about 3.8% of equity per trade, above the 1-2% guideline. The stop is checked only at the close, so a gap on an FOMC or auction day can overshoot it. The book is flat about 87% of the time (sandbox exposure 13%) and holds for 3 sessions, so this is not an always-in compounding design. The stop level is pre-registered.

Optionally convert to America/New_York before taking .date() so the result does not depend on the stamping convention.

The date is derived from the UTC date of ts_init. This is correct only because USEQ daily bars are stamped at the session close (20:00/21:00 UTC, or 17:00/18:00 UTC on half-days). If the stamping convention changed to 00:00 of the next day, the dates would shift and every trade would move one session later, onto the ex-date.

The measured per-trade figure should be judged against the next-open to next-open window this code actually trades, not against the pre-study's close-to-close 0.216%. The sandbox avg_trade_return_pct of 0.214% on 79 trades is above the developer's own estimate of about 0.15% for that window, so it is probably partly luck of the 2020-2026 sample. The Sharpe CI (-0.50 to 1.03) straddles zero. impact_cost_pct is 24% of gross at 196% notional. Some sandbox numbers do not fit a 13%-exposure IEF book: annualized_volatility is 48% and the regime-tercile drawdowns reach 14% against a headline max_drawdown of 5.3%. That looks like the MTM/impact folding artifact seen on other USEQ runs and needs engine review before the Sharpe is trusted. The full-history backtest should confirm the effect holds before 2020 (2002-2019) and in 2022.

Backtest Review

Sharpe
1.11
Total return
84.84%
Max drawdown
13.79%
Trades
256
Win rate
61.7%
Profit factor
1.52

The trade ledger matches the hypothesis. It has 256 long-only IEF trades over 2002-07 to 2023-12, one per month. Each enters at the month-end window and exits on the last trading day (for example 2023-11-27 to 2023-11-30 and 2023-12-26 to 2023-12-29), so no trade is held across the early-month ex-dividend date. No shorts.

Per-trade economics clear the USEQ floor comfortably: avg_trade_return_pct is 0.210% of notional against a 0.05% floor (4.2x) and a preferred 0.10% (2.1x). PF is 1.52, win rate 62%, max losing streak 4. This matches the pre-study (0.216% close-to-close).

QA's edge concern is not borne out on the full history. The edge holds on 256 trades from 2002 onward, not just the 2020-2026 sandbox. Per-year PnL is positive in about 16 of 21 full years, and 2022 (the bond bear) is +5.5%. The 2023 figure of -46% is an equity-series artifact (see weaknesses); the 2023 trade ledger nets to roughly flat.

The sample is adequate for optimization (L178): 256 trades on daily bars, so the final-20% holdout gets about 50 trades against the required 10.

The realized equity curve in the detail file is smooth. Final equity is about $184.8k, +84.8% with end_unrealized_pct 0. Exposure is 13% and there is one position at a time. The drawdown is not beta under L170: IEF buy-and-hold drew down roughly 20%+ in 2022, while this book was profitable that year.

Suspected engine artifact in the daily-return series; I did not verify the mechanism. Throughout the run there are paired -X% / +Y% daily returns in mid-month (around the 9th-15th and 20th-25th), when the strategy is flat by construction. They grow from about ±0.7% in 2002 to -45%/+85% in 2023, and the final bar (2023-12-29) shows -46.8% while flat. The detail-file equity curve contains none of these swings. As a result annualized_volatility of 246%, monthly returns of ±40-80%, regime-tercile drawdowns of 49-93%, stress-window drawdowns of about 40%, the max_drawdown CI of 94-100%, and the headline Sharpe of 1.11 and its CI are all unreliable. This is the same USEQ MTM/impact-folding signature QA flagged and that was seen on the SPY wealth-selector run. The engine needs review before any Sharpe, DSR or PBO from this run is trusted.

impact_cost_pct is 50.3% of gross and capacity_usd is only $396k on IEF, one of the most liquid Treasury ETFs. That is implausible for about $500k notional and probably another face of the same impact-folding defect. If it is real, it sits exactly on the 50% economics floor.

Realized leverage per trade is about 2.8x (trade records show leverage 2.76-2.81), above the hypothesis's stated 2x Reg-T book. equity_fraction 0.95 times config.leverage appears to exceed 2. This inflates both returns and risk relative to the pre-registered profile.

The return is modest: CAGR about 2.9% at about 2.8x gross for 13% of the time. The edge is real per trade but small in absolute terms.

internally inconsistent with the regime/stress drawdowns; the realized equity curve suggests single-digit

computed on the artifact-contaminated daily series; unreliable

Analysis

All 256 trades implement the premise: long-only, entered at the close of the 4th-to-last session, exited at the close of the last session, never held across the ex-dividend date.

The realized ledger is consistent: summed trade PnL is +$121.7k, matching final equity of $221.7k, with no unrealized PnL at the end.

The holdout is positive on 52 trades at 0.092% of notional per trade, and 2022 was profitable, so the result is not duration beta.

No cliffs in the sensitivity sweep, PBO is 0.26, and hold_days of 2, 3 and 4 all work.

Suspected backtest artifact: daily_returns has paired mid-month swings while the book is flat (e.g. -77.1% then +336.8% on 2023-08-11/14) and a -77.9% final bar after a profitable last trade. That series feeds Sharpe, CPCV, DSR, annual_returns and the regime split. The mechanism has not been verified.

Recomputed from the realized equity curve, Sharpe is about 0.46 for the full period and 0.44 for the holdout, against a reported 2.01, a WF-OOS of 2.23 and a DSR of 1.0.

The positive-years gate reads the broken series (22 of 22 years positive); the ledger has 7 losing years out of 22.

Leverage creeps from 2.63x to 4.7x, which violates the pre-registered 2x Reg-T limit; the 2.0x cap requested at backtest review was never applied.

Net return is 0.087% of notional per trade against a 0.216% pre-study gross; modeled impact takes 59% of gross; max drawdown is 21.4% against the pre-registered 13%; profit factor is 1.42 against the pre-registered 1.5.

Benjamini-Hochberg at q=0.10 over 328 programme candidates keeps 8. A candidate that does not survive here is not distinguishable from the programme's own noise, however good its individual statistics look.

Iteration History

Verification failed (Layer 4 — QA review) [class=code_defect]: - [edge_concern] After the fill-timing fix the achievable open-to-open version of the trade is smaller than the pre-study's close-to-close 0.216%. On the catalog's own IEF bars, entering at the open of the 4th-to-last day and exiting at the open of the last day gives 0.149% per trade (t=4.1, 289 months) and 0.183% on 2020-2026. The last session's open-to-close (+0.06%, t=3.45) is forfeited because it cannot be captured without a market-on-close fill.……Show moreShow less

Verification failed (Layer 4 — QA review) [class=code_defect]: - [edge_concern] After the fill-timing fix the achievable open-to-open version of the trade is smaller than the pre-study's close-to-close 0.216%. On the catalog's own IEF bars, entering at the open of the 4th-to-last day and exiting at the open of the last day gives 0.149% per trade (t=4.1, 289 months) and 0.183% on 2020-2026. The last session's open-to-close (+0.06%, t=3.45) is forfeited because it cannot be captured without a market-on-close fill. That is still 3-7x the USEQ round trip, but the analyst should judge it against the 0.149% figure, not the 0.216% figure. - [critical] Fill timing breaks the hypothesis's central construction: 'exit at the close of the last trading day, never hold across the early-month iShares ex-dividend date'. USEQ has latency_ms=100 (venue_configs.py), so a market order decided on a daily close bar fills at the NEXT bar's open. The exit decided at days_left==0 therefore fills at the OPEN OF THE FIRST TRADING DAY of the next month, which is the ex-date. Every trade books the unpaid distribution. The same happens on entry: it fills at the open of the 3rd-to-last day. I replayed the catalog's IEF 1-DAY bars over 2020-01 to 2026-09 (the sandbox window, 80 months). Close-to-close last-3 (the pre-study construction) = +0.218%/trade, 61% winners. Next-open fills (what the engine does) = +0.018%/trade, 51% winners. After the sandbox's ~4bp folded impact that is about -0.02%, which reproduces the sandbox's -0.026% avg trade, 45.6% win rate and PF 0.78 almost exactly. The last-close to first-day-open gap averages -0.243% (t = -11.6, 22% positive, full history), and it is exactly the dividend artifact the hypothesis says the design avoids by construction. This is not a polarity problem and not an edge failure: the backtest measures a different holding window that spans the ex-date. (line 131) — fix: Shift every decision one bar earlier so fills land inside the intended window without crossing the ex-date. Enter when days_left == hold_days + 1 (decided at the close of the 5th-to-last day, filled at the open of the 4th-to-last). Exit when days_left <= 1 (decided at the close of the second-to-last day, filled at the open of the LAST trading day). Replayed on catalog bars, open(4th-to-last) to open(last) = +0.149%/trade, t=4.1 over 2002-2026, and +0.183% over 2020-2026, with no ex-date exposure. Keep the late-entry guard (e.g. 2 <= days_left <= hold_days+1) and the one-trade-per-month key. Al - [warning] Per-trade risk (L148): the close-checked stop at -2% of notional on about 190% of equity notional is about 3.8% of equity per trade, and more on a gap. That is above the 1-2% guideline. The design is not always-in: it is flat about 86% of the time, has one position, and its fixed gross of 0.95 x 2.0 leverage carries no dynamic scalar. It is not a compounding blowup, and the stop matches the pre-registered hypothesis. (line 133) — fix: Keep as pre-registered; the analyst should check the worst single-trade loss in the full backtest. - [warning] should_enter sets _entered_month_key before the base template applies the size/min-notional checks and before _submit_entry's guards (market-ready, in-flight). A dropped entry still consumes the month, so the strategy sits out that month. The calendar also omits unscheduled closures (Sandy 2012-10-29/30, national days of mourning). On a phantom day inside the window the count is off by one, which can move entry or exit by a bar in those rare months. Both effects are negligible for the sample. (line 114) — fix: Optional: mark the month as traded in on_position_opened (or when a position exists) rather than in should_enter.

Outcome Summary

On USEQ runs, check headline Sharpe/DSR/positive-years gates against the realized trade ledger and enforce the pre-registered leverage cap in code; a low-duty-cycle calendar edge may need an ensemble or a higher duty cycle to clear a Sharpe floor.

The backtest review approved optimization, but the post-optimization analyst abandoned the run. The reported Sharpe, WF-OOS and DSR came from a daily_returns series with suspected artifacts: paired mark-to-market swings on days the book was flat. The realized ledger showed a real edge below the floors: 7 losing years out of 22, drawdown above the pre-registered 13%, leverage up to 4.7x against a 2x Reg-T limit, and a book flat about 87% of the time, which cannot reach the 1.0 promote floor.

A pure calendar trade that went long IEF (7-10Y Treasury ETF) for the last 3 trading days of each month at a pre-registered 2x Reg-T, betting on price-insensitive duration buying by benchmarked managers ahead of the month-end index extension, and exiting before the early-month ex-dividend date.

The initial backtest (2002-07 to 2023-12) returned +84.8% on 256 long trades, with a 62% win rate, profit factor 1.52, 0.210% of notional per trade and a reported Sharpe of 1.11. After optimization the reported Sharpe was 2.01, WF-OOS 2.23, holdout 0.34 on 52 trades and PBO 0.26. But the analyst's recomputation from the realized equity curve gave a Sharpe of only about 0.46 (holdout about 0.44), 0.087% of notional per trade net, 59% of gross lost to impact and a 21.4% max drawdown.

Backtest and paper results are hypothetical. Trading involves risk of loss.