Day trading US stocks: test an intraday idea first
Write the intraday idea as exact rules, test it on the New York regular session with every trade closed before the close, charge realistic costs, and accept it only if it holds up on data you held back.
By Soren Huang · Published · updated · Editorial policy
Contents
- What does day trading mean, and how do you test it?
- Which bar size should an intraday backtest use?
- When does the US stock market open in Taiwan time?
- How much do fees, slippage and fills take from a small edge?
- Why do day trading tips and recommended strategies need out-of-sample testing?
- Why test the same idea on index futures?
- In what order should you run your first intraday test?
- Frequently asked questions
- References
To test a US stock day trading idea from Taiwan, write it as exact rules and run it on intraday bars of the New York regular session (21:30–04:00 Taiwan time in US summer, 22:30–05:00 in winter). Close every trade before the close, charge costs on every trade, and judge the idea only on data you held back.
What does day trading mean, and how do you test it?
A day trading backtest must force every position flat before the session ends, and only then measure the result. Day trading (當沖, or 日內交易) is opening and closing a position within the same trading session, so no position is held overnight. A test that lets trades run into the next morning includes overnight gaps, so it tests a different strategy. Testing an intraday idea this way is the first step toward algo trading.
A backtest can only follow a recipe with exact amounts. "Buy strong stocks early and take profits quickly" is advice. A testable day trading strategy (美股當沖策略) answers every question in this list:
- Which instruments: one stock, a fixed list, or a list chosen each day by a rule written in advance.
- Entry window: for example, only between 9:45 and 11:00 New York time.
- Entry condition: the exact price event that opens the trade, such as a break above the high of the first 15 minutes.
- Exits: a stop distance, a profit target, or both.
- Forced exit time: for example, close any open position at 15:55 New York time.
- Trade limit: how many trades per day are allowed, and whether a second entry is allowed after a stop.
If you cannot write one of these lines, the backtest will fill the gap with a default setting, and the result will describe that default instead of your idea.
Which bar size should an intraday backtest use?
Use the bar size your rules actually decide on, and let the backtest act on the next bar after a decision. A bar is one row of data with the open, high, low and close for a fixed time span. The regular session lasts 6.5 hours, so the bar size sets how many decisions a day the strategy can make. Choosing the bar size under data resolution in AlphaPrime (Valynox) backtesting makes every decision fill on the next bar, which is the timing this paragraph asks for.
| Bar size | Bars per regular session | Suits | What to check |
|---|---|---|---|
| 1 minute | 390 | Fast entries around the open | Many trades, so costs dominate. The data must be clean. |
| 5 minutes | 78 | Most opening-range and intraday trend ideas | Whether stops and targets can both be hit inside one bar. |
| 15 minutes | 26 | Slower intraday swings | Fewer trades, so you need more years of data. |
Three data details change results more than most traders expect:
- Bar timestamps. Some data stamps a bar with its start time and some with its end time. A rule like "enter after the 9:30 bar" means different bars in the two conventions.
- Split adjustment. Unadjusted prices show a fake crash on the day of a stock split. A stop rule would react to a move that never happened.
- Next-bar execution. A rule that decides on a bar's close cannot also fill at that same close. Fill on the next bar's open to stay realistic.
When does the US stock market open in Taiwan time?
The regular session runs from 9:30 to 16:00 New York time, which is 21:30 to 04:00 in Taiwan during US daylight saving time and 22:30 to 05:00 for the rest of the year.
| Period | New York time | Taiwan time |
|---|---|---|
| US daylight saving time (second Sunday of March to first Sunday of November) | 9:30–16:00 | 21:30–04:00 the next day |
| US standard time (rest of the year) | 9:30–16:00 | 22:30–05:00 the next day |
Store your bars in New York time, so a fixed entry window such as "trade only the first hour" means the same hour all year. If your data is in Taiwan time, a rule such as "start at 22:30" skips the first hour of the session in summer, and a rule such as "start at 21:30" starts one hour before the open in winter. For the full session and extended-hours schedule, see US stock market hours vs futures sessions.
The NYSE also has a few early-close days a year, when the session ends at 13:00 New York time. A forced exit at 15:55 never triggers on those days unless the test knows the early close. The stock market holidays tool lists exchange holidays and early closes, and the futures market hours tool shows session hours in your own time zone. Exchanges can change hours and contract details, so the exchange's own hours page and contract page are the final word.
How much do fees, slippage and fills take from a small edge?
For most intraday stock ideas, trading costs decide the result, because the average trade is often only a few cents per share. Slippage is the gap between the fill a backtest assumes and the fill you actually receive. For a trader in Taiwan who uses 複委託 or a US broker, the costs per round trip (entry plus exit) usually include:
- Commission, often with a minimum per order, which hurts small positions most. Commission structures differ by broker, so enter the minimum per order your own broker charges.
- Regulatory fees on sales, where your broker passes them on.
- The bid-ask spread, if your bars use last-trade prices but you would buy at the ask and sell at the bid.
- Slippage on market and stop orders, which is usually largest in the first minutes after the open.
The one check to run first is simple:
Net average trade = gross average trade minus round-trip cost
Here, the "gross average trade" is the backtest profit per trade before any costs, and the "round-trip cost" is commission, fees, spread and slippage for one entry plus one exit.
Hypothetical example
An opening-range idea trades 100 shares at a time. Over 400 trades, the gross result is +$2,400, or +$6 per trade (6 cents per share). Commission is $3 per order, so $6 per round trip. Spread and slippage are 2 cents per share on each side, so $4 per round trip. The net result is 6 − 6 − 4 = −$4 per trade, or −$1,600 over 400 trades. The gross backtest looked positive, but the idea cannot pay for its own trades.
Fill assumptions need the same care as fees. A limit order that the backtest fills whenever price touches it would often not fill in reality. Short trades on stocks need shares to borrow, and hard-to-borrow stocks may not be available on the day your rule wants them. Rerun the test with double the slippage. If the idea fails, it depended on cheap execution. The article on trading costs in backtests explains how to estimate slippage from your own fills.
Why do day trading tips and recommended strategies need out-of-sample testing?
A tip is usually the survivor of many ideas that someone tried, so its past result looks better than its future result until it works on data nobody used to choose it. Imagine a thousand people each flip a coin ten times. On average, about one of them will get ten heads. That person is not a better coin flipper; that person is the one you hear about. Popular day trading recommendations (美股當沖推薦) and tricks (美股當沖技巧) are often shown in the same way: the version that worked best in the past is the version that gets shared.
Out-of-sample data is price history that was not used to build, choose or tune the rules. Research on technical trading rules shows how strong this selection effect is: when many rules are tested on the same data, the best one can look good by chance alone (Sullivan, Timmermann and White, 1999; White, 2000). Bailey and co-authors (2014) show that the more variants you try, the more the best backtest overstates what you should expect later.
A practical routine looks like this:
- Write the rules from the tip, including every setting, before you look at any results.
- Set aside the most recent one or two years of data and do not open them.
- Build and adjust the rules only on the earlier years, and write down how many versions you tried.
- Run the final version once on the held-back years, with full costs.
- Accept the idea only if the held-back result keeps a clear part of the earlier result and the trade count is large enough to mean something.
Hypothetical example
A forum tip says "buy the stock with the biggest opening gap up and sell at 11:00." You test it on 2019–2023 and try 20 variations of the gap size and exit time. The best variation shows +$10 net per trade. On the held-back years 2024–2025, the same rules show −$2 net per trade over 150 trades. The earlier result came mostly from choosing the best of 20 variations, so you reject the tip.
Stock selection adds one more trap. Survivorship bias is the error of testing only on stocks that still exist and are popular today. Today's favourite day trading stocks exclude the ones that collapsed or were delisted, so a test on them looks better than the past really was. A repeated version of the held-back test is walk-forward analysis, which tunes on one window, tests on the next, and moves forward through the history.
Why test the same idea on index futures?
Index futures give you one liquid instrument with fixed tick values and a long continuous history, so an intraday idea can be tested without choosing stocks. If your idea is about the general market move after the US open, an S&P 500 or Nasdaq 100 future measures that move directly.
| Testing question | US stocks | US index futures |
|---|---|---|
| Which instrument? | You must choose stocks, which brings survivorship bias | One contract per index |
| Session | Regular session plus thinner extended hours | Nearly 24 hours on weekdays, with a daily one-hour break |
| Going short | Needs shares to borrow | Same order type as going long |
| Cost unit | Per share or per order | Per contract, with a fixed value per tick |
| Main data issue | Splits and delisted stocks | Contract rolls |
Contract sizes are fixed by the exchange. On CME, the E-mini S&P 500 (ES) is worth $50 per index point and the Micro E-mini (MES) $5 per point, both with a minimum tick of 0.25 points, so one tick is $12.50 on ES and $1.25 on MES. The futures contract calculator shows tick value and the profit or loss of a trade for other contracts.
Two settings keep the futures test comparable with your stock idea. First, use a continuous contract, which is a series that joins each expiring contract to the next one; ES expires in March, June, September and December, so the series must handle those rolls. Second, add a session filter so the rules trade only 9:30–16:00 New York time, even though the contract trades nearly all day.
AlphaPrime works with your own historical bar data for futures markets, including US index futures and TAIEX futures. Its strategy validation includes walk-forward analysis, so a held-back test is part of the process rather than an extra step.
In what order should you run your first intraday test?
Settle the data and costs before you look at any result, because every later number depends on them. This order keeps each step honest:
- Choose the instrument and load bars in New York time, split-adjusted for stocks or as a continuous contract for futures.
- Set the session to 9:30–16:00 New York time and include early-close days.
- Write the six rule lines from the first section, including the forced exit time.
- Set commission, fees and slippage per round trip, and use next-bar fills.
- Hold back the most recent one or two years.
- Run the test on the earlier years and check the gross average trade against the round-trip cost.
- Run the held-back test once, then rerun it with double slippage.
What this means if you use AlphaPrime: AlphaPrime evaluates each candidate strategy with fees, slippage, next-bar execution and the trading session you set, so an intraday futures idea is tested on the same terms from the first run. Load US index futures bars, limit the session to the New York regular hours, and judge the idea on walk-forward results rather than on the best single backtest.
Frequently asked questions
What time does the US stock market open in Taiwan?
The New York regular session opens at 9:30 New York time. That is 21:30 Taiwan time during US daylight saving time, from the second Sunday of March to the first Sunday of November, and 22:30 Taiwan time for the rest of the year. The session closes at 04:00 or 05:00 Taiwan time the next morning.
How do I backtest a US stock day trading strategy?
Write the idea as exact rules with an entry window, entry condition, stop, target and a forced exit before the close. Run it on intraday bars in New York time with commission, spread and slippage charged on every trade and fills on the next bar. Keep the most recent one or two years aside and test the final rules on them once.
Which bar size is best for day trading backtests?
Use the bar size your rules decide on. Five-minute bars, with 78 bars per regular session, suit most opening-range and intraday trend ideas. One-minute bars give more trades but make costs and data quality more important, while 15-minute bars need more years of data to reach enough trades.
Is it easier to test day trading on index futures than on stocks?
For ideas about the general market, often yes. An index future is one liquid contract with a fixed tick value, going short works the same as going long, and you avoid choosing stocks and the survivorship bias that comes with it. You need a continuous contract that handles the quarterly rolls, and a session filter if you want to trade only the stock market hours.
Should a day trading backtest include pre-market hours?
Include pre-market bars only if your rules would really trade then. Liquidity is thinner outside the regular session, so slippage is usually larger. Many intraday ideas use the regular session only and keep extended-hours bars out of the test.
References
- Bailey, D. H., Borwein, J., López de Prado, M., & Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance. Notices of the American Mathematical Society, 61(5), 458–471.
- Sullivan, R., Timmermann, A., & White, H. (1999). Data-Snooping, Technical Trading Rule Performance, and the Bootstrap. The Journal of Finance, 54(5), 1647–1691.
- White, H. (2000). A Reality Check for Data Snooping. Econometrica, 68(5), 1097–1126.

