SQL

Structured Query Language

Ipposnif strategies can be programmed using SQL expressions, that are inputted from the strategy's Configuration Panel.
The simplest SQL expression can be a number, more complex SQL expressions can refer to variables and functions dedicated to the exchange betting.
If you are new to SQL, from this article you can get the basics needed to create new Ipposnif strategies.

Examples of SQL expressions (used, for example, to define the bet size or the bet price):

  • Decimal number
    10.5
  • Expression using variables
    @capital/10
  • Complex formula (from strategy "Betting Auto - Chase Losses Back")
    ((1 + dbo.fn_strategyproperty(@id_strategy,'winning_trades')) * 
    (@initial_capital/500) + (@initial_capital - @capital)) * 
    (1+@fees)
  • Reference to a function present in the Ipposnif DB (from strategy "Betting Auto - Masaniello Back")
    dbo.fn_masaniellosize(@id_strategy, @initial_capital*0.95, 5, 8, 4, @bid_type, 0)

Examples of SQL assertions (SQL expressions that can be true or false; they are used, for example, to define the bet condition):
  • Place the bet only when the difference in ticks between the best back price and the best lay price is greater than 3.
    dbo.fn_TickDiff(@best_back_price, @best_lay_price) > 3
  • Place the bet only when the Weight Of Money function returns a value lower than 0.28
    dbo.fn_wom(@id_race, @id_horse) < 0.28