Condition Formula

Updated on 2025-08-24

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

PARAMETERSYNTAX (example)MEANING
PVPV[Name]

Gets the Preset Value with the specified name (case sensitive)


PARAMETRI DI APPLICAZIONE

PARAMETERSYNTAX (example)MEANING
NOWA.NOWReturns 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.
SIMULATIONMODEA.SIMULATIONMODEReturns true if the application is in simulation mode, otherwise false.


MARKET PARAMETERS

PARAMETER
SYNTAX (example)MEANING
STATUS
M.STATUSMarket Status ("INACTIVE", "OPEN", "SUSPENDED", "CLOSED")
V
M.VMarket Volume
BBP
M.BBPBack Book Percentage
LBP
M.LBPLay 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.LIQMarket Liquidity (somma quantità disponibili sui book ai vari livelli di prezzo)
BETDELAY
M.BETDELAYDelay, in seconds, for placing market bets
CASHOUT
M.CASHOUTValue 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
DORMANT | No data is available for this race
DELAYED | The start of the race has been delayed
PARADING | The horses/greyhounds are in the parade ring
GOINGDOWN | The horses are going to the starting positions
GOINGBEHIND | The horses are going behind the stalls
APPROACHING | The greyhounds are approaching the starting box
GOINGINTRAPS | The greyhounds are being placed in the starting box
HARERUNNING | The hare has been started
ATTHEPOST | The horses are at the post
OFF | The race has started
FINISHED | The race has finished
FINALRESULT | The race result has been declared (Greyhounds)
FALSESTART | There has been a false start
PHOTOGRAPH | The race result is subject to a photo finish
RESULT | The race result has been announced
WEIGHEDIN | The jockeys have been weighed in
RACEVOID | The race has been declared void
NORACE | The race has been declared a no-race
MEETINGABANDONED | The meeting has been abandoned
RERUN | The race will be rerun
ABANDONED | The race has been abandoned


SELECTION PARAMETERS

PARAMETER
SYNTAX (example)
MEANING
VR.1.V Volume of selection 1 in Betfair order
BABPR.1.BABPBest Available Back Price for selection 1
BALPR.1.BALPBest Available Lay Price for selection 1
BABSR.1.BABS Best available amount to back for selection 1 (stake)
BALSR.1.BALSBest available amount to lay for selection 1 (stake)
BP1 BP2 BP3R.1.BP3Third back price for selection 1 (Back Price 1, 2, 3). Note: BP1 = BABP
LP1 LP2 LP3R.V3.LP2Second lay price for the third selection in descending order of volumes (Lay Price 1, 2, 3). Note: LP1 = BALP
PLR.1.PL Profit/Loss for selection 1
TABR.1.TABTotal available to back for selection 1
TALR.1.TALTotal available to lay for selection 1
LTPR.1.LTPLast traded price for selection 1
EXSUMBR.1.EXSUMBSum of executed or partially executed back bets stakes on selection 1
EXSUMLR.B2.EXSUMLSum of executed or partially executed lay bets stakes on the second selection in order of available back prices
REMSUMBR.1.REMSUMBSum of unmatched back bets stakes on selection 1
REMSUMLR.B2.REMSUMLSum of unmatched lay bets stakes on the second selection in order of available back prices
MINEXPRICER.1.MINEXPRICEMinimum traded price on the first selection
MAXEXPRICER.2.MAXEXPRICEMaximum traded price on the second selection
MAXVOLPRICER.V3.MAXVOLPRICEPrice with the highest traded volume on the third selection in descending order of volumes
WOMR.3.WOMWeight of Money for the third selection. Note: the formula for calculating WOM is set in the program options
BCPR.1.BCPAverage carrying price of my back bets ( Back Carrying Price) on selection 1
LCPR.2.LCPAverage carrying price of my lay bets (Lay Carrying Price) on selection 2
LTPVARPERCR.3.LTPVARPERCPercentage variation of the last traded price on selection 3
LTPVARTICKS R.L3.LTPVARTICKSPercentage variation of the last traded price on selection 3 in order of available lay prices, measured in ticks
CASHOUTR.1.CASHOUT

Cash Out amount possible on the first selection


Still need help?

Submit a ticket and we’ll get back to you as soon as possible.