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.
“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.
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.
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 ↓Write your rule like a set of instructions that someone else can follow and check without guessing what you meant.
This example follows a single fictional asset, A. If you study a group of assets, specify how assets enter and leave that group.
After each close, we use the closing prices available through that day. Tomorrow’s prices are still unknown.
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.
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.
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.
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.
“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.
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.
The last three days are Days 2, 3, and 4. The display rounds to two decimal places, but the signal uses the unrounded average.
The opening price is 103. This is a separate fictional input, independent of the Day 4 prices.
The demo assumes the entire buy order fills at the opening price with no fees. In a real trade, check the order and fills for the price, quantity, and fees. A signal alone does not guarantee a fill.
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.
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.
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.
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.
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 ↗
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.
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.
Your current selections appear here, including any that still need revisions.
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.
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? →