Lesson 13 / From an Idea to a Complete Rule
What is missing from “buy when the price is doing well”?
Turn the Lesson 1 rule card into a specification someone can execute. Apply the timing principles from Lesson 12 to define signals, targets, order quantities, and cash constraints.
What you will learn
- State a hypothesis that evidence could refute
- Distinguish signals, targets, and orders
- Handle ties, missing data, and insufficient cash
Allow about 30–45 minutes. The exercises use fictional data. The page checks structured answers in your browser. Export your work before refreshing.
Start with the concepts ↓Explain why the idea might work
Information may enter prices gradually, allowing a move to continue in the short term. This is a hypothesis to test. Specify the asset universe, observation window, and conditions that could break it.
A good-looking backtest alone supplies little explanation. Start with a minimal rule and use it to check the implementation.
Freeze teaching rule v1
If the close is strictly above the three-period closing average that includes the current close, target 10 units. Otherwise target 0. If there are fewer than three observations or data are missing, issue no new signal and investigate. A tie gives a target of 0.
Set the target after the close. At the next observation's open, trade the target minus the actual holding. If you hold 10 and still target 10, the difference is zero and there is no order. If you hold 4 and target 10, buy 6.
Check that the order is affordable
The exercise uses whole units, without borrowing or short selling. Each completed buy or sell costs a fixed 1 yuan. Cash needed for a buy = quantity × opening price + 1. If cash is insufficient, cancel the entire order.
Real systems need explicit handling for missing data, orders that cannot fill at the open, and partial fills. This lab assumes complete fills for orders that pass the cash check. Use actual fill quantities when updating positions.
Specify exits and evaluation in advance
A close at or below the average sets the target to 0. This defines the exit up front. If the last close generates a signal with no following open, record it as an unexecuted plan.
Freeze the benchmark, costs, and evaluation criteria, and save the version. Lesson 17 executes the same v1 rule day by day. Lessons 14–16 study other strategy ideas separately.
From an Idea to a Complete Rule experiment
You hold 4 units. The closes are 100, 102, 103, and the next open is 104. Calculate the average, target, and difference by hand. Then reduce cash below the amount required and compare the signal with the execution result.
The first two closes are 100 and 102. Adjust the third close. The next open is 104. Each completed order costs 1 yuan, and an order with insufficient cash is canceled in full. The inputs describe independent fictional account states.
Points follow the order in the example. See the table for exact values.
Try the calculations
Use the values in each question. Enter amounts and percentages in the requested units, including a minus sign where needed.
Explain your reasoning
Lesson work
Begin the complete strategy specification for Stage 4.
Freeze the strategy rules
The last three closing prices are 100, 102 and 103. Version 1 targets 10 units when the current close is strictly above the three-period average. You currently hold 4 units and have 700 in cash. The next open is 104, and each filled buy order costs 1.
Complete the questions below before trying the optional writing exercise. Use the fixed inputs here, even if you changed the experiment above. Enter numbers in the units shown and keep at least two decimal places where needed. Follow the specified precision for tables. You can check one answer at a time or all answers together.
Save your homework to export these results. Check again after changing an answer. Optional writing and self-assessment are ungraded. Save your work before refreshing.
Optional writing (ungraded)
Writing guidance and self-review
Record the inputs, rules, results and open questions in each field. You can cite the earlier calculations and experiments as fictional examples. Tie each conclusion to specific data or events.
Use the checklist to review your own writing. Use evidence from the study to evaluate the strategy.
Save the experiment, the run log, your first and current checks, written work and self-review. Export before refreshing or closing the page.