Home BETTING TOOLKIT USER GUIDE Automation Conditions Condition Formula
This type of condition is particularly powerful because it allows you to verify a condition on certain parameters or variables by expressing the condition through a formula. This type of condition does not strictly fall into the categories of market parameters or trading data since variables can access both types of data.
The inserted formula can contain any variables you want from those listed in the tables at the end.
Market-related variables start with M, while selection-related variables start with R and are followed by a dot and the order number. For example: R.2 is the second selection in Betfair order, R.L2 is the second selection in Lay odds order (L = LAY), R.B3 is the third selection in Back odds order (B = BACK), R.V1 is the first selection in decreasing traded volume order.
Stored Values
Within formulas, you can also use Stored Values by indicating the name of the Stored Value within square brackets.
For example, if the name of the Stored Value is NAME:
- to access as a Stored Value of the Market, write M.[NAME]
- to access as a Stored Value of the Strategy, write S.[NAME]
- to access as a Stored Value of the Application, write A.[NAME]
- to access as a Stored Value of the Selection, write R.1.[NAME]
Preset Values of the Strategy
Within formulas, you can also use the Preset Values of the strategy by indicating the name of the Preset Value within square brackets. For example, if the name of the Preset Value is NAME to access it you have to write PV[NAME].
Using formulas to express a condition
Using formulas is simple. For example, if we express a formula as follows:
M.V > 10000
This will be considered true if the market volume exceeds 10000 euros or other currency.
Using formulas to express a value
By writing an expression without a comparison operator, the result of the formula will be used as a value.
Example: M.LIQ/10
STRATEGY PARAMETERS
PARAMETER | SYNTAX (example) | MEANING |
PV | PV[Name] | Gets the Preset Value with the specified name (case sensitive) |
PARAMETRI DI APPLICAZIONE
PARAMETER | SYNTAX (example) | MEANING |
NOW | A.NOW | Returns the value as a string in the date and time format of the current moment. Example: #01/03/2025 12:05:54# If we evaluate with a formula like A.NOW > '02/01/2022', the result will be true. |
SIMULATIONMODE | A.SIMULATIONMODE | Returns true if the application is in simulation mode, otherwise false. |
MARKET PARAMETERS
PARAMETER | SYNTAX (example) | MEANING |
STATUS | M.STATUS | Market Status ("INACTIVE", "OPEN", "SUSPENDED", "CLOSED") |
V | M.V | Market Volume |
BBP | M.BBP | Back Book Percentage |
LBP | M.LBP | Lay Book Percentage |
N | M.N | Number of market selections |
NA | M.NA | Number of active market selections |
NNA | M.NNA | Number of inactive market selections |
NWINNERS | M.NWINNERS | Number of winning market selections |
LIQ | M.LIQ | Market Liquidity (somma quantità disponibili sui book ai vari livelli di prezzo) |
BETDELAY | M.BETDELAY | Delay, in seconds, for placing market bets |
CASHOUT | M.CASHOUT | Value available for market Cash Out |
BET_IN_PROGRESS | M.BET_IN_PROGRESS | Returns "true" if a bet is currently being placed on the market |
RACEL_MILES RACEL_METERS | M.RACEL_METERS | Race length in horse racing betting. For example a race of length "3m5f" will have RACEL_METERS=0, RACEL_MILES=3+5/8=3.625 |
BASKET_HOME_PTS BASKET_HOME_1Q BASKET_HOME_2Q BASKET_HOME_3Q BASKET_HOME_4Q | M.BASKET_HOME_PTS | For a Basketball event, it returns the game score for the home team. |
BASKET_AWAY_PTS BASKET_AWAY_1Q BASKET_AWAY_2Q BASKET_AWAY_3Q BASKET_AWAY_4Q | M.BASKET_AWAY_PTS | For a Basketball event, it returns the game score for the away team. |
RACESTATUS | M.RACESTATUS | Allows retrieving the race status for the sports "horse racing" and "greyhound racing." The possible statuses are as follows: DATA_UNAVAILABLE | Error retrieving the race status |
SELECTION PARAMETERS
PARAMETER | SYNTAX (example) | MEANING |
V | R.1.V | Volume of selection 1 in Betfair order |
BABP | R.1.BABP | Best Available Back Price for selection 1 |
BALP | R.1.BALP | Best Available Lay Price for selection 1 |
BABS | R.1.BABS | Best available amount to back for selection 1 (stake) |
BALS | R.1.BALS | Best available amount to lay for selection 1 (stake) |
BP1 BP2 BP3 | R.1.BP3 | Third back price for selection 1 (Back Price 1, 2, 3). Note: BP1 = BABP |
LP1 LP2 LP3 | R.V3.LP2 | Second lay price for the third selection in descending order of volumes (Lay Price 1, 2, 3). Note: LP1 = BALP |
PL | R.1.PL | Profit/Loss for selection 1 |
TAB | R.1.TAB | Total available to back for selection 1 |
TAL | R.1.TAL | Total available to lay for selection 1 |
LTP | R.1.LTP | Last traded price for selection 1 |
EXSUMB | R.1.EXSUMB | Sum of executed or partially executed back bets stakes on selection 1 |
EXSUML | R.B2.EXSUML | Sum of executed or partially executed lay bets stakes on the second selection in order of available back prices |
REMSUMB | R.1.REMSUMB | Sum of unmatched back bets stakes on selection 1 |
REMSUML | R.B2.REMSUML | Sum of unmatched lay bets stakes on the second selection in order of available back prices |
MINEXPRICE | R.1.MINEXPRICE | Minimum traded price on the first selection |
MAXEXPRICE | R.2.MAXEXPRICE | Maximum traded price on the second selection |
MAXVOLPRICE | R.V3.MAXVOLPRICE | Price with the highest traded volume on the third selection in descending order of volumes |
WOM | R.3.WOM | Weight of Money for the third selection. Note: the formula for calculating WOM is set in the program options |
BCP | R.1.BCP | Average carrying price of my back bets ( Back Carrying Price) on selection 1 |
LCP | R.2.LCP | Average carrying price of my lay bets (Lay Carrying Price) on selection 2 |
LTPVARPERC | R.3.LTPVARPERC | Percentage variation of the last traded price on selection 3 |
LTPVARTICKS | R.L3.LTPVARTICKS | Percentage variation of the last traded price on selection 3 in order of available lay prices, measured in ticks |
CASHOUT | R.1.CASHOUT | Cash Out amount possible on the first selection |
Submit a ticket and we’ll get back to you as soon as possible.