Program trading for TAIEX futures: zero to first strategy, no coding
To start program trading on TAIEX futures you need a platform that runs strategy rules, a broker whose API connects to it, and historical bar data for the session you trade. Build one simple rule, backtest it with costs, validate it on unseen data, paper trade, then go live with one Micro-TAIEX futures (TMF) contract.
By Soren Huang · Published · updated · Editorial policy
Contents
- What is program trading, and what is it not?
- What do you need to start: platform, broker API and data?
- How do you build and backtest a first strategy without coding?
- How do you check that the first backtest is not a lucky fit?
- When should you go live, and how many contracts should you start with?
- What do beginners on forums get wrong about 程式交易?
- Frequently asked questions
- References
What is program trading, and what is it not?
To start program trading on TAIEX futures: get a platform that runs strategy rules, a broker whose API connects to it, and historical bar data for the session you trade. Build one simple rule, backtest it with costs, validate it on unseen data, paper trade, then go live with one Micro-TAIEX futures (TMF) contract.
Program trading (程式交易) is trading where written rules decide every entry, exit and position size, software tests those rules on historical data, and the same software sends the orders through a broker connection. The rules are fixed in advance. If the rule says "buy when price breaks above the high of the first 30 minutes", the software buys every time that happens, whether or not you would have liked the trade that day.
Think of it as writing a recipe instead of cooking by taste. The recipe can be tested a thousand times on past data, and anyone can follow it the same way. But you still choose what goes into the recipe: which market, which session, how much to risk, when to stop trading it. The trader owns the research and the risk choices. The software only removes the hand on the mouse.
Program trading is not a black box that produces signals you can follow without checking them, and it is not a shortcut around learning the market. If you do not understand why a rule should work on TAIEX futures, a backtest will not tell you. It will only tell you how that rule fitted the past. The sections below give the order of steps that keeps this honest.
What do you need to start: platform, broker API and data?
A first setup needs three separate pieces that must fit together: a platform that runs strategy code, a broker whose API that platform can send orders through, and historical bar data for the TAIEX futures session you intend to trade. Each is a separate choice, and a mismatch between any two of them stops the whole setup.
A trading platform is the program that holds your strategy rules, runs them on historical data for a backtest, and runs them on live prices to produce orders. A broker API is the connection a broker provides so that software, rather than a person, can send orders and receive fill reports. Most Taiwan futures brokers ask you to sign an API agreement before they open this connection, and each broker supports a specific list of platforms. Historical bar data is the record of open, high, low and close prices for each time interval, for example one bar per minute or one bar per day.
| Piece | What it does | Check before you pay |
|---|---|---|
| Historical bar data | Feeds the backtest | Resolution you need (1-minute, 5-minute, daily); covers the day session only or the full session including the night; enough years to include a rising, a falling and a sideways market |
| Platform | Runs the rules, backtests them, sends orders | Runs the strategy language your rules are written in; your broker lists it as supported |
| Broker API | Accepts orders, returns fills | Connects to the platform you chose; the API agreement is signed; fees per contract are known in writing |
The data must match the session you trade. TAIEX futures trade in a day session from 08:45 to 13:45 Taiwan time and a night session from 15:00 to 05:00 the next day. A strategy that only trades the day session can use day-only data. A strategy that holds a position past 13:45 needs full-session data, because the night session can hit a stop that day-only data never shows. The exchange can change these hours, so check the TAIFEX contract page, or look them up in your own time zone with the futures market hours tool.
Platform choice in Taiwan usually starts from the broker: several Taiwan futures brokers offer a MultiCharts connection to their API, and other platforms are supported by some brokers and not others. AlphaPrime (Valynox) is a strategy-research program, not an order-sending platform; it exports the strategy source code to the trading platforms listed on the platform export page, so the practical order is: ask your broker which platforms its API supports, pick one of them, and make sure your research tool can export to it.
How do you build and backtest a first strategy without coding?
Start with one simple rule, fix the session, fees, slippage and next-bar execution before the first run, and judge the result by the average trade after costs rather than by the shape of the equity curve. A strategy generator lets you do all of this with settings instead of code: you choose the indicators, the parameter ranges and the entry and exit types, and AlphaPrime's strategy generation turns those choices into testable rules.
A backtest is a run of the rules over historical bars that reports every trade the rules would have taken. Its result is only as realistic as its settings, so the order of steps matters:
- Choose one simple rule. For example: buy when the price breaks above the high of the first 30 minutes of the day session, sell short when it breaks below the low, exit at the day-session close. One rule with two or three parameters is enough for a first test.
- Set the session. Day session only (08:45–13:45) or full session. The backtest must only see bars from the hours the live strategy will trade.
- Enter commission and exchange fees per round trip. A round trip is one entry plus one exit. Taiwan charges a futures transaction tax of 0.002% of the contract value on each side for index futures; add your broker's commission per contract.
- Enter slippage. Slippage is the difference between the price the backtest assumes and the price a real order fills at. Use at least one tick per side for market and stop orders.
- Set next-bar execution. Next-bar execution means a signal calculated on the close of one bar fills on the next bar, which is the earliest a real order could reach the exchange.
- Run, then read the average trade after costs.
The average trade is the net result divided by the number of trades. After costs, it is the gross average trade minus the round-trip cost. It is the first number to read because a rising equity curve can hide a strategy that loses a little on every trade once fees and slippage are paid. AlphaPrime's backtesting applies fees, slippage, the trading session and next-bar execution to every candidate, so the ranking you see is already after costs. The detail on how to estimate those costs is in trading costs in backtests.
Hypothetical example
A TMF breakout rule shows a gross result of NT$300,000 over 1,200 trades, which is NT$250 per trade before costs. With TMF at 20,000 points the contract value is about NT$200,000 (NT$10 per point), so the transaction tax is about NT$4 per side. Add a broker commission and one tick of slippage per side and the round trip comes to about NT$300. The average trade after costs is NT$250 − NT$300 = −NT$50, and the 1,200 trades lose about NT$60,000 in total. The gross curve rises, the net curve falls.
How do you check that the first backtest is not a lucky fit?
Keep part of the history unseen and roll the test forward through time, because a rule chosen on all the data will always look good on that data; the out-of-sample result is the one to trust. This is the step most beginners skip, and it is the step that separates a tested strategy from a curve-fitted one.
In-sample data is the part of the history on which you chose the rule and its settings. Out-of-sample data is history the choice never saw. The reason the split matters is simple: if you test twenty variants of a rule on the same ten years and keep the best, the winner looks good partly because it won a contest, not because it has an edge. Bailey, Borwein, López de Prado and Zhu (2014) showed that when many variants are tried on the same data, the best in-sample result is expected to look good even when none of the variants has any real edge. The only cure is data that was not part of the contest.
Walk-forward analysis is the method that repeats this split through time: choose settings on an in-sample window, test them unchanged on the out-of-sample window that follows, move both windows forward, and repeat. The joined out-of-sample segments form one result that was never used to pick anything. One split gives you one unseen period, which may be a lucky one. Rolling the split gives several unseen periods, and you can count how many were positive and how bad the worst one was. The window choices are explained in walk-forward analysis: why one backtest is not enough.
What to look for in the out-of-sample result:
- Most out-of-sample windows positive after costs, not one big window carrying the rest.
- Settings chosen in neighbouring windows close to each other. Settings that jump from window to window mean the rule has no stable region.
- Out-of-sample average trade in the same range as in-sample. A large drop means the in-sample result was mostly fit.
AlphaPrime's strategy validation runs these checks with thresholds you set, so every candidate is judged by the same standard and later checks stop when a candidate fails an earlier one.
When should you go live, and how many contracts should you start with?
Go in order: backtest, validation, simulated trading until live fills match the backtest assumptions, then one Micro-TAIEX futures (TMF) contract, and raise size only after the live record resembles the test. Each stage has one exit condition, and skipping a stage means you learn its lesson with real money. The contract count for the last stage comes from account risk and stop distance; the position size calculator gives that number from your account size, the risk per trade and the stop in points.
Simulated trading (paper trading) is running the strategy on live prices through the platform with orders that are recorded but not sent to the exchange, or sent to a broker's simulation account. Its purpose is not to prove the strategy. It is to check the plumbing: that the platform produces the same signals the backtest produced, that orders reach the broker API, and that fills land within the slippage you assumed. A backtest can be right and the connection can still be wrong.
| Stage | Move on when |
|---|---|
| 1. Backtest after costs | Average trade after costs is clearly above the round-trip cost |
| 2. Validation with out-of-sample windows | Most out-of-sample windows are positive and settings are stable |
| 3. Simulated trading | Signals match the backtest and fills are within the slippage you assumed |
| 4. Live with one TMF contract | Drawdown and trade count over the live period look like the same period in the backtest |
| 5. Add contracts | Position size comes from account risk and stop distance, not from recent wins |
TMF is the natural first contract because TAIEX futures come in three sizes with the same tick of one index point: TX at NT$200 per point, Mini-TAIEX (MTX) at NT$50 per point and Micro-TAIEX (TMF) at NT$10 per point. One TMF contract lets you check the live record against the backtest at the smallest cost per point. The exchange can change these values; the TAIFEX contract page is the source.
Hypothetical example
An account of NT$500,000 risks 1% per trade, which is NT$5,000. The strategy's stop is 50 points, which on TMF is NT$500 per contract. The account risk allows up to ten TMF contracts, but the live record starts with one. After the live drawdown and trade count have matched the backtest for a meaningful number of trades, size moves up in steps toward the risk-based number, never past it.
What do beginners on forums get wrong about 程式交易?
The repeated mistakes on forums such as PTT are testing without costs, filling on the same bar as the signal, tuning until the curve is smooth, testing day-session data for a full-session strategy, trusting a shared backtest without its settings, and going live at full size. Each one has a specific fix, and each fix is a setting or a habit, not a secret.
| Mistake | Why it misleads | Fix |
|---|---|---|
| No costs in the backtest | Favours rules that trade often with small moves, which are the first to lose after fees | Fees and slippage in every run, from the first run |
| Signal and fill on the same bar | Uses a close price the order could not have reached; the result is inflated on every trade | Next-bar execution |
| Tuning until the curve is smooth | Smoothness on in-sample data is a sign of fit, not of edge | Out-of-sample and walk-forward checks before any judgment |
| Day-session data for a strategy that holds overnight | Night-session moves and stop hits never appear; the backtest jumps from 13:45 to 08:45 | Full-session data for any rule that holds past the day close |
| Copying a shared backtest without its settings | Without the session, costs, data source and execution setting, the picture cannot be reproduced | Rerun the rule with your own session, costs and data before trusting it |
| Going live at full size | The first live weeks test the connection and the fills, not the edge; a plumbing error at full size is expensive | Simulated trading, then one TMF contract |
A shared equity curve is the most common trap, because it looks like evidence. A curve without the session, the cost settings, the data source and the execution setting is a drawing. Ask for all four, or rebuild the rule yourself and run it on your own data. If the result survives your settings, you have learned something; if it does not, you have saved the cost of finding out live. The equity, drawdown and trades behind a result are laid out in AlphaPrime's performance report, so a curve you rebuild comes with the detail a screenshot lacks.
What this means if you use AlphaPrime: the session, fees, slippage and next-bar execution are settings in the research, so each generated candidate is already tested the way the live strategy would trade, and the exported source code carries the same rule to the platform your broker supports.
Frequently asked questions
Do I need to know how to code to start 程式交易?
No. A strategy generator lets you choose indicators, parameter ranges and entry and exit types as settings, and it produces the rules and the source code for you. You still need to understand what each setting means, especially session, costs and execution timing, because those decide whether the backtest reflects anything you could trade.
Which 程式交易 software should I use for TAIEX futures?
Start from your broker, not from the software. Ask which platforms the broker's API supports, then choose a platform from that list, and choose research tools that can export strategy code to it. Before paying for any piece, confirm it runs on the data resolution and session you need.
How long should I paper trade before going live?
Long enough to see that the platform produces the same signals as the backtest and that fills land within the slippage you assumed. For an intraday rule that trades most days, a few weeks usually gives enough trades to check this. The goal is to confirm the connection and the fill assumptions, not to prove the edge.
Can I use a strategy posted on PTT or another forum?
Only after you rebuild it with your own session, costs, data and next-bar execution. A posted equity curve without those settings cannot be checked. If the rule still shows an average trade clearly above the round-trip cost on your data, then run the out-of-sample and walk-forward checks before you trade it.
Why start with Micro-TAIEX futures (TMF) rather than TX?
TMF has the smallest value per point of the three TAIEX futures sizes, so the first live weeks, which mainly test the connection and the fills, cost the least per mistake. Once the live drawdown and trade count match the backtest, size can move up based on account risk and stop distance.
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.

