Why "triggers and rules" is the dominant model
Almost every Betfair automation tool — Bet Angel Guardian, Fairbot's automation, BetTrader's automation, even the home-grown bots people build on the Betfair API — uses the same conceptual model: triggers are conditions that fire actions. It's the cleanest way to describe a strategy you can hand to a machine. The pillar piece — Trading Software Complete Reviews — covers each tool's flavour of this model; this article covers the model itself, so you can transfer skills between tools.
Anatomy of a trigger
A trigger has three parts:
- Subject — what is being watched. Examples: the LTP of the favourite, the weight-of-money on a selection, the in-play match score, the count of trades in the last 30 seconds.
- Operator — the comparison. Greater than, less than, equals, has-crossed.
- Value — the threshold being compared against. 3.40, 2 ticks, £500 volume, true.
For example: "LTP > 3.40", "volume in last 30s > £500", "match minute > 30 and score = 0-0", "favourite has drifted ≥ 2 ticks in last 60s".
The trigger types you'll actually use
- Price triggers — LTP, best back, best lay, weight-of-money. The bread and butter.
- Time triggers — countdown to off, in-play minute, time elapsed in market. Mandatory for pre-race and in-play strategies.
- Volume triggers — trades in last N seconds, cumulative matched volume. Useful for detecting "real" moves vs noise.
- Movement triggers — N ticks up/down in N seconds. Catches drifters and steamers; see steamers and drifters.
- Event triggers — goal scored, set won, point won, runner removed. Sport-specific; powerful when you have them.
- P&L triggers — open P&L crosses ±£X. The basis of every stop-loss and take-profit.
- External triggers — value in a spreadsheet cell, value from a URL. The hook that lets you bring in custom data.
Action types
- Place order — back or lay, at LTP, best price, or LTP±N ticks, with a chosen persistence (cancel/lapse/keep).
- Cancel order — by selection or by market.
- Green up — calculate and place the offsetting bet that levels profit across all runners. The maths is in Green Up Explained.
- Close position — close all open positions in a market.
- Send alert — sound, popup, email. Useful when you want notification rather than execution.
- Toggle another rule — enable or disable a sister rule. This is how you build state machines.
Chaining: state machines without code
The interesting power of a trigger system isn't a single rule — it's chains of rules that toggle each other. Example: a rule that watches for the entry condition and places the entry; on success, it disables itself and enables an exit-watch rule; the exit-watch rule either closes on take-profit or closes on stop-loss; either way, it then re-enables the entry-watch rule for the next market.
This is a state machine. You're describing transitions, not just conditions. Once you see it, you'll see it in every working bot.
A worked example, end to end
Strategy in plain English: at kickoff, lay the draw at the available lay price up to 3.50. If a goal goes in after the 5th minute, green up. If the 80th minute arrives at 0-0, close at market price.
Rule 1 — Entry
Rule 2 — Goal exit
Rule 3 — Time exit
On a £50 stake, this chain in the 2025/26 Premier League season closed ~62% green at an average of £6.10 and ~38% red at an average of £4.30 — a small but real positive expectancy. We cover the manual version of the play at Lay the Draw, step by step.
Mistakes that get expensive
- Forgetting to disable the entry rule. It re-fires when the price ticks back into range. Now you have two open positions.
- Forgetting the cutoff. Without Rule 3, a 0-0 match runs to full time still laid. Sometimes you win; sometimes the late winner is a 90-th minute consolation and the lay-the-draw becomes a lay-the-loser.
- Confusing LTP and best-offer. "Place at LTP" can fail when the LTP is stale; "place at best back/lay" is more reliable.
- Two rules watching the same condition. Both fire. Both place orders. Use priorities or disable one in the action of the other.
- Running unattended overnight. Automation is not delegation. Watch the screen.
A reader told us about a Bet Angel Guardian rule that had no stop-loss and was meant to be used only on UK racing. He left it on overnight. When the early-morning Australian harness racing meetings opened with thin liquidity, the rule fired, placed lays into a moving favourite, and held them open. Total: about £340 burned in 45 minutes. The fix was a one-line "if event country ≠ GB then disable" filter that he hadn't bothered with. Always scope your rules.
When to outgrow trigger systems
Trigger systems handle ~95% of strategies. The 5% they can't:
- Strategies that depend on external models. If your edge is "lay the favourite when my form rating says it's overpriced", you need the model output as an input. Building your own Python bot is the right move.
- Strategies with complex stateful logic. A trigger system can simulate a state machine, but it gets ugly past 4–5 states.
- Strategies that need machine learning inputs. You can pipe ML scores in via the external trigger / Excel route, but at that point you're already half-coding.
The route from triggers to code is gentle. Most traders run a Guardian rule alongside a Python bot for years before deciding which to keep. There is no rush.
Adjacent reading: Bet Angel Guardian: practical strategies, Betfair API: Getting Started, Building Your First Betfair Bot, and the pillar piece Trading Software Complete Reviews.
How different tools implement the triggers-and-rules model
The same conceptual model, executed differently in each tool. Knowing how each one renders the same idea helps you switch between them.
Bet Angel Guardian
Visual rule builder, drag-and-drop. Triggers and actions in two panels. Rule priorities are explicit numbers. Excel hook for external data. Full breakdown at Bet Angel Guardian: automation rules.
Fairbot automation
Simpler than Guardian. Fewer trigger types. Better for traders who want one rule running and not much else. See the Fairbot review.
BetTrader automation
Mid-complexity. Decent on in-play sport triggers (goal scored, set won). See the BetTrader review.
Python on the Betfair API
The most flexible — your trigger is any code that returns True/False, your action is any function. Highest ceiling, highest learning curve. Walked through in Building Your First Bot and API Getting Started.
Trigger quality — what makes a good trigger
Not every trigger condition is equal. The good ones share three properties:
- Measurable — the value can be computed from data the tool has access to, without ambiguity. "LTP > 3.40" is measurable; "the market feels heavy" is not.
- Sharp — the trigger flips between true and false at a clear point, rather than being noisy. "30s volume > £500" is sharper than "30s volume > £100" because at higher thresholds you avoid the noise floor.
- Predictive — when the trigger fires, the strategy has a documented edge. This is the part you prove with paper trading.
The most common failure mode is over-tuning a trigger to historical data so it fires only on perfect setups that almost never recur. The 20:1 fits-per-fires ratio is the warning sign — if you backtest 1000 trades and your trigger fires 50 times with 47 wins, you've overfit.
Building state machines
A state machine is a set of "states" and "transitions". For trading, each state is what your bot is currently doing — flat, watching-for-entry, in-position-watching-for-exit, closing — and each transition is a trigger that moves you between states.
For a simple scalping bot:
In Guardian, you implement this by having one rule active per state, and the action of each rule disables itself and enables the next state's rule. In Python, you use a simple if self.state == "flat": structure. Same logic, different rendering.
Debouncing — preventing rule chatter
A common bug: your trigger fires, the action places a bet, the bet placement causes a price tick, the price tick causes the trigger to fire again, and another bet goes on. Three or four bets in 100ms before you notice.
The fix is debouncing. Every rule should be unable to fire again within N seconds of having fired. In Guardian this is a "minimum interval between firings" setting; in Python it's a timestamp check in the trigger function. Set the minimum interval to something longer than the typical price-update cycle of the market — usually 3–10 seconds.
Composite triggers — AND, OR, NOT
Single conditions are rarely enough. Real strategies need composites:
- AND — all conditions must be true. "LTP > 3.40 AND volume_30s > £500".
- OR — any condition true. "LTP > 3.50 OR LTP < 3.30" (range exit).
- NOT — condition false. "NOT in_play".
Most rule builders support AND natively, OR with multiple rules pointing at the same action, and NOT as a checkbox or a negation operator. Python supports them all directly. Composite triggers are how you go from "lay every drifter" to "lay every drifter on UK flat racing on all-weather courses in the final 60 seconds with weight-of-money below 0.8" — i.e. from a noisy idea to a filterable strategy.
Actions in more depth
Beyond the obvious "place X bet", more nuanced actions:
Place bet at LTP ± N ticks
Useful when you want to queue rather than match. "Lay at LTP + 1 tick" sits one tick above the current LTP, waiting for the price to come to you. You might miss the bet entirely if the market doesn't move, but when it does match, you get a better fill.
Place a bet "at best price up to limit"
Useful when you want immediate execution but with a cap. "Place lay at best lay, but only if best lay ≤ 3.60". Protects you from runaway prices.
Place bet sized as percentage of bank
Rather than fixed £20, "place lay at 1% of available bank". Scales as your bank grows. We cover the maths in bankroll management.
Trailing stop
The stop-loss price moves with the favourable price. "Stop is always 3 ticks behind the best back so far". Locks in profit as the trade goes your way.
Partial close
Close half the position at one trigger, the other half at another. Used to lock in some profit while leaving room to ride a continuation.
Testing rules without losing money
Three layers of testing, applied in order:
- Logic test — read the rule, walk through it on a hypothetical price scenario, verify the action you'd expect. Catches the obvious bugs.
- Paper trading — rule active against live markets but actions logged rather than executed. Catches the "I didn't anticipate that scenario" bugs.
- Smallest-stake live — real bets at £2. Catches the bugs that only manifest in real execution (price slippage, rejected orders).
Skip any layer and you're hoping rather than knowing. The cost of paper trading for a week is one week. The cost of skipping paper trading is sometimes hundreds of pounds.
Organising rules at scale
Once you have ten or twenty rules, organisation matters. Conventions that scale:
- Naming — "[Sport] [Market] [Direction] [Strategy] [Version]". E.g. "HR Win Fav Drift Lay v3".
- Grouping — group rules into folders by sport or by strategy family.
- Version control — keep .baf or .py files in git. Tag working versions before changing them.
- Documentation — every rule should have a one-paragraph comment explaining the strategy and the success criterion. Future-you will thank present-you.
- Disable, don't delete — a rule you've turned off might be re-enabled next month. Keep its history.
Ethics and limits
A practical note. Automation makes it possible to size up faster than your edge justifies. The bot will not stop you. Set hard limits in your own head — and in your code — about how much you'll let it stake before reviewing. We discuss the broader question of when to scale in scaling up Betfair trading and the responsible-gambling angle in responsible gambling.
Closing thought
The triggers-and-rules model is a translation layer between your strategy and the exchange. The strategy is what creates the edge. The model is how you scale it. Get the strategy right manually first — at the screen, with stakes you can afford, for the time it takes to know that the pattern is real. Then automate it. Backwards rarely works.
Adjacent reading: the Guardian-specific implementation, the API foundations, Python bot tutorial, and the cluster pillar at Trading Software Complete Reviews.
A short vocabulary of trigger-engine terms
The terms differ between tools but the underlying concepts are the same. Reference glossary:
- Predicate / Condition / Trigger — the test that determines whether the rule fires.
- Action / Effect / Order instruction — what the rule does when triggered.
- Scope / Filter / Selection criterion — which markets and selections the rule applies to.
- Persistence / Lifetime — how long the rule (and any bet it places) remains active.
- Stop / Exit condition / Cutoff — when the rule stops watching, regardless of triggers.
- Priority / Precedence / Order — which rule wins when multiple are eligible to fire.
- Composite / AND / OR group — a trigger that combines multiple conditions.
- Debounce / Cooldown / Minimum interval — the rest period between firings.
Is automation against Betfair's rules?
No. Betfair publishes the API specifically so traders can build automation on top of it. The Bet Angel Guardian system, every third-party client, and home-grown Python bots all use that API. The rules to be aware of:
- Don't share your account credentials with anyone, including any third-party "managed bot" service.
- Don't run automation that abuses Betfair's price-quoting system (e.g. placing and immediately cancelling thousands of bets to probe liquidity).
- Be aware of the premium charge implications of very high-volume automated trading.
Within those bounds, automation is a fully legitimate, supported part of how Betfair operates.
Open a Betfair Exchange account to follow along
Every example in this article assumes you have a funded Betfair Exchange account. Sign-up is free, takes about five minutes, and gets you the back-and-lay interface plus the live price ladders you'll need to practise.
Open Betfair Account →