System builder
Building a system
A system is a hypothesis you froze into rules: what you trade, when you enter, when you are wrong, how much you lose, and when you quit the idea. If any of those is missing, you have a story.
On this page
This is the page people skip because it has no arrows. It is the page that decides whether the arrows can hurt you. Work it with the desk open. The calculators exist so the arithmetic stays honest while you think.
Section 01
One sentence, then the rules
Write the idea in one sentence a skeptical friend can understand. A usable shape is: in this market, on this time frame, when this observable thing happens, price has tended to do that other thing over this many bars, by enough to pay the costs. If you cannot say "tended" and you say "will," you are not ready to test anything.
- Market and session. Name the instrument and the hours you are allowed to trade. A rule that requires you to watch the open while you are asleep is not a rule. It is a wish.
- Setup. The condition that makes a bar eligible. Two people using your words should mark the same bars.
- Entry. The order type and the price that puts you in. Include what you do if you are not filled.
- Invalidation. The price that means the idea is wrong. Place it for the idea, then size the trade so that price is a loss you can repeat.
- Exit. A target, a trail, a time stop, or an opposite signal. One primary exit. A backup for when the market gaps is part of the exit, not a mood.
- Size. The fraction of equity at risk on the idea, and a cap on how many related ideas you will hold. Five positions that fall together are one position.
- Filter. The condition that keeps you out. News, a dead session, a market that is too quiet or too wild for the idea. Filters are part of the system. Adding one after a loss, and deleting it after a win, is not.
Section 02
Expectancy is the scoreboard
In R, which keeps trades comparable
Expectancy = (win rate × average win in R) − (loss rate × average loss in R)
Write the average loss as a positive number of R. A worked example: 40 wins and 60 losses in every 100 trades, average win 2R, average loss 1R. Expectancy = 0.40 × 2 − 0.60 × 1 = 0.20R per trade. Over 100 perfect repeats that is +20R before costs. Markets do not give perfect repeats. Costs, slippage, and a change in regime can eat 0.20R and then some.
Profit factor is gross winning R divided by gross losing R. In the example, 80 divided by 60 is about 1.33. A profit factor barely above 1 will not survive sloppy fills. Reward-to-risk is the planned gain divided by the planned loss on a single trade. It is not expectancy. A beautiful 3-to-1 plan with a tiny win rate is a losing system. A modest 1-to-1 plan with a high enough win rate can be a winning one. You need both numbers.
Section 03
Size is the part you control
You do not control whether the next trade wins. You control how much a planned loss costs. The desk divides cash at risk by the distance to the stop. Round down. If the formula says you cannot afford one unit without breaking your cap, the trade is too wide for your account. The grown-up answer is to skip it, not to pretend the stop is closer.
Kelly's formula applies to a bet that pays W units of profit for each 1 unit risked. Full Kelly is the win rate minus the loss rate divided by W. Read that as win rate, minus (loss rate ÷ W). It is not (win rate minus loss rate) divided by W. The formula assumes you know the odds, and that each bet is independent and identical. You do not know the odds, and markets change their mind. Full Kelly is a fast way to feel clever and then feel broke. People who use the idea at all usually take a small fraction of it, and they still keep a hard cap per trade. Treat Kelly as a warning about overbetting, not as a dial to twist.
Section 04
How a test fools you
- Lookahead. Using information that was not available at the time, such as a day's high in a rule that is supposed to trade at the open, or an indicator that was recalculated with future bars.
- Overfitting. Tuning lengths and filters until the past looks wonderful. The past has been fitted, not predicted. A simple rule that survives a market you did not tune on is worth more than a clever rule that only works on the sample you stared at.
- Survivorship. Testing today's list of stocks, or today's list of winning traders, and forgetting the names that died or stopped publishing. The graveyard is part of the sample.
- Costs. A backtest that fills at the close of the signal bar, with no spread, is advertising. Put in a pessimistic fill. If the idea dies, it was never yours.
- One regime. A trend rule tested only on a roaring bull market has not met a range. Include the years that would have bored you or hurt you.
The honest sequence is: freeze the rules, test them on data you did not peek at, then trade them small, or on paper, while you find out whether you can follow them. Paper trading misses real slippage and real fear. It still catches the rules you cannot define. Live size comes last, and it comes small.
Section 05
The journal is part of the system
For each trade record the date, the setup name, the planned R, the actual R, whether you followed the rule, and one sentence on what you did. Screenshot the chart at entry if you can. The desk journal stores actual R and a followed-or-not flag in this browser, and it scores the followed trades apart from the rest. It will not nag you, and it will not recover a deleted browser. Copy the summary somewhere durable if the record matters.
Separate two questions that feel like one. Did the system work? Did you follow it? A loss taken on the rule is tuition. A win taken off the rule is poison, because it trains you to break the rule. Count them apart.
Section 06
Write the kill switch now
Decide what evidence would make you stop. Examples that are allowed, if you choose them in advance: a peak-to-trough drawdown of a stated number of R, or a run of trades long enough that the live expectancy is negative after costs and clearly worse than the test. Examples that are not allowed: "I am annoyed," "a stranger online is confident," "I will just average this one." Stopping is a rule. Revenge is the absence of one.
Check yourself
You risk 1R to seek 3R, and you win 20 percent of trades. Losses are 1R. What is the expectancy, before costs?