trend-following

[Trend Following #7] Building a Trend-Following System: Six Rules

How to put stock picks, entry, stop, exit, sizing and exposure caps into one rule table, with an example system, backtest traps and Korean market conditions.

On this page

Diagram of a trend-following trading system in which six rules, from stock selection to the position cap, are linked in sequence

A trading system is not a collection of entry signals. It is a set of rules that fixes, in numbers and in advance, every point in a trade where a judgment call would otherwise be needed. The original document behind Part 3, Turtle Trading also splits a system into six elements and describes entry as only one of them.

This post combines the concepts from the earlier parts into a single rule table. The example system here illustrates the structure; it does not promise any particular stock or return. In fact, half of this post is about the ways such a system gets validated wrongly.

Trend-following series, Part 7. The previous post is Part 6, Key Trend-Following Indicators and the next is Part 8, The Psychology of Trend Following. The series index is in Part 0.

The Six Decisions That Make Up a System

Every trade contains at least six decisions. If even one of them is made on the spur of the moment, that is where the spread in your results comes from.

DecisionWhat to defineWhat goes wrong when it is undefined
Stock selectionWhich stocks make the candidate listYou buy whatever caught your eye that day
EntryUnder what conditions you buyYou buy the same stock at a different point every time
StopWhere you admit you were wrongYou invent the level after the loss has grown
ExitWhen you lock in a gainYou sell in profit based on emotion
SizeHow much you buyYou buy more on days you feel confident
CapHow much total exposure you allowExposure expands without limit in a rising market

The cap is the item people leave out most often. Even when the rules for each trade are well defined, if nothing limits the number of positions held at once or the concentration in one industry, nothing stops the individual stops from triggering together, as covered in Part 4.

An Example System: Filling the Six Items With Numbers

Below is an example that turns the concepts from the earlier parts into concrete numbers for the Korean stock market. Every number is there to illustrate, not a recommended setting.

ItemRuleSource part
Market filterOpen new positions only when the KOSPI (or KOSDAQ) index is above its 200-day moving averagePart 2, the M criterion
CandidatesAverage daily trading value over the last 60 sessions of at least 10 billion wonPart 6, liquidity
CandidatesCurrent price at least 90% of the 52-week highPart 6, new highs
CandidatesSix-month return higher than the index returnPart 6, relative strength
EntryClose above the prior 60-session highPart 3, channel breakout
Entry confirmationTrading value on the breakout day up at least 50% from the 50-day averagePart 6, volume
StopEntry price − (ATR(20) × 2)Part 3, the 2N stop
ExitClose below the prior 20-session lowPart 3, System 2 exit
Size(Account × 1%) ÷ (entry price − stop price)Part 4, position sizing
CapAt most 8 positions at once, at most 2 in the same industryPart 3, unit limits
Drawdown responseWhen the account is 10% below its peak, cut the allowed loss per trade to 0.5%Part 4, cutting size

Notice that the rules interlock. Because the stop width is set by ATR, size automatically responds to volatility, and because there is a cap, exposure stays within a range even when a rising market produces many candidates. Change one rule and the results of the others change with it.

Here it is in numbers. Take a 50 million won account with an allowed loss of 1% per trade, or 500,000 won, an entry price of 30,000 won and an ATR(20) of 900 won. The stop is 30,000 − 1,800 = 28,200 won. The risk per share is 1,800 won, so the size is 500,000 ÷ 1,800 ≈ 277 shares, a position of about 8.31 million won, or roughly 16.6% of the account. Seen together with the cap of 8 positions, this also shows that you need a separate check that theoretical maximum exposure does not exceed the size of the account.

Common Mistakes When Setting the Rules

A few problems come up again and again when people build systems.

First, only the entry conditions get refined. Adding conditions makes the past results look better, but more conditions mean fewer signals and a smaller sample. With a small sample you cannot tell whether a performance difference is luck or skill.

Second, the stop and the exit are treated as the same thing. A stop is the rule for leaving when your judgment was wrong. An exit is the rule for leaving when your judgment was right but the trend has ended. The purposes differ, so the criteria should differ. That is why the example system bases the stop on ATR and the exit on the 20-day low.

Third, the system is validated only on rising markets. A system with a market filter opens no new positions in a falling market, so the test period has to include falling markets before you can see whether the filter actually reduces losses.

Fourth, costs are left out. In Korea, a securities transaction tax is charged on sales and brokerage commissions apply on top. The more often a system trades, the more costs eat into expectancy, so a test that leaves them out will look better than reality.

What Distorts Backtest Results

Testing rules on past data is useful, but unless you avoid a few traps, the test itself creates false confidence.

DistortionWhat it isHow to check
Survivorship biasTesting only on stocks that are listed todayUse data that includes delisted and merged stocks
Look-ahead biasDeciding on the day's close and assuming a fill at the same closeAssume the fill at the next session's open after the signal
OverfittingTuning parameters to fit the pastSplit the data into a development period and a confirmation period
Fill assumptionsAssuming you always get filled at the price you wantInclude slippage and tick size
Missing costsLeaving out taxes and commissionsSubtract the cost of each trade explicitly

Overfitting is the hardest of these to handle. If you nudge the parameters and pick whichever gives the best result, that result reflects a coincidence of one particular period, not the strength of the rules. The practical response is to pick a range of parameter values where performance is not sensitive. If 20 days looks good and 21 days looks bad, the result is hard to trust.

The investor education materials of the US Securities and Exchange Commission also repeatedly state that past performance does not guarantee future results. A backtest is a tool for checking that the rules are logically consistent, not a tool for estimating future returns.

Diagram of a backtest procedure that reduces overfitting by splitting past data into a design period and a validation period

Conditions to Adjust for the Korean Market

When you apply the example system to Korean stocks, you need to define a few more things.

First, the fill method. If a close above the breakout level is the signal, you cannot buy at that same close, so the rule has to say that you fill at the next session's open. This difference has a considerable effect on results for stocks that gap often.

Second, the daily price limit. The Korea Exchange has operated a ±30% daily price limit since June 15, 2015. Near the lower limit, sell orders may not fill, so the stop loss you calculated can differ from what you actually take.

Third, how to respond to a falling market. If you use only a cash account, there is little to do beyond opening no new positions once the market filter blocks you. In that case, record "did not enter" as one of the system's decisions as well, so you can check whether the filter actually worked.

Fourth, the trading value condition. The 10 billion won threshold in the example is an illustration and should change with the size of your account. When the amount you put into a stock exceeds a certain share of that stock's daily trading value, your own order starts to move the price.

Checkpoints for Investors

  • Are all six decisions (selection, entry, stop, exit, size and cap) defined in numbers?
  • Did you set the stop rule and the exit rule on different grounds?
  • Does the test period include falling markets?
  • Did you subtract taxes and commissions as a per-trade cost?
  • Did you assume the signal time and the fill time separately?
  • Do the results hold up when you change the parameters slightly?
  • How many recent trades broke the rules, and why?

Frequently Asked Questions

Q1. If a backtest looks good, will it work in live trading?

It is not guaranteed. A backtest applies the rules to past data, and survivorship bias, overfitting, fill assumptions and missing costs all make it easy for the result to look better than reality.

What to check at the validation stage is not the size of the return but whether the rules contradict each other and whether they are overly sensitive to changes in the parameters.

Key Takeaways

A trading system is not an entry signal. It is a set of rules that settles six decisions in advance.

  • Stock selection, entry, stop, exit, size and cap must all be defined in numbers to make a system.
  • A stop is the rule for leaving when your judgment was wrong, and an exit is the rule for leaving when the trend has ended, so their purposes and criteria differ.
  • The rules interlock, so changing one changes size and exposure with it.
  • Backtests tend to look better than reality because of survivorship bias, overfitting, fill assumptions and missing costs.
  • In Korea, you also need to set the next-session fill assumption, the daily price limit and the order size relative to trading value.

A system's performance shows up less in the rules themselves than in the share of the time the rules were followed. If you record, for each trade, which rule you entered on and which item you departed from, you can tell whether poor results come from the rules or from execution.


References


For reference only: The information in this post is provided for general reference and does not constitute investment advice or a solicitation to trade. Your responsibility: Final investment decisions and their outcomes are entirely your own. No warranty: This information is not guaranteed to be accurate and cannot be used as a basis for legal liability for any investment result.

Trading review workflow

Turn this read into your next trading review

Capture the chart, thesis, mistakes, and next improvement in one review flow so the lesson stays usable.

Start a trading journal

Market context is provided for research and review, not personalized financial advice.