Number of Selections as a Stored Value (Template) Guardian Automation Bot

Post Reply
User avatar
Dallas
Posts: 15262
Joined: Sun Aug 09, 2015 10:57 pm
Contact:

This is a basic Guardian automation template containing rules to derive the number of selections in a market into a Stored Value.

This example does nothing other than store a value named ‘selections’ with the number of selections there is in the market.

If you have existing rules that need to check or reference the number of selections/runners in a market as a stored value then you can simply copy the rules from this file into your existing file then add the appropriate conditions

For example you might want to stop a rule from triggering if a runner is withdrawn in the final minutes, you could therefore run these rules at the top of your file to find the number of runners several minutes before the off.
Then run another rule to test the number of runners every 30 seconds or so and compare the two values, if the latest value is less than the original it means a runner has been withdrawn, you can then use this to stop you rules and green up any open positions


How it Works

There are two rules in this file, the first rule triggers once and stores a value for the market named 'Selection' with an entered amount of 1
The next rule can trigger multiple times and stores a value named selections with an entered amount 1, plus another stored value named 'selections'

Effectively each time the second rule triggers on a selection its adding a value of 1 to the current stored value and therefore incrementing the value by 1 each selection it triggers on.

Because both rules are applied to 'ANY' selection, so that each selection is only counted once, when it triggers it also sets a signal on the selection named 'counted', the rules also have a 'Signal Set' condition to test the signal named 'counted on a selection is NOT set with a value.
ie, it checks if a selection has a signal set and if not it triggers on it and counts its as a stored value and at the same time sets a signal on it so its not counted a second time.


Using the File

To use the file just click on the following Number of Selections SV (Template).baf and this will download them to your computer, then with guardian open on the "Automation" tab click "Import a Rules File" as shown in the image, once imported it will now appear in the drop-down box just above, you can now apply them to any markets you have added into guardian.
Once you have it imported into your Guardian the stake size along with any other aspects of this file can be edited very easily by clicking on "Edit Rules File".

With any automation bot always run in practice mode first to ensure everything is working fine, and repeat this each time you make any changes.

To see a video tutorial on how to download and import an automation file into your Bet Angel please see this link
https://www.youtube.com/watch?v=g7Im4pj683g
You do not have the required permissions to view the files attached to this post.
User avatar
Dallas
Posts: 15262
Joined: Sun Aug 09, 2015 10:57 pm
Contact:

TIP

I have left the ticked at the bottom of the stored value tab so that you can see it write the number of selections to the log so you can confirm its working correctly. In the image below the file was applied to the 'Italian Serie A Outright Winner' market and you can see the final stored value named 'Selections' = 16
Which of course means there are 16 selections in this market.

Log.jpg


To keep your log tidy you can untick this box on both rules as shown below and it will not impact upon how the rules works.

SV Tab.jpg
You do not have the required permissions to view the files attached to this post.
firlandsfarm
Posts: 1296
Joined: Sat May 03, 2014 8:20 am

Hi Dallas, thanks for this … how can I now tie this into the Stall Draw? … I want to ID the outside Stall.
User avatar
Dallas
Posts: 15262
Joined: Sun Aug 09, 2015 10:57 pm
Contact:

firlandsfarm wrote:
Tue Apr 14, 2020 4:06 am
Hi Dallas, thanks for this … how can I now tie this into the Stall Draw? … I want to ID the outside Stall.
I'll need to have a think on what may be the best way as I don't think theres going to be any straight forward ways as the highest stall draw number won't necessarily be the number of runners.
Off the top of my head your going to need individual rules with a stall draw condition equal to 'X' to store values on each
firlandsfarm
Posts: 1296
Joined: Sat May 03, 2014 8:20 am

Dallas wrote:
Tue Apr 14, 2020 12:43 pm
firlandsfarm wrote:
Tue Apr 14, 2020 4:06 am
Hi Dallas, thanks for this … how can I now tie this into the Stall Draw? … I want to ID the outside Stall.
I'll need to have a think on what may be the best way as I don't think theres going to be any straight forward ways as the highest stall draw number won't necessarily be the number of runners.
Off the top of my head your going to need individual rules with a stall draw condition equal to 'X' to store values on each
Yeah, hadn't thought of that. Initially it's for the Dogs so a non-runner will leave an empty stall, yes. Could it be approached the other way round ... ID the runner with the highest Stall No.?
User avatar
Dallas
Posts: 15262
Joined: Sun Aug 09, 2015 10:57 pm
Contact:

firlandsfarm wrote:
Tue Apr 14, 2020 6:30 pm
Dallas wrote:
Tue Apr 14, 2020 12:43 pm
firlandsfarm wrote:
Tue Apr 14, 2020 4:06 am
Hi Dallas, thanks for this … how can I now tie this into the Stall Draw? … I want to ID the outside Stall.
I'll need to have a think on what may be the best way as I don't think theres going to be any straight forward ways as the highest stall draw number won't necessarily be the number of runners.
Off the top of my head your going to need individual rules with a stall draw condition equal to 'X' to store values on each
Yeah, hadn't thought of that. Initially it's for the Dogs so a non-runner will leave an empty stall, yes. Could it be approached the other way round ... ID the runner with the highest Stall No.?
If its only for dogs there going to be more options as there are only 6 stalls and 6 always on the outside (unless they differ overseas in Aus etc as I've never checked these).
But in terms ok UK dogs could you just apply a rule to Betfair row 6 (which would also be stall 6)
Then have another rule armed 0.5 secs later applied to Betfair row 5 with a 'Number of place bet triggers condition' equal to 0
ie, that rule will only trigger if the first hasn't

Then do the same for row 4
firlandsfarm
Posts: 1296
Joined: Sat May 03, 2014 8:20 am

Dallas wrote:
Tue Apr 14, 2020 7:40 pm
If its only for dogs there going to be more options as there are only 6 stalls and 6 always on the outside (unless they differ overseas in Aus etc as I've never checked these).
But in terms ok UK dogs could you just apply a rule to Betfair row 6 (which would also be stall 6)
Then have another rule armed 0.5 secs later applied to Betfair row 5 with a 'Number of place bet triggers condition' equal to 0
ie, that rule will only trigger if the first hasn't

Then do the same for row 4
Yes that would work to ID the 'most outside' trap with a runner but then my request goes the other way round … how do I check if it's the Fav (BTW in AUS it's 8 dogs to a standard race and I assume trap 8 is again the outside one). I'm looking to ID if the Fav. is in the outside trap. I thought this is no problem … sort in order of favouritism, count the number of selections and set a condition where the trap number for the Fav = the number of runners only to hit a wall when I found the Trap condition requires an entered number and not a SV.

So it seems my problem is I can find the Fav but don't know if it's in the outside trap or I can find the outside trap but don't know if it's the Fav! Is there a way I can sort in Betfair/trap order, somehow 'mark' the selection in the outside trap with a Signal or SV and then re-sort in order of favouritism and see if the favourite has the mark? I've not done a re-sort before but I'm thinking the logic is good! :)
User avatar
Dallas
Posts: 15262
Joined: Sun Aug 09, 2015 10:57 pm
Contact:

firlandsfarm wrote:
Tue Apr 14, 2020 9:29 pm
Dallas wrote:
Tue Apr 14, 2020 7:40 pm
If its only for dogs there going to be more options as there are only 6 stalls and 6 always on the outside (unless they differ overseas in Aus etc as I've never checked these).
But in terms ok UK dogs could you just apply a rule to Betfair row 6 (which would also be stall 6)
Then have another rule armed 0.5 secs later applied to Betfair row 5 with a 'Number of place bet triggers condition' equal to 0
ie, that rule will only trigger if the first hasn't

Then do the same for row 4
Yes that would work to ID the 'most outside' trap with a runner but then my request goes the other way round … how do I check if it's the Fav (BTW in AUS it's 8 dogs to a standard race and I assume trap 8 is again the outside one). I'm looking to ID if the Fav. is in the outside trap. I thought this is no problem … sort in order of favouritism, count the number of selections and set a condition where the trap number for the Fav = the number of runners only to hit a wall when I found the Trap condition requires an entered number and not a SV.

So it seems my problem is I can find the Fav but don't know if it's in the outside trap or I can find the outside trap but don't know if it's the Fav! Is there a way I can sort in Betfair/trap order, somehow 'mark' the selection in the outside trap with a Signal or SV and then re-sort in order of favouritism and see if the favourite has the mark? I've not done a re-sort before but I'm thinking the logic is good! :)
If its just the fav in the outside trap your after i think you may have over thought it.

If you create a rule applied to row 8 (or 6 for UK) then add a 'Relative Odds Condition'
The selections price
is less than
the price
of Betfair order of favourtism 2
minus 1 tick

Thats basically testing the runner in row 8 is priced less than the 2nd fav, ie, its the favourite
firlandsfarm
Posts: 1296
Joined: Sat May 03, 2014 8:20 am

Dallas wrote:
Tue Apr 14, 2020 9:38 pm
If its just the fav in the outside trap your after i think you may have over thought it.

If you create a rule applied to row 8 (or 6 for UK) then add a 'Relative Odds Condition'
The selections price
is less than
the price
of Betfair order of favourtism 2
minus 1 tick

Thats basically testing the runner in row 8 is priced less than the 2nd fav, ie, its the favourite
Hey that sounds good Dallas, I must admit I wasn't aware of the dropdown for selecting the comparative runner. Thanks. But I would still like to think how I can do similar for horses where the outside stall is variable or where the outside dog is a non-runner. I will try my last suggestion this morning in Practice Mode with some Aussie races.
User avatar
tootatoota
Posts: 29
Joined: Fri Apr 17, 2020 2:33 am

Hi,
In Australian dog racing we have 8 runners.
If i wanted to lay say Box4(Trap4) which is also Number 4,how do i do that given that if there is a scratching Number 4 is now in row 3?
I cant manually do this as it is part of Automation.
Is there a way of backing or laying numbers ?
Someone said excel attachment but my capabilities dont go that far and given i would like to use SP its hard.
My bot is set up but the number thing has me Bamboozled.
Thanks Toota
Post Reply

Return to “Bet Angel Automation - General”