Quantitative Trading BasicsFoundations · Lesson 1
Course home
Quantitative Trading / From an idea to a testable rule

What Does Quantitative Trading Do?

“The price has been up lately. Should I buy a little?”
That’s one way a trading idea can start. Next, turn “up lately” and “a little” into conditions others can understand, calculate, and check.

For beginners25–35 minutes including practiceNo coding required
From an idea to a research process
  1. Observe the dataWhat was known at the time?
  2. Generate a signalWas the condition met?
  3. Plan a tradeWhen and how much?
  4. Evaluate the resultCosts, losses, and comparison

In this course, quantitative trading means using data and explicit rules to make trading decisions and then evaluating the results systematically. Start with pencil and paper or a spreadsheet. Code helps you repeat the same process at scale.

“The price has been up lately” still needs a definition. Does “lately” mean three days or three months? How large a gain counts? “Buy a little” still leaves out the quantity, timing, and exit condition. Fill in those details to turn the idea into a rule you can study.

By the end of this lesson, you can

  1. Break down the processDistinguish data, signals, positions, and execution.
  2. Keep events in orderIdentify which information was available at the decision time.
  3. Write a rule cardSet out each step and explain how someone else can check the result.

All assets, prices, and rules in this lesson are fictional and illustrate the research process. The time estimate has yet to be tested with learners.

Break down the rule ↓
02
Concepts · About 5 minutes

Six questions every rule should answer

Write your rule like a set of instructions that someone else can follow and check without guessing what you meant.

01 / Asset

What are you evaluating?

This example follows a single fictional asset, A. If you study a group of assets, specify how assets enter and leave that group.

02 / Data

What was known at the time?

After each close, we use the closing prices available through that day. Tomorrow’s prices are still unknown.

03 / Signal

What triggers the signal?

The rule checks whether today’s close is above the average of the last three closing prices. The signal tells you whether the condition is met. The trade size is decided separately.

04 / Position size

How much will you hold?

We hold at most 10 units, use no borrowed money, and skip the purchase if cash is insufficient. Different quantities produce different gains or losses from the same signal.

05 / Execution and exit

When and how will you act?

If the condition is met, the rule attempts to buy at the next trading day’s open. Specify when to exit, what happens if an order fails to fill, and whether to buy when you already hold a position.

06 / Evaluation

How will you check the result?

Choose the test period in advance. Record the return, costs, and losses along the way. Then compare with simply holding the asset over the same period. That comparison is your benchmark.

See how the four terms fit together

“A closing price of 104” is the data. “104 is above the three-day average” is the signal. “Hold no more than 10 units” sets the position size. “Attempt to buy at the next open” specifies execution.

03
Demo and guided practice · About 8 minutes

Use only information available at the time

The practice account starts with 2,000 yuan in cash and no position. The rule checks for a signal after the Day 4 close. If that closing price is strictly above the three-day average, including Day 4, plan to buy 10 units on the next trading day. Otherwise, skip the purchase.

It’s now just after the Day 4 close

  1. Day 1100Outside the three-day window
  2. Day 2102Included in the average
  3. Day 3101Included in the average
  4. Day 4104Included in the average

The last three days are Days 2, 3, and 4. The display rounds to two decimal places, but the signal uses the unrounded average.

Calculate by hand using 100, 102, 101, and 104

Use these fixed prices regardless of the scenario above. Find the last three days’ average, then work out the cost of buying 10 units at 103 on Day 5.

Specify exits and exceptions

If you buy at the Day 5 open, hold through trading Days 5, 6, and 7 and plan to sell the entire position at the Day 8 open. Skip additional buys while holding a position. Cancel a buy order that fails to fill at the scheduled open. Skip purchases if cash is insufficient or price data is missing. If the exit order fails to fill, keep the position and try again at the next trading day’s open.

This lesson follows one signal through the purchase. The Day 8 fill price is unknown, so the full profit or loss is still unknown. The inputs are chosen so you can reproduce the example.

04
Evidence and limits · About 4 minutes

A clear rule still needs evidence

This example shows which days enter the average, when the signal appears, and which price is used for the buy. To decide whether to use the rule, you’ll need more evidence.

Reproducibility lets others check the process

Someone using the same data, rule, and execution assumptions should be able to reproduce your calculations. Record the random settings for any randomized steps. Actual fills depend on the prices and quantities available at the time.

A backtest simulates historical trades under assumptions

Apply the rule to past data and simulate each action in chronological order. A backtest shows how a rule would have performed in that period under those assumptions. Future results can differ.CFA Institute on backtesting and simulation ↗

A positive final result raises more questions. How far did the account fall along the way? How would a simple holding strategy have done? What remains after costs? If you revise the rule repeatedly after seeing the results, have you fitted it to this particular period? Later lessons address these questions. Fees reduce returns, so include the costs omitted from this exercise in a real study.SEC overview of investing fees ↗

Start by hand, then use a spreadsheet, then code

Let tools repeat a process you already understand. Even if AI helps write the code, check a few rows yourself. Did it use future data, buy on the wrong day, or add to the position twice? A smooth chart can hide these errors.

05
Independent practice · About 10 minutes

Turn a vague idea into a rule card

“If an asset has risen a lot lately, I’ll buy a little and sell once I make money.”

For each item, choose the version with clear conditions and a sensible sequence of events. The automatic check covers only the options shown. Focus on the logic behind the numbers. Passing the checks gives you no evidence about the rule’s performance.

0 / 8 items checked

View my current rule card

Your current selections appear here, including any that still need revisions.

    Show the self-check criteria

    Your answer should put the complete data first, the signal second, and execution third. Explain why the fill price needs a basis in actual execution. Once the rule is clear, check costs, losses, the benchmark, and performance with other data. This response is for self-review.

    Your answers stay on this page. Export them before refreshing or closing the tab. The file stays on your device.

    06
    Recap

    Write a rule someone else can check

    For any trading idea, ask what you’re trading, which data to use, what triggers a signal, how much to hold, how to trade and exit, and how to evaluate it. Add instructions for missing data, unfilled orders, and existing positions.

    The next lesson looks at what you hold when you buy a stock, bond, fund, crypto asset, or derivative. Knowing what you’re trading helps you decide what to record.

    Lesson 2 · What Do You Own After You Buy? →