A good rule set answers every question the machine will ask: which bar the data is taken from, what happens on a tie, what happens if the market gaps through the level, what happens when two signals fire at once, and what happens when data is missing.
Ambiguity is where look-ahead-bias gets in. A rule that says buy at the day's low is unambiguous only in hindsight. A rule that says place a buy limit-order at yesterday's low, valid for today, is executable.
Write the rule set before the code and keep it in version control next to the code. When live results and the backtesting disagree, the first thing you check is whether the code still matches the words.
Related: trading-system, look-ahead-bias