當沖 (day trading) explained: how to test a strategy after costs
當沖 means opening and closing a position within the same trading day. A day-trading strategy is worth trading only if its average trade stays clearly positive after costs on both sides, in a backtest that fills orders at prices you could really have got.
By Soren Huang · Published · updated · Editorial policy
Contents
- What does 當沖 mean?
- How is stock day trading different from futures day trading?
- What does one day-trade round trip cost?
- How do you backtest an intraday rule with realistic fills?
- Why do more trades make day trading harder, not easier?
- What does a good and a bad day-trading test look like?
- Frequently asked questions
- References
What does 當沖 mean?
當沖 (day trading) means you open and close the same position within one trading day, so you hold nothing overnight. A day-trading strategy works only if its average trade stays clearly positive after commission, tax and slippage on both the entry and the exit. The backtest must also fill orders at prices you could really have got.
The full term is 當日沖銷, which means "same-day offset". Day trading is buying and selling the same instrument within one trading day so that your position is zero when the day ends. You can buy first and sell later, or sell first and buy back later. Your result is the price difference minus the costs of both trades.
Because you end the day flat, an overnight gap cannot hit your position. The other side of this is cost. Every idea becomes a full round trip, and each round trip pays costs twice.
For futures, "one trading day" is a session, not a calendar day. The TAIEX futures (台指期) night session runs from 15:00 to 05:00 the next morning, and TAIFEX counts it as part of the next trading day. Suppose you open a trade at 22:00 and close it at 01:00. That trade crosses midnight, but it is still a day trade. How you treat this in your data matters, as explained in night sessions in futures backtests: day-only vs. full-session bars.
How is stock day trading different from futures day trading?
Both close the position on the same day, but stock day trading in Taiwan needs a separate broker agreement and pays a percentage tax on the sale, while futures day trading pays a far smaller tax and can also run at night.
| Question | Taiwan stock day trading (股票當沖) | TAIEX futures day trading |
|---|---|---|
| Who can do it? | Accounts that meet the broker's conditions and have signed a day-trading agreement | Any futures account at full margin; the reduced day-trading margin needs a separate risk-disclosure agreement with the broker |
| Trading hours | 09:00–13:30 | Day session 08:45–13:45, night session 15:00–05:00 |
| Selling first | Allowed only for eligible stocks and eligible accounts | Selling short is as simple as buying |
| Commission | Percentage of trade value, on each side | Fixed amount per contract, on each side |
| Transaction tax | On the sale only, as a percentage of value | 0.002% of contract value, on each side |
| If you cannot close | You must settle the full purchase two business days later | The position stays open overnight and needs full margin |
Stock prices in Taiwan can move at most 10% from the previous close in one day. On a day when a stock is locked at its limit, you may not be able to close your day trade at all. Futures leverage is higher, because margin covers only part of the contract value.
What does one day-trade round trip cost?
A Taiwan stock round trip costs roughly 0.44% of the trade value at the full commission rate, before slippage. The price must move more than that before the trade earns anything.
A round trip is one entry plus the matching exit. Slippage is the difference between the price your rule wanted and the price you actually got. For any day trade, the cost check fits on one line:
Net result = gross result − (2 × commission + tax + 2 × slippage)
Here the gross result is the price difference times the quantity. Commission is the broker fee for one side. Tax is the transaction tax for the whole round trip. Slippage is the price lost on one side.
The cost inputs work like this:
- Stock commission. The listed maximum commission is 0.1425% of trade value per side. Many brokers give discounts, so use your own rate.
- Stock tax. The regular securities transaction tax on a sale is 0.3%. Since 2017, qualifying same-day stock round trips pay a reduced rate of 0.15%. The law sets this reduced rate for a limited period and has extended it several times. If your backtest covers years before the cut, use 0.3% for those years.
- Futures tax. For TAIEX futures, the tax is 0.002% of contract value on each side.
Hypothetical example
Stock: you buy one lot of 1,000 shares at NT$80.0 and sell at NT$80.6, using the full commission rate. At this price one tick is NT$0.1.
| Item | NT$ |
|---|---|
| Gross result (0.6 × 1,000) | 600 |
| Commission, buy (0.1425% of 80,000) | −114 |
| Commission, sell (0.1425% of 80,600) | −115 |
| Day-trade tax (0.15% of 80,600) | −121 |
| Slippage, one tick each side | −200 |
| Net result | 50 |
A 0.75% price move keeps only NT$50. If the move had been NT$0.5 instead of NT$0.6, the same trade would lose money.
Futures: TAIEX futures at 20,000 points, so the contract value is 20,000 × NT$200 = NT$4,000,000. Tax is NT$80 per side. Assume a commission of NT$50 per side and one point (NT$200) of slippage per side. The round trip costs NT$660, or 3.3 index points. For the mini contract (NT$50 per point), assume NT$25 commission per side. Tax is NT$20 per side and one point of slippage is NT$50 per side. The round trip costs NT$190, or 3.8 points. The smaller contract needs a larger move in points to break even.
The same comparison, with more detail on cost estimates, is in trading costs in backtests: commission, slippage and the average trade.
How do you backtest an intraday rule with realistic fills?
To get realistic fills, test on bars that are short compared with your holding time, fill each signal on the next bar with slippage added, and allow trades only in the session you will actually trade. Follow these steps in order:
- Pick the bar size. Suppose your trades usually last 30 minutes. Then 30-minute bars show almost nothing inside a trade, while 1-minute or 5-minute bars show the path the price took.
- Set the session. Decide on day session only or day plus night, and use the same choice in the test and in live trading. Make the rule exit before the session ends, so that no test trade is carried overnight.
- Use next-bar execution. Next-bar execution is filling an order on the bar after the one that produced the signal. A rule that decides on a bar's close cannot also trade at that same close.
- Enter costs per side. Enter commission, tax and slippage as in the example above. Use the tax rate that applied in each period of the test.
- Treat limit orders strictly. Count a limit order as filled only when the price trades through it, not when the price just touches it. Fill stop orders at the stop price or worse.
- Resolve bars that hit both stop and target. One bar's high and low do not tell you which came first. Assume the stop was hit first.
- Look at limit-locked days. For stocks, find trades on days the price closed at its 10% limit. Check whether the test exited at prices that did not trade.
In AlphaPrime (Valynox), backtesting lets you set the data resolution, next-bar execution, fees and slippage, and trading sessions. Every candidate in a search is then judged with these settings already applied.
Why do more trades make day trading harder, not easier?
Each extra trade adds a full round-trip cost and a new chance of a bad fill. The shorter a strategy holds its trades, the larger the share of its gross edge that costs take.
Think of a shop that earns one coin on each item it sells. It sells thousands of items, so the total looks large. If rent rises by one coin per item, the whole shop makes nothing. A short-holding strategy works the same way. Its many trades look reassuring, but one extra tick of slippage per side can erase the result.
High-frequency trading is trading that holds positions for seconds or less and depends on your place in the order queue and the speed of your connection to the exchange. Bar data does not show the order book, your queue position or your delay, so a bar backtest cannot test this style. For bar-based day trading, choose rules whose trades last several bars. Then the move per trade is large compared with one tick.
Intraday data also makes overfitting easier. Overfitting is choosing rules that matched past noise rather than a repeatable pattern. Minute bars give a search millions of small moves to fit. The more variants you test, the more likely it is that the best one is lucky (Bailey et al., 2014). Overfitting in strategy generation: how not to fool yourself explains how to keep a search honest.
What does a good and a bad day-trading test look like?
A stronger day-trading test keeps a positive net average trade under higher costs, on unseen data and across the hours of the session. A weak one depends on one of these conditions.
In-sample data is the period the search used to pick the rule; out-of-sample data is a later period the search never saw.
| Check | Weak result | Stronger result |
|---|---|---|
| Gross average trade vs round-trip cost | About equal | Several times the cost |
| Slippage doubled | Turns negative | Stays positive |
| Out-of-sample windows | Profit only in-sample | Most windows positive |
| Time of day | Almost all profit from the first bar after the open | Spread across the hours you trade |
| Long and short sides | One side carries everything and you cannot explain why | Both sides add, or the reason for one side is clear |
| Trade count per test window | A handful | Enough trades in every window |
Most 股票當沖技巧 (stock day-trading tips) and 當沖教學 (day-trading lessons) describe entry patterns. The table gives you a way to check any of them on your own data. To test on unseen data, use walk-forward analysis. AlphaPrime's strategy validation runs walk-forward analysis with custom thresholds.
What this means if you use AlphaPrime: put your real per-side costs and your trading session into the search settings before the first run. Then check the finalists with doubled slippage and walk-forward validation before you look at anything else.
Frequently asked questions
What does 當沖 mean?
當沖 is short for 當日沖銷, or same-day offset. It means opening and closing the same position within one trading day, so you hold nothing overnight. You can buy first and sell later, or sell first and buy back. Your result is the price difference minus costs on both trades.
Is futures day trading cheaper than stock day trading in Taiwan?
The tax is much lower for TAIEX futures: 0.002% of contract value per side. A day-traded stock sale pays 0.15%. Commission and slippage still apply to both. Compare the total round-trip cost with the move your strategy usually captures, in points or ticks.
What happens if I cannot close a stock day trade?
If you bought first, you must pay for the full purchase on the settlement day, two business days later, like a normal purchase. If you sold first, the broker must obtain shares to deliver, which adds costs. This can happen when a stock is locked at its daily price limit.
Do I need tick data to backtest a day-trading strategy?
Not for rules that hold a trade for several bars. One-minute or five-minute bars with next-bar fills and slippage can test those realistically. Strategies that depend on the order book or on very fast fills need order-level data and cannot be judged on bars.
How do I know if a day-trading backtest is too good to be true?
Rerun it with double the slippage and check the net average trade. Then test it on data the search did not use. If the profit disappears, or comes almost entirely from the first bar of the session, the result probably reflects optimistic fills or fitted noise.
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.
What AlphaPrime does here
AlphaPrime's backtesting applies your chosen data resolution, next-bar execution, fees and slippage, and trading sessions in every evaluation. The Performance Report shows equity, drawdown, individual trades, periodic performance and the long and short sides separately.

