Condition Formula

Updated on 2024-09-02

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 it as a market value: M.[NAME] and to access it as a selection value: R.1.[NAME].

Preset Values
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 Default Value is NAME to access it you will indicate 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 of a formula: M.LIQ/10


STRATEGY PARAMETERS

PARAMETERSYNTAX (example)MEANING
PVPV[NAME]Gets the Preset Value with the specified name (case sensitive)


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


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.3V.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.CASHOUTCash Out amount possible on the first selection

Still need help?

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