XML Tags

Ipposnif strategies are coded in XML.
Ipposnif XML uses five different tags to divide the information in blocks and to give them a hierarchical position.
The Ipposnif strategy has the following tag structure:

      <place />
      <update />
      <delete />

The block <bet> </bet> can be repeated more times, and each one is a different bet produced in the trade.

You have two ways to create a new strategy:

  • Right click the grid in the strategy window and select 'Add New Strategy' from the context menu.
  • Import or clone an existing strategy, replace the code (and the name) and save.

These five tags have attributes which are always specified with attribute_name="value"
A simple strategy can have the following syntax:

<strategy name="My first strategy" description=""

       <bet index="1" bid_type="b">
          <place condition="@id_horse=@id_favourite" price="@best_back_price" size="2*(1+@fees)" />

The attributes name, description and capital are mandatory. Capital specifies the maximum amount the strategy can loose.

The attribute betting_time_range_lower limits the bet activity to only one minute from the start.
The attribute max_market_trades limits the number of trades to maximum one each market. This attribute has been added for teaching purposes, because if it is not specified, the default will be 1 as well (for security reasons).
Immediately after a trade is created on the market, the condition represented by the attribute "max_market_trades" will no longer be verified, preventing the strategy from placing new bets on the same market.
"max_market_trades" is one of the attributes of the <strategy> tag that give control on the creation of trades. This default limit is overriden in some strategies (like for ex. "Auto Trade - Back" or "Auto Bet - Lay Outsiders") that can produce several trades every market.
"betting_time_range_lower" and "max_market_trades" are pre-filtering conditions: up untill they are not both verified, the condition expressed in the <place> tag will not be checked.

The value of some attributes, like for example condition of the <place> tag, can be an sql expression.
Sql is a language created to manage databases but it can be used also to express mathematical assertions and amount definitions.
In the example above we have an assertion of equivalence between two Ipposnif variables: @id_horse that contain the unique Id of the runner and @id_favourite that contain the Id of the runner with the lower odd in the race.
When this assertion is true a bet is placed with the size and price specified in the attributes with the same names. Size and price are special attributes too and their amount can be specified with a sql expression.
In our example we use another two variables: @best_back_price returns the best back price of the horse. @fees is a system variable (refreshed every minute) used to adjust the bet size, by the amount of fees that will be paid by the user.
The type of the bet is specified in the attribute bid_type: b=Back l=Lay.
Index is the unique id of the bet within the trade. It is used to refer to a bet from a different one, when there are more bets in a trade. In our case we have only one bet every trade and this attribute has been added only for teaching purposes.

The sql version used by Ipposnif is Microsoft Tsql extended with several functions and variables dedicated to Betfair Exchange Betting.