Strategy Configuration
You can open the configuration panel of a strategy with a double click on the corresponding row in the strategy grid.
All the strategies (except the manual ones) have the same number of properties, but not necessarily every strategy uses all of them.
Manual strategies have less properties, because the trigger of the bet is always manual and because most of their behaviour is fixed in the code.


Bet Trigger Logic
Every market refresh, Ipposnif checks against all the runners of that market, if the conditions specified in the active strategies are verified.
When all the conditions of a strategy are verified, the strategy places the bet and creates its container, the trade. Some strategies create only one bet each trade, other strategies create more than one (trading strategies).
The number of trades is controlled by the properties Max Active Markets e Trades Per Market described below.
Strategies - Bet Trigger Logic


Property Types
Ipposnif uses the following property types:
  • String: a combination of the following characters: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_+-0123456789^*#@.,°[]()!\|/?: $€£%_
  • Decimal: a decimal number with two decimals. Plus prefix (+) means that the number must be positive.
  • Integer: an integer number. Plus prefix (+) means that the number must be positive.
  • Time: time of the day expressed with the format hh:mi:ss.
  • Timeframe: timeframe related to the start time of an event. It is expressed with the format hh:mi:ss. If negative, it is subtracted from the related event start time.
  • SQL Expression: SQL is a language created to manage databases but it can be used also to define amounts, and to express mathematical assertions. The simplest SQL expression can be a number (for example: 10.5). More complex SQL expressions can refer to variables and functions (for example: @capital/10). In the references section of this help, you can have info about SQL and all the variables and functions that you can use in Ipposnif.
  • SQL Assertion: an SQL expression that can be true or false (for example: @base_rate < 8 ).
Properties marked with a star (*) are mandatory.


Identification
ID* (integer): it is automatically assigned to every new strategy imported into Ipposnif or cloned from an existing one.
Name* (string): name of the strategy, shown in the details of the trade and in the strategy selector.
Description (string): description of the strategy.


Capital
Capital* (+decimal): maximum amount of money the strategy can lose.
Max Liability (+decimal): maximum exposure the strategy can have.
Daily Stop Loss (+decimal):: when the strategy has lost in the current day more than this amount, it stops placing bets until the day after.
Daily Stop Win (+decimal):: when the strategy has won in the current day more than this amount, it stops placing bets until the day after.
Max Reset* (+integer): maximum number of times the strategy can perform a reset. When the strategy resets, it start with a new capital. Zero means no reset. The total amount of money risked by the strategy is equal to: capital*(Max Reset+1).
Reset Condition (SQL Assertion): when the SQL assertion is true, and there are no open trades, the strategy is reset.

Repeat Layed Bets: *** POTENTIALLY DANGEROUS, PLEASE READ CAREFULLY BEFORE USE ***. Ipposnif can place tens of bets every second. If, for any reason, Betfair starts responding with false negative (the bet has been placed but Betfair says it is not), repeating indefinitely the same bet will overcome the strategy capital limit and use your whole account balance.
Fortunately, Ipposnif has been developed with capital protection as first thing in mind, and it never retries to place again the same bet, whatever is the result of the placement. It is better to lose a bet rather than the whole capital! But with certain in-play markets, in sport events with a score (ex. Soccer), in particular strategies (ex. Lay The Draw), this option is necessary to place again the bet after a goal, because after every goal all the bets are layed. Use this option at your own risk (like indeed you use at your own risk all the other functionalities of the program).


Market Filters
Event Type, Market Types, Countries, and Racecourses: filters applied to the the downloaded markets. These filters will not affect the downloaded market configuration that you can setup from the options. For international events (like for ex. UEFA Champions League) use “International” like country.
Event Start Time Range (Time): daily time frame when the strategy can place bets. The time format is hh:mi:ss. Insert your timezone in Tmz to specify a timeframe related to your local time.
Status* : status of the market when the strategy is allowed to place bets.
Betting Time (Timeframe): time frame relative to the start of the event, when the strategy can place bets. A negative value means before the scheduled start time of the race, a positive value means after the start time. So for example the values -00:01:00 and 00:02:00 mean that the strategy can place bets only from one minute at the start time of the race to two minutes after the start time of the race (the race has no more delay than 2 minutes). These values are not mandatory, but it is strongly recommended to specify them to reduce the computation effort, and to avoid that all the markets are eligible for betting at the same time.
Overround Back (+decimal): min and max back overround allowed. The overround is an indicator on how much fair are the odds in a market. Closer is the overround to 100 better are the odds for the final user. The overround back is calculated with the formula: SUM_FOR_ALL_RUNNERS(1/runner_best_back_price)*100
Overround Lay (+decimal): min and max lay overround allowed. This indicator is very similar to the previous one, but this time it is calculated using the best lay price.
Each Bet: if checked, the overround filters are applied to all the bets; if not checked, the overround filters are applied only to the entry bet.
Max Active Markets (+integer): maximum number of markets the strategy can play simultaneously. Open and closed trades are included. Canceled and settled trades are excluded.
Trades Per Market: how many trades per market can be created. Can be:
  • Single trade per market: only one trade per market.
  • Single trade per runner: only one trade per runner, for a maximum of Max Runners.
  • Multiple trades one runner: a maximum of Max Trades can be created on a single runner.
  • Multiple trades and runners: an infinite number of trades (only one open at one time) can be created on a maximum of Max Runners.
Only Manually Selected Markets: when this option is checked, the strategy will place bets only on selected markets. To select a market you can use the check that is shown on the right of the strategy selector, above the runner grid.


Runner Filters
Runner Selection Criteria: is the criteria used to select the runner/s to bet. If can be one of the following options:
  • No criteria: the selection of the runners is demanded to all the other filters of the strategy (particularly the Entry Bet Condition option).
  • Manual selection: a column with checks will appear in the runner grid. The strategy will place bets only on the selected runners.
  • Red flag: the strategy can place bets only on runners with a red flag.
  • Black flags: the strategy can place bets only on runners with a black flag.
  • Order by price: the runners are ordered by price, and Pick Position Start will indicate the position, in this ordered list, from where to pick up the runners to bet.
  • Order by price desc: like the previous option, but the runners are order by descending price.
  • Order by Betfair: the runners are ordered by Betfair position ID.
  • Order by Betfair desc: like the previous option, but the runners are in descending order.
  • Order by Rating, Number, Weight, Stall, TAM: the runners can be ordered by various criteria.
  • Order by Custom: you can change the current criteria (price) with your custom one, modifying the function [fun_tbl_HorseSelection] in the database.
  • Pick at random: one runner is randomly picked. The random number changes every time it is requested, so take care of limiting the number of the bets with the option Trades Per Market.
  • Runner note: the strategy can place bets on a runner if its note contains the text specified in Text to search. To perform a like comparison use the % symbol. For example, inserting "%lead%" as text, the strategy will place bets only if the runner note contains anywhere the text "lead".
  • Runner Name, Jockey Name, Trainer Name, Owner Name: the strategy can place bets on a runner if its name contains the text specified in Text to search. To perform a like comparison use the % symbol. For example, inserting "The Draw" as text, the strategy will place bets only on selections with name "The Draw".
  • Rating: the rating of the runner must be between the specified bounds of the range.
  • Recent Form: the string of the last results can be used to filter runners. For example, inserting "%1" as Text to search, only the runners that have won the last race can be bet; inserting "%11" only the runners that have won the last two races.
  • Home Team If Score: the home team is selected if the actual score is among the specified ones. Multiple score results must be specified using comma. For example "0-0,1-0,1-1".
  • Away Team If Score: the away team is selected if the actual score is among the specified ones. Multiple score results must be specified using comma. For example "0-0,1-0,1-1".
  • Draw If Score: the Draw selection is selected if the actual score is among the specified ones. Multiple score results must be specified using comma. For example "0-0,1-0,1-1".
Back/Lay Price Range defines the odd bounds within a bet can be placed. These bounds not necessarily set a constraint to the final price of a bet, because the bet price could be updated after the creation (if specified in the strategy). If you need to specify bet price bounds that can never be overcome, use the Price Offset option. If you run several strategies at the same time, the use of this option, together with the option Betting Time, can considerably reduce the load of the system.


Entry Bet
Entry bet is the first bet of a trade. It can be the only present in the trade, like for example in betting strategies, or it can be followed, in trading strategies, by other bets (hedge bet/exit bet).
Entry Bet Condition (SQL Assertion): in addition to all the filters described before, here it is possible to specify an extra SQL assertion, that allows the bet placement only when true.
Basically this is the perfect place where to set up a personalized logic for filtering runner.
Bet Price defines the price of the bet. It can be:
  • A fixed price
  • The best back/lay increased/decreased by a number of Ticks (+integer)
  • The best back/lay increased/decreased by a Percentage (+integer)
  • The back/lay price at which a specific Stake Amount (+integer) is fully matched
When Upddate is ON and the bet is unmatched, then a new price is calculated with the same criteria of the place price, and the bet updated accordingly. The update process is performed until the bet is matched, with an interval in seconds specified in Interval (+integer). This is usefull to keep the bet at a certain distance from the front of the market.
Persistence: defines the behavior of the bet when the event starts, it can be:
  • Lapse: the unmatched bet will be voided
  • Persist: if the market goes in play, the unmatched bet will keep in play, otherwise the bet will be voided
  • Market_on_close: bet will be matched by Betfair using the starting price
Price Offset Min/Max (SQL Expression): the minimum and maximum price that a bet can have. If the price overcomes one of the bounds, it is offset to the bound.
Bid Type: the type of the bet: back or lay. The hedge bet, if used, is always of the opposite type of the entry bet.
Bet Size = Net Win/Liability: when this option is ON, the amount resulting from the "Bet Size" option, is considered like the target net win (back) or the total liability of the bet (lay). The effective size of the bet is adjusted accordingly.
Use Residual Capital: if active and the capital is not enough to place the next bet, the bet will be placed anyway, with the size adjusted to use all the remaining capital.
Bet Size (SQL Expression): size of the bet. It can be simply an amount or a SQL expression. Strategies that follow a particular stake progression logic, like for example the strategy Masaniello or D'Alembert, can use SQL functions present in the Ipposnif database. You can read here how to access the Ipposnif database.
Size Offset Min/Max (SQL Expression): the minimum and maximum size that a bet can have. If the size overcomes one of the bounds, it is offset to the bound.
Delete Distance (+integer): when the distance in ticks between the best back/lay price and the actual bet price is greater than the specified value, the bet is deleted (if unmatched).
Fill Or Kill (+integer): cancel the bet if it remains unmatched for the specified amount of seconds.


Hedge Bet
Hedge, also called "greening up", is the operation of counterbalancing a bet with another of the opposite type. The scope is to shorten the loss or to cash out the profit.
This bet is optional: to activate it, check the checkbox on the top of the paragraph.
This bet is placed when the entry bet (or what remains after a partial delete) is fully matched.
Hedge Bet Condition (SQL Assertion): this is an additional condition for the bet placement. For example, the strategy Lay The Draw waits for the score to be different from 0-0 before placing the hedge bet.
Hedge Bet Price, Interval, Persistence, Price offsets: have the same functionality described in the Entry Bet, but now applied to the hedge bet. The size of the bet is the hedge size calculated on the hedge price.


Exit Bet
This bet is optional: to activate it, check the checkbox on the top of the paragraph.
The scope of this third bet is to close all the positions of the trade, hedging the actual profit or loss at the best price.
Exit Bet Condition (SQL Assertion): this is the condition that triggers the exit bet. If it left empty, the trigger of the exit bet is demanded to the two following options.
Stop Loss (+integer): when the trade loss is greater than this value, the exit bet is triggered.
Hedge Before Start (+integer): is applied to pre-match trading strategies. When the number of seconds at the start of the event is less than this value, the exit bet is triggered.


Other
Link To Strategy: makes the strategy dependent from another strategy. When the condition is true, the current strategy can place bets. The following link conditions can be used:
  • Day PL greater/less than the specified amount
  • Market PL greater/less than the specified amount
  • Market total/matched trades (for the same strategy) equals to the specified amount
  • Consecutive won trades equals/greater than the specified amount
  • Consecutive lost trades equals/greater than the specified amount
  • Consecutive won reset equals/greater than the specified amount
  • Consecutive lost reset equals/greater than the specified amount