<strategy>

This tag is the top parent tag. There is only one <strategy> tag for each strategy.

GENERAL ATTRIBUTES
capital (+decimal)Capital of the strategy. This is the maximum amount in the user currency that the strategy can lose.
description (string)Description of the strategy.
max_liability (+integer)Maximum amount of the exposure in the user currency
manual_trigger (n|y)If this option is equal to y the trigger conditions will be checked only after a user manual input (check on the horse, flags, input of values). Default value is n.
name (string)Name of the strategy
repeat_layed_bet (n|y)For security reason, in Ipposnif, in default the same bet is not placed a second time. If this option is equal to y and an unmatched bet is layed (for example after a goal in a soccer match), the placement of the bet is repeated. Default is n.
stakes_offset (decimal)Minimum amount of prices stake considered by the strategy. All the prices with an amount of stake lower than this will be ignored.
use_lacking_capital (n|y)If this option is equal to y and the remaining capital is not enough to place the next bet, the bet will be placed anyway using all the remaining capital. Default is n.


CONFIGURATION FRAME ATTRIBUTES
From the version 2.0 Ipposnif allows the user to change the properties of a strategy from the Configuration Frame and without entering the code.
The Configuration Frame is shown when the user double clicks on a strategy from the strategy window
The attributes of the <strategy> tag name, description and capital are mandatory and cannot be hidden.
The Configuration Frame is composed by a combination of the following blades. Their visibility is controlled by the attribute visible_blades.

visible_blades (string)Comma separated list of the names of the blades to show in the Configuration Frame of the strategy. No spaces allowed.
The available blades are listed below in the same order like they appear in the Configuration Frame.
There are two types of blade:
  • Blades without auto code: they are used to store values that can be retrieved from the strategies using variables.
  • Blades with auto code: When these blades are visible, they produce automatically some code that is added to the <place> condition of a bet. Basically no extra code is required from the user to manage them.
Required Attributes are the <strategy> tag attributes where the values of the blade will be stored. When a blade is visible all the related attributes must be specified in the <strategy> tag with a value (or empty string).
Some blades can be shown only if the parent blade is visible too.

Blade NameRequired Parent BladeAuto CodeRequired Related AttributesVariables
bet_unit nbet_unit_size@bet_unit_size (decimal)
use_percentagebet_unitnuse_percentage@use_percentage (bit)
daily_stop_profit ydaily_stop_profit_lower, daily_stop_profit_upper 
custom_option_1 ncustom_option_1_title, custom_option_1@custom_option_1 (bit)
custom_option_2 ncustom_option_2_title, custom_option_2@custom_option_2 (bit)
max_reset ymax_reset 
use_residual_capitalmax_resetyuse_residual_capital 
reset_levelsmax_resetyreset_level_lower, reset_level_upper 
playable_event_types yplayable_event_types 
playable_market_types yplayable_market_types 
playable_countries yplayable_countries 
playable_racecourses yplayable_racecourses 
betting_time_range ybetting_time_range_lower, betting_time_range_upper, betting_status 
event_time_range yevent_time_range_lower, event_time_range_upper, event_time_timezone 
runner_selector yselection_criteria, selection_criteria_string, selection_criteria_lower, selection_criteria_upper 
sql_expression ysql_expression 
sql_expression2 ysql_expression2 
sql_expression3 ysql_expression3 
count_of_bet ybets_per_market_criteria, max_market_trades, max_active_markets 
entry_bet_price_criteria yentry_bet_price_criteria, entry_bet_adjust, entry_bet_persistence 
entry_follow_criteriaentry_bet_price_criteriayentry_bet_follow_price, entry_bet_follow_price, entry_bet_update_interval 
back_odd_range yback_odd_range_lower, back_odd_range_upper 
lay_odd_range ylay_odd_range_lower, lay_odd_range_upper 
custom_range_1 ncustom_range_1_title, custom_range_1_lower, custom_range_1_upper@custom_range_1_lower (decimal), @custom_range_1_upper (decimal)
custom_range_2 ncustom_range_2_title, custom_range_2_lower, custom_range_2_upper@custom_range_2_lower (decimal), @custom_range_2_upper (decimal)
custom_range_7 ncustom_range_7_title, custom_range_7_lower@custom_range_7_lower (decimal)
custom_range_8 ncustom_range_8_title, custom_range_8_lower@custom_range_8_lower (decimal)
custom_option_3 ncustom_option_3_title, custom_option_3@custom_option_3 (bit)
custom_option_4 ncustom_option_4_title, custom_option_4@custom_option_4 (bit)
exit_bet_price_criteria yexit_bet_price_criteria, exit_bet_adjust, exit_bet_persistence 
exit_follow_criteriaexit_bet_price_criteriayexit_follow_criteria, exit_bet_follow_price, exit_bet_update_interval 
custom_range_3 ncustom_range_3_title, custom_range_3_lower, custom_range_3_upper@custom_range_3_lower (decimal), @custom_range_3_upper (decimal)
custom_range_4 ncustom_range_4_title, custom_range_4_lower, custom_range_4_upper@custom_range_4_lower (decimal), @custom_range_4_upper (decimal)
custom_range_5 ncustom_range_5_title, custom_range_5_lower, custom_range_5_upper@custom_range_5_lower (decimal), @custom_range_5_upper (decimal)
custom_range_6 ncustom_range_6_title, custom_range_6_lower, custom_range_6_upper@custom_range_6_lower (decimal), @custom_range_6_upper (decimal)
custom_range_9 ncustom_range_9_title, custom_range_9_lower@custom_range_9_lower (decimal)
custom_range_10 ncustom_range_10_title, custom_range_10_lower@custom_range_10_lower (decimal)
custom_option_5 ncustom_option_5_title, custom_option_5@custom_option_5 (bit)
custom_option_6 ncustom_option_6_title, custom_option_6@custom_option_6 (bit)
link_strategy ylink_strategy_id, link_criteria, link_amount 


ATTRIBUTES FOR CONTROLLING THE NUMBER OF TRADES
In most of the cases you can use the blade "count_of_bet" to manage the number of trades in a strategy. If this blade doesn't cover your needs you can use directly the following properties to achieve your goal.
A trade can have one of these statuses: O=open F=closed C=cancelled S=settled
only_first_bet_trigs_trade (y|n)If this option is equal to y, only the bet with index=1 can create a new trade. If this option is equal to n all the bets of the strategy can "open " a new trade. Default is y.
select_all (n|y)If this option is equal to y, when a horse is selected, all the other horses of the race are selected too. Default is n.
max_active_markets (+integer)Maximum number of markets the strategy can play simultaneously. Open and closed trades are included. Cancelled and settled trades are excluded.
max_market_trades (+integer)Maximum number of trades the strategy can create on one race. Open and closed trades are included, are excluded cancelled and settled trades.
max_market_open_trades (+integer)Maximum number of open trades the strategy can create on one race. Only open trades are included, closed, cancelled and settled trades are excluded.
max_selection_trades (+integer)Maximum number of trades the strategy can create on one selection (horse). Open and closed trades are included, cancelled and settled trades are excluded.
max_selection_open_trades (+integer)Maximum number of open trades the strategy can create on one selection. Only open trades are included, closed, cancelled and settled trades are excluded .


ATTRIBUTES FOR CONTROLLING THE VISIBILITY OF THE BETTING FRAME
The betting frame is shown when the user clicks on the columns "Back", "Lay" or "Input 3" from the runner grid in the Market window.
show_input_checks (y|n)If this option is equal to y and the strategy is currently selected, the runner grid will show a column with a checkbox for each runner.
show_input_back (y|n)If this option is equal to y and the strategy is currently selected, the runner grid will show the column "Input Back".
show_input_lay (y|n)If this option is equal to y and the strategy is currently selected, the runner grid will show the column "Input Lay".
show_input_3 (y|n)If this option is equal to y and the strategy is currently selected, the runner grid will show the column "Input 3".
show_betting_frame_back (y|n)If this option is equal to y, the strategy will open the Back Betting Frame when the user clicks on the column "Back".
It is possible to show/hide every element of the Back Betting Frame using the following attributes:
    show_auto_calculate_size_back (y|n)
  • show_follow_the_price_back (y|n)
  • show_invert_bl_back (y|n)
  • show_input_size_back (y|n)
  • show_input_persistence_back (y|n)
show_betting_frame_lay (y|n)If this option is equal to y, the strategy will open the Lay Betting Frame when the user clicks on the column "Lay".
It is possible to show/hide every element of the Lay Betting Frame using the following attributes:
    show_auto_calculate_size_lay (y|n)
  • show_follow_the_price_lay (y|n)
  • show_invert_bl_lay (y|n)
  • show_input_size_lay (y|n)
  • show_input_persistence_lay (y|n)
show_betting_frame_3 (y|n)If this option is equal to y, the strategy will open the Neutral Betting Frame when the user clicks on the column "Input 3".
It is possible to show/hide every element of the Neutral Betting Frame using the following attributes:
    show_auto_calculate_size_3 (y|n)
  • show_follow_the_price_3 (y|n)
  • show_invert_bl_3 (y|n)
  • show_input_size_3 (y|n)
  • show_input_persistence_3 (y|n)


ATTRIBUTES FOR PRE-FILTERING THE MARKETS
It is ideal to make use of more than one of these attributes. This will limit the processors effort when computing the conditions for the bets placement.
These attributes are automatically managed by Ipposnif when you add the blades: back_odd_range, lay_odd_range, betting_time_range.
back_odd_range_lower (decimal)Min allowed back price for the bet placement.
back_odd_range_upper (decimal)Max allowed back price for the bet placement.
lay_odd_range_lower (decimal)Min allowed lay price for the bet placement.
lay_odd_range_upper (decimal)Max allowed lay price for the bet placement.
betting_time_range_lower (time -/+HH:MM:SS)Minimum time at the start required to place a bet. For example if this value is -00:03:00 no bet will be placed before 3 minutes at the scheduled start of the race.
betting_time_range_upper (time -/+HH:MM:SS)Max seconds at the start required to place a bet. For example if this value is -00:01:00 (and betting_time_range_lower=-00:03:00) the bet will be placed only between 3 and 1 minute at the scheduled start of the race.


RESET ATTRIBUTES
In most of the cases, the reset functionality of a strategy, can be managed adding the blades max_reset and reset_levels.
If you have a special condition to reset a strategy, and it is not covered by the blades, then you must specify this condition in the attribute reset_condition.
Please consider that the maximum amount the strategy can lose is its capital multiplied by max_reset+1. The default value for max_reset is 0.
reset_condition (string)Sql assertion, when it is true the strategy will be reset.
max_reset (+integer)Maximum number of resets