Skip to content

Module 00 · Lesson 4 of 4 (00.4)

The quant workflow: idea → rules → test → validate → run

Beginner12 minDraft — under review

The five stages of building a trading system, what each stage produces, the question that decides whether an idea moves on, and where each stage is covered in this course.

Before this lesson: The edge equation: expectancy as the core idea

In this lesson you will

  • Name the five stages of the quant workflow and what each one produces.
  • State the question that decides whether an idea moves from one stage to the next.
  • Write a simple rule specification before any testing begins.
  • Map each stage to the modules of this course and the SCUTA Quant Lab.

The previous lessons covered what quant traders do, what you bring from discretionary trading, and the number they are all trying to estimate. This lesson puts those pieces in order. Systematic trading follows a workflow with five stages. Each stage produces something specific, and each ends with a question that decides whether the idea moves on or stops.

The five stages

1. Idea

An idea is a specific belief about market behaviour that could be true or false. "Stocks that gap down on no news tend to recover part of the gap within a week" is an idea. "I want to trade momentum" is a direction, not yet an idea.

Output: a one-sentence hypothesis and a reason to believe it, such as an economic explanation, a behavioural one, or a pattern you have observed repeatedly.

Gate: can it be stated precisely enough to test, and is there a reason it might work other than "it looked good on a chart"?

2. Rules

The idea becomes a complete set of rules: what to trade, when to enter, when to exit, how much to risk, and what it costs. Nothing is left to judgement.

Output: a written specification, dated, before any test is run. Here is a template:

rule-spec.txtText
Name:          Pullback in an uptrend (v1)
Date written:  before any testing
Hypothesis:    Short pullbacks within an established uptrend tend to recover.
Universe:      Daily bars, liquid instruments only, defined list fixed in advance
Entry:         50-day average above 200-day average AND 2-period RSI below 10,
               enter at the next day's open
Exit:          Close above the 5-day average, or after 10 trading days
Stop:          2 x average true range below entry
Risk:          0.5% of the account per trade
Costs:         Spread and commission per trade, plus slippage on entry and exit
Reject if:     Expectancy after costs is not positive on out-of-sample data,
               or results depend on one narrow parameter choice

Gate: could someone else run these rules from the page and get the same trades?

3. Test

The rules run over historical data, bar by bar, recording every trade they would have taken. This is a backtest. It needs clean data, realistic costs, and strict care that each decision uses only information available at that moment. Using information from the future, even by accident, is called look-ahead bias; Module 01 shows the simplest version of it in a few lines of code.

Output: a trade list, an equity curve, expectancy after costs, maximum drawdown and other statistics.

Gate: is expectancy positive after costs, with a drawdown you could actually sit through?

4. Validate

A good test result is a claim, not a fact. Validation tries to break it. Does the result hold on data the rules were not designed on? Does it survive small changes to the parameters, or does it collapse if 50 becomes 45? How much of it could be luck? This is where overfitting is caught.

Output: an honest judgement of how much the test result can be trusted, and a realistic range for what to expect.

Gate: does the edge survive data it has never seen and reasonable variations of its rules?

5. Run

A validated system is run, first on paper or with very small size, then with the risk the specification allows. Running is active work: checking that live trades match what the rules should have done, comparing live results with the range validation suggested, and deciding in advance what would make you stop.

Output: live results, monitored and reviewed against expectations.

Gate: is the live system behaving within the range validation suggested? If not, is the difference noise, a problem with execution, or a sign the edge has changed?

The workflow is a filter

Most ideas do not make it through. Many fail at the test stage, and many of the survivors fail validation. That can feel discouraging, but it is the workflow doing its job. A rejected idea costs time; an untested one that reaches live trading costs money.

The workflow also loops. A failed validation often suggests a better question, which becomes a new idea. Live monitoring may show that costs are higher than assumed, which sends you back to the rules. Over time, the data handling, code and reports you build make each loop faster.

How the course follows the workflow

The eleven modules of this course map onto the five stages. Some modules serve more than one.

StageWhat you needModules
IdeaA testable hypothesis and a sense of what an edge means00 From Discretion to Rules, 03 Statistics That Matter
RulesA complete, written specification04 Turning a Setup into Rules
TestCode, clean data and an honest backtest01 Python for Traders, 02 Market Data and Its Traps, 05 Backtesting Honestly
ValidateTools for separating signal from luck06 Validation: Walk-Forward, Monte Carlo, Overfitting, 03 Statistics That Matter
RunSizing, execution and live monitoring07 Risk and Portfolio, 08 Execution and Broker APIs, 09 Going Live
All fiveOne idea taken from start to finish10 Capstone

Module 01, next, gives you the basic tools: Python and pandas, used on price data. It is the foundation for testing, which is why it comes before the stages that rely on it.

Where the Lab fits

The SCUTA Quant Lab is planned as a place to run the exercises from each lesson without setting up anything locally. It is not open yet. Until it is, every exercise in this course can be done on your own computer with the setup from Module 01, and each lesson's Lab card describes the exercise in full.

Before you move on

You now have the whole map: what the work is, what you already bring, the number you are trying to estimate, and the order in which to do it. The rest of the course fills in each stage with practical tools, starting with code.

Key takeaways

  • The workflow runs idea, rules, test, validate, run, and each stage has a clear output and a clear gate.
  • Writing the rules down before testing is what makes the test mean anything.
  • Most ideas should fail at the test or validation stage. That is the workflow protecting your capital, not a sign that you are doing it wrong.
  • Running a system is a stage with its own work, monitoring live results against what testing suggested.
  • Every module in this course maps onto one or more of the five stages.

Lab exercise

Write a one-page rule specification

Using the template in this lesson, write a full specification for one simple idea, such as the pullback rule from Lesson 2 or a moving-average rule. Fill in every field, including costs and what would make you reject the idea. Date it and keep it. In Module 05 you will test an idea like this, and the specification is what keeps the test honest.

Lab coming soon

Until the Lab opens, run the exercise in your own environment from Module 01.

Self-check

Answer in your own words first, then reveal the answer.

  1. 01Why should the rule specification be written before any testing?

    Show answer

    If the rules are adjusted after seeing results, the test measures how well you can fit the past rather than whether the idea works. A written, dated specification makes it clear which version was tested and prevents quiet changes.

  2. 02What is the difference between the test stage and the validate stage?

    Show answer

    Testing runs the rules over historical data to estimate how they would have behaved. Validation asks whether that estimate is trustworthy, for example by checking data the rules were not designed on, varying parameters, and examining how much of the result could be luck.

  3. 03An idea fails validation after weeks of work. Was the work wasted?

    Show answer

    No. Rejecting an idea before it reaches real money is one of the main purposes of the workflow. You also keep the data handling, code and lessons learned, which make the next idea faster to evaluate.

Finished the lesson, the Lab exercise and the self-check?

Glossary terms in this lesson

Related Academy articles

Educational material only. Examples use synthetic data and are not investment advice or a forecast of results.