BACKTEST RESULTS

Time-of-day strategy backtest results

SPY 5-minute data, 2024 to 2026: the in 09:30, out 15:55 rule, long only, lost 42.2% after costs over 600 trades, winning 45.8% of them, against +44.4% for holding SPY. The least bad of 4 runs was in 09:30, out 15:55 on QQQ, long only: -35.8%, held-out did not survive. Every run, every trade and the script are on this page.

SPY · 5-minute data · in 09:30, out 15:55 · long only
Net after costs
-42.2%
Holding SPY
+44.4%
Trades
600
Win rate
45.8%
Profit factor
0.77
Max drawdown
44.1%
Held out, last third: did not survive
4 June 2024 to 23 October 2026
  • Checked 25 October 2026
  • Alpaca 5-minute data from the last 600 sessions
  • 0.05% commission + 0.025% slippage per fill
  • last third of the history held out
  • 4 runs, 2400 trades
  • Updated 1 November 2026

The short answer

Answers here: Does going long at the open and out at the close make money? · Does waiting until 10:00 help?

SPY 5-minute data, 4 June 2024 to 23 October 2026, long only: 600 trades, lost 42.2% after costs, 45.8% of trades won, profit factor 0.77, worst drawdown 44.1%, 99% of the time in the market. Holding SPY returned +44.4% over the same period.

Held out on its own, the last third (8 January 2026 to 23 October 2026) lost 19.7% on 200 trades: it did not survive its held-out period.

600 trades in 2.4 years is about 252 a year; at 0.15% a round trip, costs alone came to roughly 90% of the account over the period. On minute charts the cost of trading is the first thing a rule has to beat, before any indicator.

Across all 4 runs on this page, 0 made money after costs, 0 survived the held-out third, and 0 beat holding the symbol.

The least bad run was in 09:30, out 15:55 on QQQ, long only: -35.8% net on 600 trades, profit factor 0.87, worst drawdown 41.7%, held-out did not survive. The tester's verdict on it reads "lost money on this data".

One symbol's past after modelled costs is not a forecast. Prices are split-adjusted and not dividend-adjusted, so every return here is a price return; the period is the last two and a half years of sessions, one market regime, and a rule tested on it can look different in the next one. These are research results, not investment advice.

What the script does

Time-of-Day Strategy, from the strategy library.

Goes long at a fixed time of day and exits at another, every session: in at 09:30 and out at 15:55 New York time, with costs charged on both fills. A second version enters at 10:00. It measures the intraday drift of the index after costs, with no indicator at all. The data comes from the last 600 sessions.

The indicator itself, with its Pine code drawn on real market data: Time-of-Day Windows.

The numbers, run by run

Net and holding the symbol are after costs over the same period. Held-out is the verdict on the last third of the history judged alone: survived, decayed, did not survive, or too few trades to judge.

SymbolTimeframeSettingsDirectionTradesWin rateNetHoldingProfit factorMax drawdownHeld-out
SPY5-minutein 09:30, out 15:55long only60045.8%-42.2%+44.4%0.7744.1%did not survive
SPY5-minutein 10:00, out 15:55long only60045.0%-45.2%+44.4%0.7346.8%did not survive
QQQ5-minutein 09:30, out 15:55long only60050.5%-35.8%+55.8%0.8741.7%did not survive
SPY5-minutein 15:00, out 15:55long only60042.2%-48.8%+44.4%0.6049.1%did not survive

Year by year

in 09:30, out 15:55 on SPY, long only, and SPY itself, each calendar year after costs. A partial first or last year counts the sessions it has.

Yearin 09:30, out 15:55, long onlyHolding SPY
2024-9.8%+11.4%
2025-21.0%+16.0%
2026-19.8%+11.0%

Every trade

The newest 400 of the 600 trades of in 09:30, out 15:55 on SPY, long only, oldest first: side, entry and exit days, fill prices after slippage, and the return after both commissions. The other runs' trades open below.

SideInOutEntryExitReturn
long2025-03-242025-03-25571.03575.15+0.6%
long2025-03-252025-03-26575.31575.04-0.1%
long2025-03-262025-03-27575.18567.05-1.5%
long2025-03-272025-03-28566.45565.37-0.3%
long2025-03-282025-03-31565.19549.67-2.8%
long2025-03-312025-04-01548.83557.30+1.4%
long2025-04-012025-04-02557.00554.90-0.5%
long2025-04-022025-04-03557.08544.96-2.3%
long2025-04-032025-04-04547.67523.59-4.5%
long2025-04-042025-04-07523.99489.06-6.8%
long2025-04-072025-04-08487.71521.73+6.9%
long2025-04-082025-04-09520.65493.31-5.4%
long2025-04-092025-04-10495.43532.10+7.3%
long2025-04-102025-04-11532.14522.77-1.9%
long2025-04-112025-04-14522.86543.87+3.9%
long2025-04-142025-04-15542.80539.54-0.7%
long2025-04-152025-04-16540.41531.54-1.7%
long2025-04-162025-04-17532.97527.52-1.1%
long2025-04-172025-04-21527.24521.02-1.3%
long2025-04-212025-04-22520.72519.98-0.2%
long2025-04-222025-04-23519.56540.28+3.9%
long2025-04-232025-04-24541.29536.60-1.0%
long2025-04-242025-04-25536.41546.50+1.8%
long2025-04-252025-04-28547.07551.24+0.7%
long2025-04-282025-04-29551.47548.76-0.6%
long2025-04-292025-04-30549.89547.44-0.5%
long2025-04-302025-05-01546.57560.22+2.4%
long2025-05-012025-05-02559.42564.54+0.8%
long2025-05-022025-05-05565.04562.40-0.6%
long2025-05-052025-05-06563.08557.78-1.0%
long2025-05-062025-05-07559.35560.00+0.0%
long2025-05-072025-05-08560.33565.07+0.7%
long2025-05-082025-05-09564.87566.33+0.2%
long2025-05-092025-05-12567.42581.33+2.4%
long2025-05-122025-05-13579.39583.30+0.6%
long2025-05-132025-05-14583.64587.67+0.6%
long2025-05-142025-05-15588.96585.40-0.7%
long2025-05-152025-05-16586.52591.09+0.7%
long2025-05-162025-05-19590.61587.94-0.6%
long2025-05-192025-05-20589.37592.95+0.5%
long2025-05-202025-05-21593.49588.31-1.0%
long2025-05-212025-05-22589.45582.50-1.3%
long2025-05-222025-05-23581.90575.83-1.1%
long2025-05-232025-05-27577.40585.91+1.4%
long2025-05-272025-05-28585.26591.41+1.0%
long2025-05-282025-05-29592.17592.90+0.0%
long2025-05-292025-05-30592.21588.75-0.7%
long2025-05-302025-06-02588.32587.60-0.2%
long2025-06-022025-06-03589.54592.18+0.3%
long2025-06-032025-06-04592.66596.79+0.6%
long2025-06-042025-06-05597.74597.47-0.1%
long2025-06-052025-06-06596.73598.49+0.2%
long2025-06-062025-06-09599.22599.580.0%
long2025-06-092025-06-10598.82600.06+0.1%
long2025-06-102025-06-11600.52604.03+0.5%
long2025-06-112025-06-12603.25599.86-0.7%
long2025-06-122025-06-13599.92598.34-0.4%
long2025-06-132025-06-16599.98600.24-0.1%
long2025-06-162025-06-17601.69600.06-0.4%
long2025-06-172025-06-18600.59598.28-0.5%
long2025-06-182025-06-20597.68598.220.0%
long2025-06-202025-06-23598.45594.88-0.7%
long2025-06-232025-06-24594.19604.17+1.6%
long2025-06-242025-06-25604.56607.75+0.4%
long2025-06-252025-06-26608.31608.850.0%
long2025-06-262025-06-27609.37612.72+0.4%
long2025-06-272025-06-30613.25617.20+0.5%
long2025-06-302025-07-01616.82616.20-0.2%
long2025-07-012025-07-02616.76617.080.0%
long2025-07-022025-07-03616.87622.28+0.8%
long2025-07-032025-07-07623.52623.18-0.2%
long2025-07-072025-07-08623.40621.18-0.5%
long2025-07-082025-07-09620.79622.60+0.2%
long2025-07-092025-07-10623.71624.030.0%
long2025-07-102025-07-11624.01622.57-0.3%
long2025-07-112025-07-14622.81623.00-0.1%
long2025-07-142025-07-15622.94627.34+0.6%
long2025-07-152025-07-16627.06623.59-0.7%
long2025-07-162025-07-17623.69624.260.0%
long2025-07-172025-07-18624.82629.12+0.6%
long2025-07-182025-07-21629.07628.59-0.2%
long2025-07-212025-07-22629.27628.91-0.2%
long2025-07-222025-07-23628.57631.38+0.3%
long2025-07-232025-07-24631.28634.42+0.4%
long2025-07-242025-07-25634.79634.89-0.1%
long2025-07-252025-07-28635.42637.33+0.2%
long2025-07-282025-07-29637.74638.190.0%
long2025-07-292025-07-30638.41635.79-0.5%
long2025-07-302025-07-31635.97639.30+0.4%
long2025-07-312025-08-01639.31626.13-2.2%
long2025-08-012025-08-04624.49625.50+0.1%
long2025-08-042025-08-05627.06631.64+0.6%
long2025-08-052025-08-06631.46628.88-0.5%
long2025-08-062025-08-07629.58636.08+0.9%
long2025-08-072025-08-08636.87633.90-0.6%
long2025-08-082025-08-11634.27637.30+0.4%
long2025-08-112025-08-12637.26638.11+0.0%
long2025-08-122025-08-13639.55644.74+0.7%
long2025-08-132025-08-14645.36642.61-0.5%
long2025-08-142025-08-15643.26645.82+0.3%
long2025-08-152025-08-18645.35642.69-0.5%
long2025-08-182025-08-19643.57642.95-0.2%
long2025-08-192025-08-20642.32639.23-0.6%
long2025-08-202025-08-21638.93636.11-0.5%
long2025-08-212025-08-22636.07637.59+0.1%
long2025-08-222025-08-25637.86643.86+0.8%
long2025-08-252025-08-26643.91642.03-0.4%
long2025-08-262025-08-27642.78644.40+0.2%
long2025-08-272025-08-28645.23647.10+0.2%
long2025-08-282025-08-29647.98647.29-0.2%
long2025-08-292025-09-02647.56637.33-1.7%
long2025-09-022025-09-03636.55642.48+0.8%
long2025-09-032025-09-04643.05644.26+0.1%
long2025-09-042025-09-05645.08651.29+0.9%
long2025-09-052025-09-08651.77648.45-0.6%
long2025-09-082025-09-09648.81648.79-0.1%
long2025-09-092025-09-10649.34653.46+0.5%
long2025-09-102025-09-11653.48654.010.0%
long2025-09-112025-09-12654.66657.42+0.3%
long2025-09-122025-09-15657.83659.47+0.1%
long2025-09-152025-09-16660.00661.28+0.1%
long2025-09-162025-09-17661.61659.84-0.4%
long2025-09-172025-09-18660.44661.71+0.1%
long2025-09-182025-09-19662.17662.15-0.1%
long2025-09-192025-09-22661.68662.020.0%
long2025-09-222025-09-23662.83666.53+0.5%
long2025-09-232025-09-24667.23664.32-0.5%
long2025-09-242025-09-25664.31657.81-1.1%
long2025-09-252025-09-26657.31659.34+0.2%
long2025-09-262025-09-29660.95664.18+0.4%
long2025-09-292025-09-30664.47662.74-0.4%
long2025-09-302025-10-01662.65662.980.0%
long2025-10-012025-10-02664.69670.29+0.7%
long2025-10-022025-10-03670.40669.81-0.2%
long2025-10-032025-10-06670.85671.450.0%
long2025-10-062025-10-07671.17672.37+0.1%
long2025-10-072025-10-08673.13670.08-0.6%
long2025-10-082025-10-09670.15673.34+0.4%
long2025-10-092025-10-10673.53671.96-0.3%
long2025-10-102025-10-13672.68660.47-1.9%
long2025-10-132025-10-14660.90657.01-0.7%
long2025-10-142025-10-15656.11666.64+1.5%
long2025-10-152025-10-16666.73666.64-0.1%
long2025-10-162025-10-17667.19659.35-1.3%
long2025-10-172025-10-20660.68667.12+0.9%
long2025-10-202025-10-21668.74671.28+0.3%
long2025-10-212025-10-22671.70671.80-0.1%
long2025-10-222025-10-23670.87667.91-0.5%
long2025-10-232025-10-24668.59676.28+1.1%
long2025-10-242025-10-27677.00682.55+0.7%
long2025-10-272025-10-28682.87686.89+0.5%
long2025-10-282025-10-29686.98688.54+0.1%
long2025-10-292025-10-30689.02683.72-0.9%
long2025-10-302025-10-31683.37684.86+0.1%
long2025-10-312025-11-03684.34685.48+0.1%
long2025-11-032025-11-04684.87675.93-1.4%
long2025-11-042025-11-05675.14674.80-0.1%
long2025-11-052025-11-06674.67676.29+0.1%
long2025-11-062025-11-07677.22667.73-1.5%
long2025-11-072025-11-10666.46677.06+1.5%
long2025-11-102025-11-11678.00679.76+0.2%
long2025-11-112025-11-12680.25684.63+0.5%
long2025-11-122025-11-13684.41680.33-0.7%
long2025-11-132025-11-14680.25665.22-2.3%
long2025-11-142025-11-17663.79669.52+0.8%
long2025-11-172025-11-18671.32661.91-1.5%
long2025-11-182025-11-19663.08660.60-0.5%
long2025-11-192025-11-20661.58672.73+1.6%
long2025-11-202025-11-21673.53654.86-2.9%
long2025-11-212025-11-24655.63662.51+0.9%
long2025-11-242025-11-25665.22668.45+0.4%
long2025-11-252025-11-26669.63677.42+1.1%
long2025-11-262025-11-28678.47680.67+0.2%
long2025-11-282025-12-01681.67678.62-0.5%
long2025-12-012025-12-02679.86681.74+0.2%
long2025-12-022025-12-03682.01680.39-0.3%
long2025-12-032025-12-04680.67685.12+0.6%
long2025-12-042025-12-05684.10685.27+0.1%
long2025-12-052025-12-08686.24686.42-0.1%
long2025-12-082025-12-09686.30682.98-0.6%
long2025-12-092025-12-10683.60682.38-0.3%
long2025-12-102025-12-11682.31684.93+0.3%
long2025-12-112025-12-12684.88687.99+0.4%
long2025-12-122025-12-15688.59685.54-0.5%
long2025-12-152025-12-16684.15679.04-0.8%
long2025-12-162025-12-17679.74679.71-0.1%
long2025-12-172025-12-18679.95677.42-0.5%
long2025-12-182025-12-19678.00676.42-0.3%
long2025-12-192025-12-22678.41683.75+0.7%
long2025-12-222025-12-23683.85683.75-0.1%
long2025-12-232025-12-24685.20687.77+0.3%
long2025-12-242025-12-26688.46690.46+0.2%
long2025-12-262025-12-29691.13687.37-0.6%
long2025-12-292025-12-30688.23687.27-0.2%
long2025-12-302025-12-31687.52686.95-0.2%
long2025-12-312026-01-02686.99685.53-0.3%
long2026-01-022026-01-05684.96686.36+0.1%
long2026-01-052026-01-06687.25687.750.0%
long2026-01-062026-01-07688.56692.02+0.4%
long2026-01-072026-01-08692.05688.63-0.6%
long2026-01-082026-01-09688.58690.47+0.2%
long2026-01-092026-01-12691.11690.50-0.2%
long2026-01-122026-01-13692.07695.34+0.4%
long2026-01-132026-01-14696.03690.82-0.8%
long2026-01-142026-01-15691.76694.39+0.3%
long2026-01-152026-01-16694.46693.49-0.2%
long2026-01-162026-01-20694.13681.31-1.9%
long2026-01-202026-01-21682.82679.47-0.6%
long2026-01-212026-01-22679.73689.67+1.4%
long2026-01-222026-01-23690.12687.97-0.4%
long2026-01-232026-01-26687.90690.29+0.2%
long2026-01-262026-01-27691.46694.00+0.3%
long2026-01-272026-01-28694.41696.88+0.3%
long2026-01-282026-01-29697.52696.17-0.3%
long2026-01-292026-01-30696.10691.60-0.7%
long2026-01-302026-02-02693.25689.40-0.7%
long2026-02-022026-02-03691.41696.03+0.6%
long2026-02-032026-02-04696.28690.17-1.0%
long2026-02-042026-02-05689.77680.76-1.4%
long2026-02-052026-02-06680.98681.28-0.1%
long2026-02-062026-02-09683.98689.24+0.7%
long2026-02-092026-02-10690.05694.77+0.6%
long2026-02-102026-02-11695.23696.25+0.0%
long2026-02-112026-02-12696.30694.10-0.4%
long2026-02-122026-02-13695.13681.50-2.1%
long2026-02-132026-02-17681.36679.94-0.3%
long2026-02-172026-02-18681.92683.83+0.2%
long2026-02-182026-02-19683.71683.68-0.1%
long2026-02-192026-02-20684.13682.14-0.4%
long2026-02-202026-02-23683.50687.64+0.5%
long2026-02-232026-02-24689.57681.72-1.2%
long2026-02-242026-02-25680.96690.01+1.2%
long2026-02-252026-02-26691.01693.10+0.2%
long2026-02-262026-02-27692.45682.88-1.5%
long2026-02-272026-03-02683.99678.52-0.9%
long2026-03-022026-03-03681.39674.87-1.1%
long2026-03-032026-03-04674.73681.45+0.9%
long2026-03-042026-03-05683.00681.89-0.3%
long2026-03-052026-03-06684.31673.21-1.7%
long2026-03-062026-03-09672.57666.21-1.0%
long2026-03-092026-03-10666.54677.53+1.5%
long2026-03-102026-03-11677.77677.36-0.2%
long2026-03-112026-03-12677.95670.95-1.1%
long2026-03-122026-03-13671.02669.10-0.4%
long2026-03-132026-03-16669.96668.16-0.4%
long2026-03-162026-03-17668.76672.17+0.4%
long2026-03-172026-03-18673.64668.15-0.9%
long2026-03-182026-03-19668.96656.80-1.9%
long2026-03-192026-03-20656.36656.34-0.1%
long2026-03-202026-03-23655.23657.87+0.3%
long2026-03-232026-03-24656.95651.15-1.0%
long2026-03-242026-03-25653.01658.51+0.7%
long2026-03-252026-03-26659.87651.88-1.3%
long2026-03-262026-03-27651.80642.36-1.5%
long2026-03-272026-03-30640.67639.95-0.2%
long2026-03-302026-03-31639.03638.77-0.1%
long2026-03-312026-04-01639.90653.71+2.1%
long2026-04-012026-04-02655.15646.25-1.5%
long2026-04-022026-04-06647.29655.69+1.2%
long2026-04-062026-04-07657.53656.47-0.3%
long2026-04-072026-04-08655.89676.21+3.0%
long2026-04-082026-04-09676.21674.66-0.3%
long2026-04-092026-04-10674.84681.12+0.8%
long2026-04-102026-04-13681.17677.22-0.7%
long2026-04-132026-04-14677.66687.51+1.4%
long2026-04-142026-04-15688.64695.08+0.8%
long2026-04-152026-04-16695.97700.87+0.6%
long2026-04-162026-04-17701.23705.96+0.6%
long2026-04-172026-04-20707.17708.60+0.1%
long2026-04-202026-04-21709.28710.09+0.0%
long2026-04-212026-04-22709.60708.99-0.2%
long2026-04-222026-04-23708.71709.310.0%
long2026-04-232026-04-24709.69710.56+0.0%
long2026-04-242026-04-27710.03712.98+0.3%
long2026-04-272026-04-28713.88711.63-0.4%
long2026-04-282026-04-29711.73710.81-0.2%
long2026-04-292026-04-30710.31714.44+0.5%
long2026-04-302026-05-01713.04721.06+1.0%
long2026-05-012026-05-04722.53719.88-0.5%
long2026-05-042026-05-05720.10721.58+0.1%
long2026-05-052026-05-06722.49727.98+0.7%
long2026-05-062026-05-07729.35734.86+0.7%
long2026-05-072026-05-08734.72734.75-0.1%
long2026-05-082026-05-11735.49736.27+0.0%
long2026-05-112026-05-12738.13736.71-0.3%
long2026-05-122026-05-13736.55738.26+0.1%
long2026-05-132026-05-14737.77743.46+0.7%
long2026-05-142026-05-15745.00741.60-0.6%
long2026-05-152026-05-18740.37739.63-0.2%
long2026-05-182026-05-19738.74734.56-0.7%
long2026-05-192026-05-20734.68735.51+0.0%
long2026-05-202026-05-21735.84738.48+0.3%
long2026-05-212026-05-22738.75746.04+0.9%
long2026-05-222026-05-26747.41749.81+0.2%
long2026-05-262026-05-27749.64750.70+0.0%
long2026-05-272026-05-28751.09750.05-0.2%
long2026-05-282026-05-29749.91755.70+0.7%
long2026-05-292026-06-01756.19755.14-0.2%
long2026-06-012026-06-02755.89756.82+0.0%
long2026-06-022026-06-03757.65757.94-0.1%
long2026-06-032026-06-04758.44751.90-1.0%
long2026-06-042026-06-05753.07752.11-0.2%
long2026-06-052026-06-08752.78743.16-1.4%
long2026-06-082026-06-09742.39743.43+0.0%
long2026-06-092026-06-10743.85733.20-1.5%
long2026-06-102026-06-11732.00728.58-0.6%
long2026-06-112026-06-12727.48740.57+1.7%
long2026-06-122026-06-15738.72751.65+1.7%
long2026-06-152026-06-16752.90754.38+0.1%
long2026-06-162026-06-17755.40751.09-0.7%
long2026-06-172026-06-18750.90747.57-0.5%
long2026-06-182026-06-22746.12747.44+0.1%
long2026-06-222026-06-23748.30733.55-2.1%
long2026-06-232026-06-24734.09734.95+0.0%
long2026-06-242026-06-25737.03738.70+0.1%
long2026-06-252026-06-26737.50728.76-1.3%
long2026-06-262026-06-29728.05736.37+1.0%
long2026-06-292026-06-30738.85741.09+0.2%
long2026-06-302026-07-01741.51744.76+0.3%
long2026-07-012026-07-02742.83747.20+0.5%
long2026-07-022026-07-06748.74748.49-0.1%
long2026-07-062026-07-07749.36750.070.0%
long2026-07-072026-07-08749.66742.96-1.0%
long2026-07-082026-07-09743.86747.13+0.3%
long2026-07-092026-07-10747.56751.85+0.5%
long2026-07-102026-07-13752.80752.27-0.2%
long2026-07-132026-07-14753.63750.69-0.5%
long2026-07-142026-07-15749.88754.04+0.5%
long2026-07-152026-07-16755.40752.54-0.5%
long2026-07-162026-07-17752.40741.85-1.5%
long2026-07-172026-07-20741.24746.86+0.7%
long2026-07-202026-07-21748.23746.09-0.4%
long2026-07-212026-07-22745.81746.420.0%
long2026-07-222026-07-23747.52739.16-1.2%
long2026-07-232026-07-24741.50738.35-0.5%
long2026-07-242026-07-27739.48744.67+0.6%
long2026-07-272026-07-28744.86739.05-0.9%
long2026-07-282026-07-29738.35739.77+0.1%
long2026-07-292026-07-30740.21735.86-0.7%
long2026-07-302026-07-31735.64744.48+1.1%
long2026-07-312026-08-03746.18749.24+0.3%
long2026-08-032026-08-04750.96760.42+1.2%
long2026-08-042026-08-05762.03775.64+1.7%
long2026-08-052026-08-06776.39770.01-0.9%
long2026-08-062026-08-07770.09770.820.0%
long2026-08-072026-08-10771.70772.440.0%
long2026-08-102026-08-11772.83774.33+0.1%
long2026-08-112026-08-12773.66774.51+0.0%
long2026-08-122026-08-13773.25774.67+0.1%
long2026-08-132026-08-14775.59778.34+0.3%
long2026-08-142026-08-17778.37775.98-0.4%
long2026-08-172026-08-18775.71768.50-1.0%
long2026-08-182026-08-19768.75770.16+0.1%
long2026-08-192026-08-20770.23765.75-0.7%
long2026-08-202026-08-21767.26765.84-0.3%
long2026-08-212026-08-24765.07764.56-0.2%
long2026-08-242026-08-25763.71765.97+0.2%
long2026-08-252026-08-26766.89764.48-0.4%
long2026-08-262026-08-27765.88768.29+0.2%
long2026-08-272026-08-28767.68771.56+0.4%
long2026-08-282026-08-31772.23767.13-0.8%
long2026-08-312026-09-01766.57761.83-0.7%
long2026-09-012026-09-02762.14762.23-0.1%
long2026-09-022026-09-03762.60767.66+0.6%
long2026-09-032026-09-04769.17771.81+0.2%
long2026-09-042026-09-08772.91768.86-0.6%
long2026-09-082026-09-09769.00763.88-0.8%
long2026-09-092026-09-10764.32757.82-0.9%
long2026-09-102026-09-11758.00764.49+0.8%
long2026-09-112026-09-14765.96758.79-1.0%
long2026-09-142026-09-15758.89759.93+0.0%
long2026-09-152026-09-16759.12759.30-0.1%
long2026-09-162026-09-17759.41762.95+0.4%
long2026-09-172026-09-18761.57761.11-0.2%
long2026-09-182026-09-21761.26766.09+0.5%
long2026-09-212026-09-22766.63773.83+0.8%
long2026-09-222026-09-23775.01772.59-0.4%
long2026-09-232026-09-24772.63763.87-1.2%
long2026-09-242026-09-25764.90768.56+0.4%
long2026-09-252026-09-28769.64768.18-0.3%
long2026-09-282026-09-29767.93766.61-0.3%
long2026-09-292026-09-30765.59766.210.0%
long2026-09-302026-10-01766.93764.15-0.5%
long2026-10-012026-10-02764.95770.38+0.6%
long2026-10-022026-10-05770.89769.48-0.3%
long2026-10-052026-10-06771.00777.96+0.8%
long2026-10-062026-10-07778.33775.57-0.5%
long2026-10-072026-10-08775.68774.67-0.2%
long2026-10-082026-10-09775.50776.040.0%
long2026-10-092026-10-12776.76778.58+0.1%
long2026-10-122026-10-13779.03777.14-0.3%
long2026-10-132026-10-14777.90774.73-0.5%
long2026-10-142026-10-15775.20766.04-1.3%
long2026-10-152026-10-16765.83773.04+0.8%
long2026-10-162026-10-19772.46767.03-0.8%
long2026-10-192026-10-20767.55765.67-0.3%
long2026-10-202026-10-21765.71770.98+0.6%
long2026-10-212026-10-22770.42766.17-0.7%
long2026-10-222026-10-23767.46759.70-1.1%
long2026-10-232026-10-23760.19759.72-0.2%

The script

Pine v6, exactly as it ran for in 09:30, out 15:55 on SPY, long only. The variants change only the inputs listed in the table.

//@version=6
strategy("Time-of-Day Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, initial_capital=100000, commission_type=strategy.commission.percent, commission_value=0.05, slippage=1, margin_long=0, margin_short=0)

entryHour   = input.int(9, "Entry hour (exchange time)", minval=0, maxval=23, group="Timing")
entryMinute = input.int(30, "Entry minute", minval=0, maxval=59, group="Timing")
exitHour    = input.int(15, "Exit hour (exchange time)", minval=0, maxval=23, group="Timing")
exitMinute  = input.int(55, "Exit minute", minval=0, maxval=59, group="Timing")
goLong      = input.bool(true, "Long (off = short)", group="Direction")

// hour and minute are already the exchange clock, so no timezone maths and no GMT;
// "at or after" so a 09:35 entry or a 15:55 exit still fires on 15-minute bars
afterEntry = hour > entryHour or (hour == entryHour and minute >= entryMinute)
afterExit  = hour > exitHour or (hour == exitHour and minute >= exitMinute)
newDay     = timeframe.change("D")

var bool traded = false
if newDay
    traded := false

enterSig = afterEntry and not afterExit and not traded and strategy.position_size == 0 and barstate.isconfirmed
exitSig  = afterExit and strategy.position_size != 0 and barstate.isconfirmed

bgcolor(enterSig ? color.new(#16A56A, 90) : exitSig ? color.new(#E5484D, 90) : na, title="Entry and exit bars")

if enterSig
    if goLong
        strategy.entry("Long", strategy.long)
    else
        strategy.entry("Short", strategy.short)
    traded := true
if exitSig
    strategy.close_all()

How it was tested

Alpaca 5-minute data from the last 600 sessions, 0.05% commission and 0.025% slippage on every fill, the last third of the history held out, textbook settings and nothing tuned. The engine, fills and what it does not model are written out once, in data and methodology.

Run the Time-of-day strategy on your own symbol, free

Describe the rule in your own words or paste the script. The Free plan writes the Pine v6 script with the AI, runs it on any US stock or ETF with the same costs and the same held-out check, and shows every trade on the chart. No card.

Every strategy tested

Seventeen popular rules through the same engine, the same costs and the same held-out check, with every trade listed. Next: Opening range breakout strategy, VWAP strategy.

Questions

Does the Time-of-day strategy work?

SPY, 5-minute data, 2024 to 2026, long only: in 09:30, out 15:55 lost 42.2% after costs over 600 trades (45.8% won, profit factor 0.77) against +44.4% for holding SPY, and the held-out third did not survive. Across all 4 runs on the page, 0 made money after costs, 0 survived their held-out third and 0 beat holding the stock.

What is the win rate of the Time-of-day strategy?

From 42.2% to 50.5% across the 4 runs. The classic setting, in 09:30, out 15:55 on SPY long only, won 45.8% of 600 trades. The win rate alone does not decide the result: that run's profit factor was 0.77, so its losers outweighed its winners, and the net return was -42.2%.

What are the best Time of day settings?

Of the 3 settings tested, in 09:30, out 15:55 on QQQ (long only) did least badly: -35.8% net, profit factor 0.87, held-out did not survive. That is the best of 4 tries on 2.4 years of 5-minute data of one symbol, which is already a fitted number. A setting that works on one symbol or one period only is a coincidence, not a setting; run it on your own symbol and timeframe before trusting it.

Does the Time-of-day strategy beat holding the stock?

0 of the 4 runs did. SPY itself returned +44.4% between 4 June 2024 and 23 October 2026, so a rule that is out of the market part of the time has a lot to make up; what a timing rule usually gets you is a smaller drawdown, not a bigger return. The classic run's worst drawdown was 44.1% with 99% of the time in the market.

Did the Time-of-day strategy hold up out of sample?

The last third of every run's history (8 January 2026 to 23 October 2026 for the lead run) was judged on its own, with no fitting on it: 0 of 4 runs survived, 0 decayed, 4 did not survive and 0 had too few trades there to judge. Survived means a positive Sharpe ratio on the held-out part at least half the fitted period's; it is a check on one later stretch, not a forecast.

How was this tested?

With the free Alpha Charts tester's own engine: the Pine v6 scripts on this page, run on Alpaca 5-minute data from the last 600 sessions, split-adjusted and not dividend-adjusted, one position at a time with the whole account, fills at the next candle's open, a commission of 0.05% and slippage of 0.025% on every fill, the last third of the history held out. The settings are the textbook ones and every variant is stated; nothing was tuned to make the page look better.

Every number on this page is the output of the Alpha Charts backtest engine on 25 October 2026, on Alpaca market data; the scripts are the strategy library's templates, shown as they ran. Symbols are US-listed ETFs and stocks; results are price returns after the costs stated. Past results are not a forecast and nothing here is investment advice. TradingView and Pine Script belong to TradingView, Inc.; Alpha Charts is not affiliated with it.