Game-Related Variables

Top  Previous  Next

Variable

Type

Description

channel_id

integer

The unique ID BetFair assigns to the channel (a several-digits number).

market_id

integer

The unique ID BetFair assigns to the current market of the channel. If a trigger is set to operate in "Main Bets" market, this will be the ID of the main market, if it is set to operate in "Side Bets" market, this will be the ID of the side market. If the trigger should operate in both markets, then this variable will be evaluated for each market separately and return the corresponding value if used in trigger conditions.

main_market_id

integer

The unique ID BetFair assigns to the "Main Bets" market of the channel.

side_market_id

integer

The unique ID BetFair assigns to the "Side Bets" market of the channel. If the game does not support side bets, this will return 0.

market_volume

floating point

The total amount of money matched in the current market of the current game.

total_matched

player_num

integer

The number of selections in the game. This number is a constant and it is defined the rules of the BetFair Games. For example, player_num in Blackjack is 8.

settled_num

integer

The number of selections that were settled or eliminated from the game.

main_settled_num

integer

The number of selections that were settled or eliminated from the "Main Bets" market of the game.

side_settled_num

integer

The number of selections that were settled or eliminated from the "Side Bets" market of the game.

inplay_num

integer

The number of selections that are still playing in the game. This number is equal to player_num - settled_num.

stood_sels

integer

The number of selections (players) that have stood.

channel_name

string

The name of the channel. Can return one of the following values:

 

POKER_STANDARD

POKER_TURBO

BLACKJACK_STANDARD

BLACKJACK_TURBO

BACCARAT_STANDARD

BACCARAT_TURBO

HILO_STANDARD

HILO_TURBO

OMAHA_POKER_STANDARD

CARD_RACER_STANDARD

is_turbo

0/1

Returns 1 if the channel is in turbo mode and 0 otherwise.

back_size

floating point

The channel's default & one-click amounts.

lay_size

default_amounts

mcommission

floating point

The size of the commission BetFair charges for winnings in the channel, in "Main Bets" market. For the convenience of calculations this variable returns a value in the range of 0.0 to 1.0. That is 5% corresponds to 0.05, 2.5% - to 0.025 and so on.

In order to place a bet that takes the commission into account, adjust the "Amount" field of the trigger in the following way:

Amount: [bet amount]*(1+mcommission)

 

For example, if you want to lay to win 10 EUR, you'll need to set the "Amount" property to 10*(1+mcommission).

scommission

floating point

The size of the commission BetFair charges for winnings in the channel, in "Side Bets" market.

commission

floating point

The size of the commission that is charged for the winning bets in the current type of market (the one that the condition is being checked for).

last_bet_price

floating point

The price of the last bet that was settled in the channel. Read here more.

last_bet_amount

floating point

The amount of the last bet that was settled in the channel.

last_bet_pl

floating point

The profit or loss from the last bet that was settled in the channel.

last_bet_type

0/1/2

The type of the last bet settled in the channel. 1 designates a lay bet, 2 - a back bet, and if no bets have been settled yet, this will return 0.

games_played

integer

The number of games that have been played in the channel.

test_mode

0/1

Returns 1 if the Test Mode is turned on in the channel, or 0 otherwise.

[m/s]bet_number

integer

The number of bets that have been placed in the market since the beginning of the game. This includes matched, unmatched and settled bets of both back and lay types.

By adding the prefix "m" or "s" in front of the variable you can specify which exactly type of market you refer to ("m" for main bets, "s" for side bets).

Note: if unmatched bet got lapsed after the end of the round, the number returned by the variable is not decremented.

The variable is reset to zero in the end of the game.

channel_pl

floating point

The cumulative P/L of all settled bets in the channel (in all markets). This variable contains the value displayed next to "Total in game, P/L" label:

 

channel_pl

channel_trend

floating point

Returns the numerical value of the channel's P/L Trend. It can be a number from -1.0 to 1.0 (e.g 0.10, -0.45, 0.24, -0.99).

trend_up_down

As the trend descends, like in the square area coloured in pink, channel_trend returns a negative value. The steeper is the line, the closer is this value to -1.0.

 

If a trend starts ascending, like in the green area, channel_trend gains a positive value. The bigger is the growth, the closer this value is to 1.0.

 

If the trend doesn't grow or fall down (i.e. if P/L is not changing), this variable will return 0.0.

 

How to use this variable

 

The trend smoothes the irregular change of P/L over time, so using this variable you can tell whether you are on a wining or losing streak. This can be important if you want to change your tactics once you've started winning or losing. The value of the variable tells you how rapidly the P/L is changing.

 

Example:

 

Trigger Expression channel_trend is less than -0.6

 

Checks whether you are losing money at a speed of 0.6. The value of -0.6 corresponds with a trend showed below:

 

channel_trend

 

Please note: channel_trend can be positive even if the current P/L is less than 0. It reflects the dynamics of P/L, not its current state.

 

round

integer

The value of the current round, from 1 to the maximum number of rounds in a particular game.