VALYNOXSTRATEGY RESEARCH TECHNOLOGY
AlphaPrimeAlphaPrime
ACADEMY / MARKETS

TAIEX futures strategy backtest: testing it realistically

A realistic TAIEX futures backtest uses the contract you will trade, a clear roll rule, a deliberate session choice, full Taiwan costs on every trade, and a verdict based only on out-of-sample data.

By · Published · updated · Editorial policy

Contents
  1. What does a realistic 台指期 backtest need?
  2. Which contract should you test: TX, MTX or TMF?
  3. How do day and night sessions change your 台指期 data?
  4. How do you handle rolls and build a continuous series?
  5. What do fees, tax and slippage cost per trade in Taiwan?
  6. How should you validate a 台指期策略?
  7. What can a TAIEX futures backtest not tell you?
  8. Frequently asked questions
  9. References

What does a realistic 台指期 backtest need?

To backtest TAIEX futures (台指期) realistically, pick the contract you will actually trade, build a continuous series with a clear roll rule, decide whether night-session bars belong in the test, charge commission, the 0.002% futures transaction tax and slippage on every trade, and judge the strategy only on data it was not tuned on.

TAIEX futures (台指期貨, often shortened to 台指 or 台股期指) are cash-settled futures on the Taiwan Stock Exchange Capitalization Weighted Stock Index, traded on the Taiwan Futures Exchange (TAIFEX). A backtest of them is only as good as five decisions you make before the first run:

  1. Which contract the results are measured in.
  2. Which trading sessions the bars contain.
  3. How expiring months are joined into one price history.
  4. What each trade costs.
  5. Which part of the history is kept back for testing.

If you want a short settings list to check before a run, see the TAIEX futures backtest checklist.

Which contract should you test: TX, MTX or TMF?

Research the strategy on the index price, then measure costs and position size in the contract you will trade, because all three contracts follow the same index but differ in size and cost per point.

TAIFEX lists three TAIEX futures sizes. The big contract (大台指, code TX) is the original. The mini (小台指, MTX) and the micro (微台指, TMF) are smaller versions of the same contract.

ContractCommon nameValue of one index pointListed sinceWhat it means for research
TX大台指 / 大台NT$2001998Longest price history; fixed costs are the smallest share of each point
MTX小台指 / 小台NT$502001One quarter of TX; long history; finer position sizing
TMF微台指NT$102024One twentieth of TX; very fine sizing; short history of its own

The minimum price move (tick) is one index point for all three. The prices of the three contracts move almost together, so the TX price series is a reasonable stand-in for the index when you look for signals. The difference shows up in costs. A broker charges commission per contract, and that fee does not shrink as much as the contract does. In index points, a TMF trade therefore usually costs more than a TX trade. The free futures contract calculator covers TX, MTX and TMF with commissions, so one sample trade shows how the same fee weighs on each.

How do day and night sessions change your 台指期 data?

Decide on purpose whether your bars include the night session, because day-only and full-session bars produce different indicators, different gaps and different trades.

TAIEX futures trade in two sessions, Taipei time:

  • Regular (day) session: 08:45 to 13:45, which is 300 minutes.
  • After-hours (night) session: 15:00 to 05:00 the next morning, which is 840 minutes. TAIFEX added it in 2017.

Three details matter for data preparation:

  • Night trades belong to the next trading day. TAIFEX counts the night session as part of the following trading day. If your daily bars are built by calendar date instead, the daily high, low and close will not match the exchange's daily figures.
  • History before 2017 has no night session. A full-session test that starts earlier mixes two market structures. Either start the full-session test in 2017, or run the strategy on day-only bars across the whole history.
  • The expiring contract stops early. On the last trading day, the expiring month trades only until 13:30.

A 20-period moving average on day-only bars and the same average on full-session bars are two different indicators. On day-only bars, the price gap at each 08:45 open pulls the average sharply. The full-session version moves through the night and has a smaller gap at the open. The guide to night sessions in futures backtests explains how to choose between the two.

TAIEX futures sessions in Taipei time: the night session runs from 15:00 on Monday to 05:00 on Tuesday, the market is closed until 08:45, and the day session runs until 13:45, and all of it counts as Tuesday's trading day Night counts as the next day One trading day, Taipei time Trading day: Tuesday Night Day 15:00 00:00 05:00 08:45 13:45 Monday Tuesday Monday night trades count for Tuesday. So: build daily bars by trading day.
TAIEX futures sessions in Taipei time. The night session is counted as part of the next trading day.

The calendar needs attention too. Taiwan markets close for the long Lunar New Year holiday and can close on typhoon days. Check that these closures appear as gaps in your data, with no flat filler bars in their place.

How do you handle rolls and build a continuous series?

Join contract months with a fixed, written roll rule, because a rule chosen after looking at results is a hidden parameter.

A continuous contract is one price series built by joining expiring futures months end to end, so that a strategy can be tested across many years. TAIEX futures expire on the third Wednesday of the contract month, and trading is concentrated in the nearest month. Most traders roll to the next month a few days before expiry, or on the settlement day itself.

The two months rarely trade at the same price. In Taiwan the gap is often largest around the summer dividend season, when the next month usually trades well below the near month. If you join the months without adjustment, the series shows a jump that never happened in any single contract. A strategy can react to that jump as if it were a real move.

Hypothetical example

On the roll day, the near month closes at 20,000 and the next month closes at 19,850. An unadjusted continuous series drops 150 points overnight. A breakout-short rule fires on that drop and books a profit, but no account holding real contracts saw that move. A back-adjusted series removes the jump by shifting all older prices down by 150 points.

Joining contract months without adjustment shows a 150-point drop on the roll day that no real contract had, while a back-adjusted series runs on with no jump Rolls can fake a drop Roll day, hypothetical prices Unadjusted Back-adjusted −150 pts No jump No real contract saw that drop. So: signal on back-adjusted prices.
Joining months without adjustment creates a price jump no trader experienced. Back-adjusting removes it.

Back-adjusting changes the price level of old data, and tax and some indicators depend on the level. A practical order of steps:

  1. Choose the session (day-only or full) and the bar length.
  2. Write down the roll rule, for example "roll at the close two trading days before expiry".
  3. Build a back-adjusted series for the signals.
  4. Keep the unadjusted prices to calculate tax, which depends on the real contract value.
  5. Check the trades around roll days. Test results that depend on a few roll-day trades usually depend on the joining method.

What do fees, tax and slippage cost per trade in Taiwan?

Every trade pays commission, futures transaction tax and slippage on both entry and exit, and you should express all three in index points so you can compare them with the strategy's average trade.

The futures transaction tax is a Taiwan tax charged on each side of every futures trade. For stock index futures it is 0.002% of the contract value, which is the price times the value of one point. Commission (手續費) is set by your broker per contract. Slippage is the difference between the price the backtest assumed and the price you would really get. It is usually largest at the 08:45 open, around news and in thin hours of the night session.

One formula puts the three together:

Round-trip cost in points = 2 × (C ÷ M) + 2 × (0.00002 × P) + S

Here C is your commission per contract per side in NT$. M is the NT$ value of one point (200, 50 or 10). P is the index price. S is your total slippage for entry plus exit, in points. The first part shows why small contracts cost more points: the same fee is divided by a smaller M.

Hypothetical example

The index is at 20,000. Tax is then 0.4 points per side for every contract size. Assume commissions of NT$50 per side for TX, NT$25 for MTX and NT$15 for TMF, and one point of slippage per side.

ContractCommission (2 sides)Tax (2 sides)Slippage (2 sides)Round trip
TX0.5 points0.8 points2 points3.3 points
MTX1.0 points0.8 points2 points3.8 points
TMF3.0 points0.8 points2 points5.8 points

A strategy with a gross average trade of 6 points keeps 2.7 points on TX and almost nothing on TMF.

Hypothetical 6-point average trade split into commission, tax plus slippage, and what is kept: TX keeps 2.7 points, MTX keeps 2.2 points, and TMF keeps only 0.2 points because commission takes a larger share Smaller contract, less left A 6-point trade, hypothetical Commission Tax, slippage Kept TX +2.7 MTX +2.2 TMF +0.2 On TMF, costs eat almost all of it. So: test with the contract you trade.
Hypothetical round-trip costs in index points. Tax is the same in points for every size, but the commission share grows as the contract gets smaller.

Put your own broker's commission into the formula, and rerun the test with double the slippage. If the result collapses, the strategy depends on cheap fills. The guide to trading costs in backtests and the average trade covers this stress test in more detail.

How should you validate a 台指期策略?

Judge a strategy only by its results on data that played no part in choosing it, and test it across several walk-forward windows, not one split.

Out-of-sample data is the part of the history that was kept back while you built and tuned the strategy, and was used only for the final test. Walk-forward analysis is a repeated version of that idea: tune on one window, test on the next unseen window, move forward, and join the unseen pieces into one result. The guide to walk-forward analysis and window choice explains the setup.

This matters most when you test many variants. Picking the best of many backtests is like picking the luckiest of many coin-tossers: the winner looks skilled, but much of the result is chance. Research on backtest overfitting and data snooping shows that the best in-sample result is expected to look better than its future performance (White, 2000; Bailey et al., 2014; Bailey & López de Prado, 2014).

CheckA result you can work withA result to drop
Out-of-sample after costsPositive, and a clear share of the in-sample result remainsPositive only in sample
Walk-forward windowsMost windows positive, and the worst window is survivableOne or two windows produce all the profit
Trade countDozens of trades in each test windowA handful of trades
Neighbouring parametersNearby values give similar resultsOnly one exact value works
Market conditionsSurvives fast sell-offs such as March 2020 and quiet rangesWorks in one type of market only
Session and contractHolds on the session and contract you will tradeWorks only on day-only TX bars when you plan to trade TMF at night

In AlphaPrime (Valynox), strategy validation offers Basic, Standard and Extensive validation levels, walk-forward analysis and thresholds you set yourself. A strategy that fails one check skips the later ones.

What can a TAIEX futures backtest not tell you?

A backtest describes how rules would have behaved on past data under your assumptions, so treat it as a filter for ideas, not as a forecast.

Use these points to decide how much weight a result deserves:

  • The market structure changes. The night session started in 2017 and TMF in 2024. A result that comes mainly from years before such a change may describe a different market.
  • Fills are estimates. A bar backtest does not know the order book. Compare your first live fills with the backtest's assumed prices and update the slippage figure.
  • Gaps go past stops. A stop placed at 13:44 can fill far away after the 15:00 open, or after a long holiday. Bar data shows the gap but cannot show where you would have been filled inside it.
  • Your search is part of the result. Write down how many variants you tested. The more you tried, the more you should discount the best one.

What this means if you use AlphaPrime: set the TAIEX futures session, fees and slippage in GPU backtesting before the first search (next-bar execution is always applied), so that every candidate is ranked after Taiwan costs. Then hold back an out-of-sample period and let validation remove the candidates that do not survive it.

Frequently asked questions

Should I backtest 大台指 (TX) or 小台指 (MTX)?

Use the longest clean price history to find signals, which is usually TX, and then calculate costs for the contract you will trade. TX and MTX follow the same index, so signals are nearly the same. Costs in points are usually higher on MTX because commission is charged per contract.

Do I need night-session data for a 台指期回測?

You need it if you plan to hold positions or trade between 15:00 and 05:00 Taipei time. For a day-only strategy, day-only bars are cleaner and cover history from before the night session existed in 2017. Do not mix the two in one test.

How much is the futures transaction tax on TAIEX futures?

For stock index futures, Taiwan charges 0.002% of the contract value on each side of every trade. The contract value is the index price times the value of one point. In index points the tax is the same for TX, MTX and TMF at the same price.

Can a strategy built on TX data be traded on TMF?

The price signals carry over because both contracts follow the same index. The costs do not carry over: commission takes a much larger share of each point on TMF. Rerun the backtest with TMF commission before deciding.

How many years of TAIEX futures data should a backtest use?

Use enough history to contain several kinds of market, including fast sell-offs and quiet ranges, and enough trades in every test window. Keep the session structure consistent: full-session tests begin in 2017, and day-only tests can go further back.

References

  • White, H. (2000). A Reality Check for Data Snooping. Econometrica, 68(5), 1097–1126.
  • 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.
  • Bailey, D. H., & López de Prado, M. (2014). The Deflated Sharpe Ratio: Correcting for Selection Bias, Backtest Overfitting and Non-Normality. The Journal of Portfolio Management, 40(5), 94–107.