Automating an odds range (Horse racing)

We were all new to Bet Angel once. Ask any question you like here and fellow forum members promise not to laugh. Betfair trading made simple.
Post Reply
JimmyH
Posts: 37
Joined: Wed Dec 26, 2018 1:48 pm

Hi all.

I am looking to automate every/a number horses in a race that fall within a particular odds range.

So when the market suspends at the off, I want to take the last traded price 15 seconds before the market suspended, on for example the 3rd to 5th favourites as long as the BSP odds for each horse are greater than or equal to say 4.0, but less than or equal to 8.0.

So if the 3rd favourites BSP was 3.0 no bet will be placed, 4th favourite BSP @ 5.0 bet placed and 5th Favourite BSP 9.0 not placed Etc.

I have been searching through the conditions etc, and I thought this could be done.
User avatar
Dallas
Posts: 23591
Joined: Sun Aug 09, 2015 10:57 pm

Use the 'Fixed Odds' condition to test the price is greater, less than or between two price
https://www.betangel.com/user-guide/fixed_odds.html

To use an historical price ie, one from 'X' seconds ago you'll first need to store that price as a stored value, by triggering a 'Set/Modify Stored Value' rule 15 second before the start time
https://www.betangel.com/user-guide/stored_values.html

Then have your bet 'Place at' the value held by that stored value
https://www.betangel.com/user-guide/pla ... ters_.html
JimmyH
Posts: 37
Joined: Wed Dec 26, 2018 1:48 pm

Dallas wrote:
Mon Aug 04, 2025 1:11 pm
Use the 'Fixed Odds' condition to test the price is greater, less than or between two price
https://www.betangel.com/user-guide/fixed_odds.html

To use an historical price ie, one from 'X' seconds ago you'll first need to store that price as a stored value, by triggering a 'Set/Modify Stored Value' rule 15 second before the start time
https://www.betangel.com/user-guide/stored_values.html

Then have your bet 'Place at' the value held by that stored value
https://www.betangel.com/user-guide/pla ... ters_.html
Thank you very much Dallas.
rkuk
Posts: 28
Joined: Sat Jun 28, 2025 8:29 pm

I came on here to ask something similar after watching one of Peter's videos where he ran automation on (I think) the first horse at values of 5. I was wondering how it was done as I am completely new to automation and thought this might be a good way to learn and see what results it returns.

Prior to coming on here I thought I would take a step by step approach on the process and I think I got a couple of the values correct but when I applied it today, nothing worked so I'm missing some stuff.

I was looking to trigger the rule 10 seconds before the race start to look for the first horse between certain values and place a bet with offset ticks and greening once in play in the hope that the orders will be filled and hedge the bet.

This is what I worked through:

General
Chose event start time and before event then the times 00:00:10 (for 10 secs before), and until 00:10:00 after event, but maybe I don't need this? It looks like some closing time values are needed though?

Allow rule to trigger up to 1 time.

Applies selection I chose 'in position 1 (sorted in order of favouritism), as I'm looking for the first horse between the values I chose.

Parameters
Fixed price - I picked some odds (but this might be wrong if I'm trying to select between a range?)
Stake fixed amount.
Global actions, offset with greening and a number of ticks

Conditions
Number of selections = 1 (guessing this would pick one horse)
Then my prices greater than X and less than Y

And I hoped that would do it but nothing worked. Clearly I have some things wrong.

I'm sure this is easy peasy stuff to the professionals, please feedback as though to a simpleton if anyone is able to help.

Thanks in advance :)
User avatar
jamesedwards
Posts: 4360
Joined: Wed Nov 21, 2018 6:16 pm

rkuk wrote:
Tue Sep 02, 2025 9:28 pm
I came on here to ask something similar after watching one of Peter's videos where he ran automation on (I think) the first horse at values of 5. I was wondering how it was done as I am completely new to automation and thought this might be a good way to learn and see what results it returns.

Prior to coming on here I thought I would take a step by step approach on the process and I think I got a couple of the values correct but when I applied it today, nothing worked so I'm missing some stuff.

I was looking to trigger the rule 10 seconds before the race start to look for the first horse between certain values and place a bet with offset ticks and greening once in play in the hope that the orders will be filled and hedge the bet.

This is what I worked through:

General
Chose event start time and before event then the times 00:00:10 (for 10 secs before), and until 00:10:00 after event, but maybe I don't need this? It looks like some closing time values are needed though?

Allow rule to trigger up to 1 time.

Applies selection I chose 'in position 1 (sorted in order of favouritism), as I'm looking for the first horse between the values I chose.

Parameters
Fixed price - I picked some odds (but this might be wrong if I'm trying to select between a range?)
Stake fixed amount.
Global actions, offset with greening and a number of ticks

Conditions
Number of selections = 1 (guessing this would pick one horse)
Then my prices greater than X and less than Y

And I hoped that would do it but nothing worked. Clearly I have some things wrong.

I'm sure this is easy peasy stuff to the professionals, please feedback as though to a simpleton if anyone is able to help.

Thanks in advance :)
Attach your rulefile here and someone will probably be able to spot the issue.
rkuk
Posts: 28
Joined: Sat Jun 28, 2025 8:29 pm

jamesedwards wrote:
Tue Sep 02, 2025 10:45 pm
rkuk wrote:
Tue Sep 02, 2025 9:28 pm
I came on here to ask something similar after watching one of Peter's videos where he ran automation on (I think) the first horse at values of 5. I was wondering how it was done as I am completely new to automation and thought this might be a good way to learn and see what results it returns.

Prior to coming on here I thought I would take a step by step approach on the process and I think I got a couple of the values correct but when I applied it today, nothing worked so I'm missing some stuff.

I was looking to trigger the rule 10 seconds before the race start to look for the first horse between certain values and place a bet with offset ticks and greening once in play in the hope that the orders will be filled and hedge the bet.

This is what I worked through:

General
Chose event start time and before event then the times 00:00:10 (for 10 secs before), and until 00:10:00 after event, but maybe I don't need this? It looks like some closing time values are needed though?

Allow rule to trigger up to 1 time.

Applies selection I chose 'in position 1 (sorted in order of favouritism), as I'm looking for the first horse between the values I chose.

Parameters
Fixed price - I picked some odds (but this might be wrong if I'm trying to select between a range?)
Stake fixed amount.
Global actions, offset with greening and a number of ticks

Conditions
Number of selections = 1 (guessing this would pick one horse)
Then my prices greater than X and less than Y

And I hoped that would do it but nothing worked. Clearly I have some things wrong.

I'm sure this is easy peasy stuff to the professionals, please feedback as though to a simpleton if anyone is able to help.

Thanks in advance :)
Attach your rulefile here and someone will probably be able to spot the issue.
Hi James

As advised (I think?) no laughing everyone!
You do not have the required permissions to view the files attached to this post.
User avatar
jamesedwards
Posts: 4360
Joined: Wed Nov 21, 2018 6:16 pm

rkuk wrote:
Wed Sep 03, 2025 8:19 am
jamesedwards wrote:
Tue Sep 02, 2025 10:45 pm
rkuk wrote:
Tue Sep 02, 2025 9:28 pm
I came on here to ask something similar after watching one of Peter's videos where he ran automation on (I think) the first horse at values of 5. I was wondering how it was done as I am completely new to automation and thought this might be a good way to learn and see what results it returns.

Prior to coming on here I thought I would take a step by step approach on the process and I think I got a couple of the values correct but when I applied it today, nothing worked so I'm missing some stuff.

I was looking to trigger the rule 10 seconds before the race start to look for the first horse between certain values and place a bet with offset ticks and greening once in play in the hope that the orders will be filled and hedge the bet.

This is what I worked through:

General
Chose event start time and before event then the times 00:00:10 (for 10 secs before), and until 00:10:00 after event, but maybe I don't need this? It looks like some closing time values are needed though?

Allow rule to trigger up to 1 time.

Applies selection I chose 'in position 1 (sorted in order of favouritism), as I'm looking for the first horse between the values I chose.

Parameters
Fixed price - I picked some odds (but this might be wrong if I'm trying to select between a range?)
Stake fixed amount.
Global actions, offset with greening and a number of ticks

Conditions
Number of selections = 1 (guessing this would pick one horse)
Then my prices greater than X and less than Y

And I hoped that would do it but nothing worked. Clearly I have some things wrong.

I'm sure this is easy peasy stuff to the professionals, please feedback as though to a simpleton if anyone is able to help.

Thanks in advance :)
Attach your rulefile here and someone will probably be able to spot the issue.
Hi James

As advised (I think?) no laughing everyone!
The problems lie in your conditions;
> The 'number of selections' condition is the number of selections in the market, so your condition that this must equal 1 will prevent it from triggering in any market as there are always at least two selections in any Betfair market.
> You've nominated the position 1 fav which means to trigger against that selection they must be the race favourite at that moment AND must be between 4.6 and 5.1 odds, which is unlikely ever to trigger in most races.

Probably the easiest way to do this is apply to selection "any" with just the price parameters in conditions. This will place a bet on the first selection that it gets to that sits within your price band requirement. If you only want to place your bet before the off then probably worth adding a 'not in-play' condition also.
rkuk
Posts: 28
Joined: Sat Jun 28, 2025 8:29 pm

Hi James,
Thank you so much at looking at this for me - really appreciated :)

OK, the first part of nominations makes sense now. I have removed that altogether.

Changed to 'any selection' for both the > and under values (nearly only did one of those!)

Will it only target the first instance between my values as I set to trigger once on the 'general tab'?

Also, where do I select the not in play part? And in doing so, will it retain the closing trades which need to be in play?....well I suppose they don't always need to be in play to be a success really. But before the in play activity I need an entry time. I just set that to 10 seconds to get the closest time to start without missing out. So I maybe just need a bit of guidance on these bits.

Then I can give it a road test today in practice mode and see what happens! :)

Thanks again!
User avatar
jamesedwards
Posts: 4360
Joined: Wed Nov 21, 2018 6:16 pm

rkuk wrote:
Thu Sep 04, 2025 11:06 am
Hi James,
Thank you so much at looking at this for me - really appreciated :)

OK, the first part of nominations makes sense now. I have removed that altogether.

Changed to 'any selection' for both the > and under values (nearly only did one of those!)

Will it only target the first instance between my values as I set to trigger once on the 'general tab'?

Also, where do I select the not in play part? And in doing so, will it retain the closing trades which need to be in play?....well I suppose they don't always need to be in play to be a success really. But before the in play activity I need an entry time. I just set that to 10 seconds to get the closest time to start without missing out. So I maybe just need a bit of guidance on these bits.

Then I can give it a road test today in practice mode and see what happens! :)

Thanks again!
Practise mode is the best way to learn as you can try things out and see for yourself how they work.

If you use ANY then (per retrigger) it will execute once and stop once it finds a selection that matches. If you use EVERY then it will execute for all selections that match the criteria.
rkuk
Posts: 28
Joined: Sat Jun 28, 2025 8:29 pm

SO I got it to work / trigger - whoop, but....it's just picked the favourite and the odds were less than 3. So I've still got something wrong somewhere. Looked like it tiggered before the off, I wondered if it was simply muddling the > and < symbols but the options let you click greater and less, so it can't be that.
rkuk
Posts: 28
Joined: Sat Jun 28, 2025 8:29 pm

Looks like it also triggered twice. I won £20 practice money, so some nice mistakes.
User avatar
jamesedwards
Posts: 4360
Joined: Wed Nov 21, 2018 6:16 pm

rkuk wrote:
Thu Sep 04, 2025 2:43 pm
Looks like it also triggered twice. I won £20 practice money, so some nice mistakes.
Attach the rulesfile.
rkuk
Posts: 28
Joined: Sat Jun 28, 2025 8:29 pm

Think that's the updated one.
Sorry for all this James, appreciate it's back and forth and I'm probably missing something very obvious that you have told me.
Thanks for bearing with me as I learn the basics.
You do not have the required permissions to view the files attached to this post.
User avatar
jamesedwards
Posts: 4360
Joined: Wed Nov 21, 2018 6:16 pm

rkuk wrote:
Thu Sep 04, 2025 8:25 pm
Think that's the updated one.
Sorry for all this James, appreciate it's back and forth and I'm probably missing something very obvious that you have told me.
Thanks for bearing with me as I learn the basics.
Change both the 'fixed odds conditions' to "Current ( ANY selection )".

You're currently asking it to the check each price condition against any selection rather than against itself.
rkuk
Posts: 28
Joined: Sat Jun 28, 2025 8:29 pm

Thanks again James, reading back through the thread and your replies it looks like you told me that but I misunderstood as I clicked on the 'parameters' tab. Apols if it's a bit frustrating repeating.

Excited to giving it a go today and see what results I get.

Whilst I'm on, when I record the logs / excel files, they save as individual records (obviously), but does anyone know if there's a way that a master spreadsheet could look inside them all and report the results in one go for the day to save me manually going in and checking. Or perhaps there's another way that's even easier that I don't know about? Could anyone point me to anything?
Post Reply

Return to “Bet Angel for newbies / Getting started”