micke
New Member
Posts: 44
|
Post by micke on Sept 21, 2020 8:12:49 GMT
Thanks for a good program and sorry for my english! I struggling with an automation of LTD. I have odds and time criteria but I want one more condition. I want the program to only pick the matches there It is 60 ticks between the fav and the underdog. For example: The odds for the fav Is 2 and the underdogs odds is 60+ ticks higher.
How/can I do that?
|
|
|
Post by Ipposnif on Sept 21, 2020 9:00:35 GMT
Hi Micke, it is possible to calculate the difference in ticks between the first favorite LAY price and the second favorite LAY price of the match, but in the middle, you will find also "The Draw".
dbo.fn_TickDiff(dbo.fn_GetPrice(@id_race , @id_favourite_1, 'l', 1), dbo.fn_GetPrice(@id_race , @id_favourite_2, 'l', 1)) > 60
it must be inserted in Bet Trigger Condition. If there are other conditions already present, append the expression with an AND. You can also have the difference in %, replacing fn_TickDiff with fn_TickPerc
If you want to exclude "The Draw" it is needed a custom function, so in the next post, I take this opportunity to explain how to add a personal function to Ipposnif.
|
|
micke
New Member
Posts: 44
|
Post by micke on Sept 21, 2020 9:05:27 GMT
Thanks! And yes I want to exclude "The draw"
|
|
|
Post by Ipposnif on Sept 21, 2020 9:58:16 GMT
To use a new function from the strategies, first, you have to create the function in the Ipposnif DB: open Tools -> Database Command, copy/paste the following code in the top text area, and press "Execute". CREATE FUNCTION [dbo].[fn_TeamsPriceGap] (@id_race int) RETURNS int AS BEGIN DECLARE @p1 NUMERIC(18,2) DECLARE @p2 NUMERIC(18,2)
SELECT TOP 1 @p1=l1_price FROM tbl_Races_Horses WHERE ID_Race=@id_race and RunnerName<>'The Draw' ORDER BY l1_price SELECT TOP 1 @p2=l1_price FROM tbl_Races_Horses WHERE ID_Race=@id_race and RunnerName<>'The Draw' ORDER BY l1_price desc return dbo.fn_tickdiff(@p1, @p2) ENDThe function is now present in the Ipposnif DB. You have to do again this operation, every time you reinstall the program, or you perform a Hard Reset. Now you can use this function from a strategy with the syntax: dbo.fn_TeamsPriceGap(@id_race) > 60The function is not filtering the market type (in our case MATCH_ODDS), because this is demanded to the criteria "Market Types" (1). So this function will work with all the Soccer Market Types that have two selections (the teams) plus "The Draw" selection. Few comments on this function: CREATE must be replaced with ALTER if you want to "Execute" again the code with some changes. There is only one parameter in input, @id_race, that is a special variable passed to the function and replaced automatically by Ipposnif. It contains the id of the market checked at that moment. tbl_Races_Horses is a table that contains the best 5 prices of each runner (and a lot of other info), we take the smaller best LAY price and the bigger best LAY price of the match excluding the selection "The Draw". Finally, we calculate and return the difference in ticks, using an already present Ipposnif function. p.s. The naming of some variables and tables is slightly wrong and it comes from the first version of Ipposnif that was working only on Horse Racing WIN markets. @id_race should be called @id_market, and the table [tbl_Races_Horses] should be called [tbl_Markets_Selections], but their names have never been changed (yet) to keep compatibility with the old core functionalities.
|
|
micke
New Member
Posts: 44
|
Post by micke on Sept 21, 2020 10:15:11 GMT
Thanks alot! I think I have done It right, will let you know how/If It works!
|
|