Ipposnif uses SQL as programming language for strategies

Ipposnif strategies can be programmed using Microsoft T-SQL, that can be inputted in dedicated properties of the strategy.
SQL is a language created to manage databases but it can be used also to define amounts, and to define mathematical expressions and assertions.
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, this article explains the SQL basics focusing on the Ipposnif program.
If the variable or the function you need is missing, you can create your own, and use it from your strategies.

Examples of SQL expressions (to define the size of the bets):

  • Decimal number
  • Expression using variables
  • Complex formula (from strategy "Betting Auto - Chase Losses Back")
    ((1 + dbo.fn_strategyproperty(@id_strategy,'winning_trades')) * 
    (@initial_capital/500) + (@initial_capital - @capital)) * 
  • 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 (to define bet trigger conditions):
  • 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