A Computer Can't 'Buy the Dip'
Tell a friend to "buy the dip and sell the bounce" and they'll roughly know what you mean. Tell a computer the same thing and it just stares back. A machine has no common sense to fill in the blanks: it doesn't know which stocks count, how big a drop is a "dip," how much to buy, or when to look. In the last lesson we saw that strategy rules are box three of the algorithm — the part that turns an idea into an intended order. This lesson is about writing what goes inside that box.
The rule is simple and a little unforgiving: if a word in your strategy isn't defined, the computer can't use it. A vague idea doesn't just run poorly — it can't run at all, and worse, it can't be checked. Turning a strategy into rules is really the work of arguing with yourself until every fuzzy word has a number or a condition behind it.
The core translation
A strategy is a hunch in plain English. A rule set is that same hunch with every blank filled in — exact enough that a computer, following it literally, would place the same trades you pictured. The gap between the two is where most of the real work lives.
The Five Questions Every Rule Set Must Answer
However fancy or plain a strategy is, it isn't complete until it answers the same five questions. Miss one and there's a hole the computer can't cross:

- Universe — which assets? The menu the system is even allowed to touch. "Stocks" isn't enough; "the 100 largest U.S. stocks" is a list a computer can hold.
- Entry — the exact condition to open a trade. A precise trigger that's either true or false at any moment, with no judgment call in between.
- Exit — the exact condition(s) to close. Usually one or more of: a target (it reached the goal), a stop-loss (it fell too far), or a time limit (enough days passed). Something has to end every trade.
- Position size — how much? How many shares, or what slice of the account, goes into each trade. This is the dial that controls risk, and it's the one beginners most often leave blank.
- Timing / frequency — when does it check and act? Once a day after the close? Every minute? The answer decides how often the system even looks at its own rules.
Notice that none of these ask whether the idea is any good. They only ask whether it's fully specified. A brilliant strategy with a blank in it can't be run; a mediocre one that answers all five at least can be tested. Specification comes first.
Your Turn: Pin Down 'Buy Dips' Yourself
Now you play the pedant. We'll take the fuzziest idea there is — "buy stocks when they dip and sell when they bounce" — and drag it, one question at a time, into something a computer could actually follow. For each blank, spot the fuzzy word first, then pin it to a number or a true-or-false condition. (Every number below is illustrative only, picked to make the exercise readable — not a suggestion, and past behavior of any such rule wouldn't predict its future.)
The sentence you're about to specify
"Buy stocks when they dip and sell when they bounce." Read it once and it sounds finished. Read it the way a computer must and nearly every word is a hole: which stocks, how big a dip, how far a bounce, how much, and when to even look. Five blanks — let's fill them in, one step at a time.
Blank 1 — "stocks": which ones count?
"Stocks" feels obvious, but it isn't a list a machine can hold — there are thousands of them. Ask yourself: the system is allowed to touch which names, exactly? Pin it to something finite and checkable — the 100 largest U.S. stocks by market value. That's your universe; anything off the list can never be traded.
Blank 2 — "a dip": how far down, measured against what?
"When they dip" hides three questions at once: down from what, by how much, over what window? Collapse them into one condition that's simply true or false each day — price closes 5% or more below its 20-day moving average. No mood, no eyeballing, just a number the computer can check the same way every time.
Blank 3 — "a bounce": and what if it never comes?
"Sell when they bounce" quietly forgets the trade that just keeps sinking. Give the exit a goal and a backstop — price returns to the 20-day moving average, OR 10 trading days pass, whichever comes first. A target, a time limit, or a stop-loss: something has to end every trade so none can hang open forever.
Blank 4 — the word the idea forgot: how much?
Read the original sentence again — it never says how much to buy. Most vague ideas skip it. But a computer can't place "some" shares; it needs a size. Pin it — a fixed 2% of the account on each trade. This is the dial that controls risk, which is exactly why leaving it blank is the beginner's most expensive omission.
Blank 5 — the other forgotten word: when does it look?
The idea also never says when the system checks its own rules. Every minute? Once a day? You have to decide, because it sets how often the strategy even runs — check once per day, after the market closes. Fill that in and every blank is now closed.
Step back and look at what your five answers changed. "When they bounce" became two exact exits with a tie-breaker, so a trade can never hang open forever. "Stocks" became a fixed list. And the two blanks the original idea forgot entirely — size and timing — got answered, because the computer would have refused to trade without them. The idea didn't get smarter; it got complete.
Why 'Testable' Beats 'Clever'
Here's the payoff for all that pedantry. Because every rule is now exact, you can run it against years of past prices and see how it would have behaved — that's backtesting, the subject of the next few lessons. You can also audit it: two people reading the rules would place the identical trades, with nothing left to interpretation. A vague idea offers neither. "Buy when it's cheap" can't be backtested because no two runs would agree on what "cheap" means.
Precision ≠ profit
Pinning down every rule makes a strategy checkable, not profitable. A fully specified bad idea is still a bad idea — you can just now measure exactly how bad. Precision is the price of admission to testing; it isn't an edge on its own. Keep the two ideas separate and you'll avoid a trap that fools a lot of beginners.
The Ambiguity Trap
The sneakiest failure isn't a missing rule — it's a rule left half-vague on purpose. Say the entry reads "buy when it's oversold" without defining oversold. Now, every day, a human has to step in and decide what counts. And the moment a person is deciding in the moment again, all the emotion automation was meant to remove — the fear, the hope, the second-guessing — walks straight back in through that unlocked door.
That's why the goal isn't just "mostly defined." A rule with a soft spot invites the human to quietly override the system, and an overridden system isn't really automated — it's a person trading with extra steps. If you find yourself unable to pin a rule down to something true-or-false, that's usually a sign the idea itself is still too fuzzy to trust, not that the computer is being difficult.
Educational use only
Educational content only. StockCram isn't a broker or adviser, and we have no affiliation with any institution or tool we mention. Nothing here is a recommendation to trade in any particular way.
