Customize Ipposnif
Ipposnif is an open system because all the betting logic and the data is contained unencrypted in the Microsoft SQL Server 2016 local database.
Using the proper tools, you can connect to the database and modify or add variables and functions developed by you.
The official tool, for managing SQL Server databases, is Microsoft SQL Server Management Studio (SSMS). It is free and you can download it from:

Connect to the database
The server name for the connection is: (localdb)\IpposnifSql2016Instance
The version of SQL Server used by Ipposnif is the LocalDB 2016. This version allows only local connections, so you can connect to it, only from the same machine where Ipposnif is installed.
Once you are connected, you can browse SQL Server using Object Explorer. All the Ipposnif procedures and data are contained in the database with name IpposnifDB320.
You can read from here how to install Ipposnif on a different version of Microsoft SQL Server.

How to add a new variable
To add a new variable, that can be used from the strategies, simply insert a record in the table [tbl_SysVariables].
All the fields are mandatory:
  • Name: a unique combination of the following characters abcdefghijklmnopqrstuvwxyz_0123456789
  • Declaration: where to specify the type of the variable.
  • Funct: the SQL expression to retrieve and assign the value to the variable.
Example of a new variable that returns the count of runners in the market with and odd between 2 and 7:
  • Name
  • Declaration
    declare @runners_2_7 int
  • Funct
    select @runners_2_7=count(*) from tbl_races_horses where id_race=@id_race and status<>'REMOVED' and B1_Price between 2 and 7
The variable @id_race present in the function is a special variable resolved automatically. Only the following special variables can be used in the field [Funct]:
  • @id_strategy
    contains the id of the strategy processed in that moment
  • @id_race
    contains the id of the market processed in that moment
  • @id_horse
    contains the id of the selection processed in that moment
  • @id_trade
    contains the id of the trade processed in that moment
  • @nbet
    contains the ordinal number (in the trade) of the bet processed in that moment
The naming of these special variables is slightly wrong, it comes from the first version of Ipposnif that was working only on horse races and only on win markets. @id_race should be called @id_market and @id_horse should be called @id_selection, but they have never been changed to keep compatibility in the strategy formulas.

Some of the variables present in the table [tbl_SysVariables] (for ex. @bet_size) are used by the system and by some strategies. If you wish to change an existing variable, don't edit it directly, but instead create a clone with a new variable name.