FairBot

Expressions

An expression is a small calculation, such as BO1 * 1.1 or Max(LTP, 2). Use one when a fixed number isn't enough: to compare two prices, to work out a stake from the market, or to store a result in a user variable.

Where you can use expressions

  • The Selection Expression and Market Expression conditions.
  • Bet Size and Bet Odds set to Selection Expression, and the Dutching amount set to Market Expression (see Actions).
  • The Set Variable (Market Expression) and Set Variable (Selection Expression) actions.

Click Help... (or ?) next to an expression box to see the variables and functions, and Test to see what the expression gives right now in the open market.

An expression box with the Help... and Test buttons and the current result

Selection and market expressions

  • A selection expression works on one selection, so its variables need no index: BO1 is that selection's best back odds.
  • A market expression can use any selection, so you add its index in brackets: BO1(1) is the best back odds of the first selection, BO1(2) of the second, up to N. In the Market Expression condition and Set Variable (Market Expression), the order of the selections follows the Selection Sorting you choose.

Variables

Selection expression Market expression Meaning
BO1, BO2, BO3 BO1(I), BO2(I), BO3(I) Back odds, best first.
LO1, LO2, LO3 LO1(I), LO2(I), LO3(I) Lay odds, best first.
BA1, BA2, BA3 BA1(I), BA2(I), BA3(I) Money available to back at those odds.
LA1, LA2, LA3 LA1(I), LA2(I), LA3(I) Money available to lay at those odds.
LTP LTP(I) Last traded price.
V V(I) Money matched on the selection.
NSP, FSP, ASP NSP(I), FSP(I), ASP(I) Near SP, Far SP and Actual SP.

In both kinds you can also use:

Variable Meaning
MV Money matched in the market.
N Number of selections.
P Number of places.
M_PL Your profit or loss in the market. Only once the market has closed.
M_NET_PL The same after Betfair commission. Only once the market has closed.

Your own user variables can be used by name too, such as entry_odds.

Functions and operators

Function Result
I(X) The whole-number part of X.
R(X) X rounded to the nearest whole number.
Offset(P, T) The price T ticks above price P, or below it if T is negative. Offset(5.2, -2) gives 5.0.
Min(A, B), Max(A, B) The smaller or the larger of A and B.
Sqrt(X) The square root of X.
Power(B, E) B to the power of E.
Exp(X) e to the power of X.

Calculate with +, -, * and /, and compare with <, <=, >, >=, = and <>.

Examples

  • BO1 - LO1: the gap between the best back and lay odds of a selection.
  • BO1(1) / BO1(2): how much shorter the first selection is than the second (in a market expression).
  • V / MV * 100: the selection's share of the market's volume, in percent.
  • Offset(LTP, 2): two ticks above the last traded price, for example as Bet Odds.

Updated 28 Nov 2026