Skip to content
Market Analysis Course / Module 5: Statistics, system design and testing / Lesson 5.336 of 61
Fundamental & technical analysis · Advanced

Building a rules-based trading system

The parts of a complete trading system: universe, setup, entry, exit, position sizing and filters, with a worked example written as testable rules. Lesson 5.3 of the BlockWest Market Analysis Course.

BlockWest Editorial Desk·Updated December 1, 2026·3 min read·Educational, not investment advice

Key takeaways

  • A trading system is a written set of rules that anyone could apply the same way.
  • A complete system covers universe, setup, entry, exit, position sizing and filters.
  • Exits and sizing usually matter more to results than the entry signal.
  • Simple, testable rules beat clever, vague ones.

BlockWest Market Analysis Course · Module 5: Statistics, system design and testing · Lesson 5.3

Why write rules down

The “selection and decision making” and “system testing” topics in the professional curriculum both start from the same point: you cannot evaluate a method you cannot state precisely. Written rules let you test, review and improve; they also protect you from the biases covered in Module 6.

The six components

Component Question it answers Example
Universe What can I trade? Top 20 crypto assets by market cap with $50M+ daily volume
Setup When is the market ready? Price above a rising 200-day average
Entry What exactly triggers a trade? Daily close above the 20-day high
Exit Where am I wrong, and how do I take profit? Initial stop 2 x ATR; trail at the 20-day low
Position sizing How much? Risk 0.5% of equity per trade
Filters When do I stand aside? No new trades if BTC is below its 200-day average or funding is extreme

Rules of thumb for good rules

  • Unambiguous: use closes, levels and indicator values, not adjectives.
  • Few parameters: every extra setting is another chance to fit the past (Lesson 5.4).
  • Economic logic: know why the edge should exist, for example trend persistence or forced selling.
  • Portfolio limits: cap total risk and correlated positions (Module 8).
  • Operational rules: when you check signals, how you place orders, what you do on exchange outages.

Worked example: a written system

Illustrative only. Universe: BTC, ETH, SOL. Filter: trade only when BTC closes above its 200-day SMA. Entry: buy at the next open after a daily close above the 20-day high. Initial stop: 2.5 x 20-day ATR below entry. Trailing exit: sell on a daily close below the 10-day low. Sizing: risk 0.5% of equity based on the initial stop; maximum three positions. Each line can be checked on a chart by anyone. That is what makes it testable.

Discretion inside a framework

Fully mechanical systems are not the only option. Many discretionary traders fix the parts that protect them (sizing, stops, maximum risk) and keep judgment for setup selection. Writing the framework down still matters, because it lets you check whether your discretion is adding value.

Checklist: system design

  • Can each rule be applied identically by someone else?
  • Are all six components defined?
  • Do you know why the edge should exist?
  • Have you counted your parameters?

Key terms

  • Trading system: a complete written set of trading rules
  • Universe: the list of tradable assets
  • Filter: a condition that blocks new trades
  • Parameter: an adjustable setting such as a lookback length

Sources and further reading

Education only. Nothing in this course is investment advice or a recommendation to buy or sell any asset. Examples are illustrative.

Next: Lesson 5.4: Backtesting without fooling yourself

Frequently asked questions

Do I need to code to build a system?

No. A system is a written set of unambiguous rules. Coding it, for example in TradingView’s Pine Script or Python, makes testing easier, but you can test simple rules by hand on charts.

What makes a rule testable?

Two people applying it to the same chart would reach the same decision. "Buy strong breakouts" is not testable; "buy when the daily close exceeds the 55-day high and volume is above its 20-day average" is.

Is discretionary trading wrong?

No. Many professionals trade with discretion. But discretion works best inside a written framework, with the parts you can define, such as risk and exits, fixed in advance.

This explainer is reviewed and updated as the rules and the market change. Last reviewed December 1, 2026. It is educational content and not financial, legal or tax advice.

Continue the course

Then

  1. 5.5Measuring performance: expectancy, Sharpe ratio, drawdown and profit factor
  2. 5.6The trading journal and post-trade review
  3. 6.1Cognitive biases in investing: loss aversion, anchoring and confirmation bias

All 61 lessons and your progress →