Question around using Stored Values to Influence the Stake Placed

Advanced automation available in Guardian - Chat with others and share files here.
User avatar
jamesedwards
Posts: 3948
Joined: Wed Nov 21, 2018 6:16 pm

smgreyuk wrote:
Mon Oct 14, 2024 9:28 pm
Hmm

Could this work?

Screenshot 2024-10-14 212159.png

It's a Stored Value Changed Condition on the actual dutching rules. I am thinking that it checks to see if the "Counter" SV has changed in the last hour (1 second to 3600 seconds, or maybe even 99999 seconds, whatever the highest value can be used) only if it has changed then it puts the dutch back bets on... granted some races will be missed with this approach but at least it avoids putting incorrect stakes on

... I am not sure if this would work for when Counter is initialised at the start of the session (as in it's the first race of the day, Counter is initialised to 0, would it consider NULL to 0 as a change?) -

ADDITIONAL
According to the user guide:

"Note: The creation of a Stored Value will be considered as a ‘change’"

So this does sound promising, I just want to get your take on the approach first
Do you want to ignore a race when the previous race has not yet reported a P&L? If so then you could use a stored value at Bet Angel level, say "market_open" to = 1 on the condition that [matched bets >0] AND [market status = "open" OR "suspended"]. Then make it so "market_open" is cleared on condition that the market status = "closed".

Then make it so your triggers have a condition that the SV "market_open" must not be set.
smgreyuk
Posts: 98
Joined: Tue Jul 30, 2024 4:20 pm

Hi James Edwards,

Thank you, I think I have implemented what you said:
Dutch Favourite 2 with 2.0 to 5.0 combined v3.baf
This in its current state is not triggering any race - I have just had the race Perry Barr at 15:51 that should have qualified to have been dutched but it hasn't - Could you please take a look when you get a moment? Thank you ever so much :-)

... then you could use a stored value at Bet Angel level, say "market_open" to = 1 on the condition that [matched bets >0] AND [market status = "open" OR "suspended"] - Here I have used the rule "Initialise Market Open to One" It initialises the value of this new SV to 1 on the conditions you specified - It's been put in the 2nd half of the rules

Then make it so "market_open" is cleared on condition that the market status = "closed". - Here I have used "Clear Market Open" with the condition that when the market status is closed to clear "market open" - This too has been put in the 2nd half of the rules

Then make it so your triggers have a condition that the SV "market_open" must not be set. - Finally with any rule that is prefixed with the word "Dutch" I have added the Stored Value Condition to trigger when the market_open SV is NOT set with a value (along with the other conditions that were already there)

When I have looked it looks as though the "Initialise Market Open to One" rule doesn't get triggered
- Just to note the "Clear market open" rule DID get triggered
You do not have the required permissions to view the files attached to this post.
User avatar
jamesedwards
Posts: 3948
Joined: Wed Nov 21, 2018 6:16 pm

smgreyuk wrote:
Tue Oct 15, 2024 3:49 pm
Hi James Edwards,

Thank you, I think I have implemented what you said:

Dutch Favourite 2 with 2.0 to 5.0 combined v3.baf

This in its current state is not triggering any race - I have just had the race Perry Barr at 15:51 that should have qualified to have been dutched but it hasn't - Could you please take a look when you get a moment? Thank you ever so much :-)

... then you could use a stored value at Bet Angel level, say "market_open" to = 1 on the condition that [matched bets >0] AND [market status = "open" OR "suspended"] - Here I have used the rule "Initialise Market Open to One" It initialises the value of this new SV to 1 on the conditions you specified - It's been put in the 2nd half of the rules

Then make it so "market_open" is cleared on condition that the market status = "closed". - Here I have used "Clear Market Open" with the condition that when the market status is closed to clear "market open" - This too has been put in the 2nd half of the rules

Then make it so your triggers have a condition that the SV "market_open" must not be set. - Finally with any rule that is prefixed with the word "Dutch" I have added the Stored Value Condition to trigger when the market_open SV is NOT set with a value (along with the other conditions that were already there)

When I have looked it looks as though the "Initialise Market Open to One" rule doesn't get triggered
- Just to note the "Clear market open" rule DID get triggered
It looks ok to me, although I might be missing something.

You're only allowing a 3 second window for bets to be placed. Are you sure your markets are refreshing frequently enough in Guardian for the market to be refreshed within that 3 second period? Try increasing the window, or reducing the number of markets loaded in Guardian, or increasing the Guardian refresh interval to the max of 20ms, or use the restrict refresh option to reduce the number of markets guardian is cycling through at any given moment.
smgreyuk
Posts: 98
Joined: Tue Jul 30, 2024 4:20 pm

I did check later on and some races did trigger/

I have:

- Increased the dutching triggers from 3 seconds before the race to 15 seconds before the race

- I have also increased the refresh interval from 200ms to 20ms.

I'll see how it gets on with these changes, and i can use the other changes you suggested to increase the chances.

Thank you
User avatar
jamesedwards
Posts: 3948
Joined: Wed Nov 21, 2018 6:16 pm

smgreyuk wrote:
Tue Oct 15, 2024 8:27 pm
I did check later on and some races did trigger/

I have:

- Increased the dutching triggers from 3 seconds before the race to 15 seconds before the race

- I have also increased the refresh interval from 200ms to 20ms.

I'll see how it gets on with these changes, and i can use the other changes you suggested to increase the chances.

Thank you
The refresh interval dictates approximately how long Guardian will take to cycle through each loaded market. So if you have 50 markets loaded at a refresh rate of 200ms it would take 10 secs to cycle through all markets. At 20ms it would take only 1 second.
smgreyuk
Posts: 98
Joined: Tue Jul 30, 2024 4:20 pm

Hi James Edwards,

Hit the same issue as before (with V3 - The included Market Open SV) - According to the logs between two races it has put the dutching bets on the next race before the counter has had a chance to increment:


3rd race of the day at 12:00PM - Dutch back bets on next race occurs
2nd race of the day at 12:02PM - Increment occurs but the 3rd race has already had the dutch back bets applied.

This would suggest that the market_open SV isn't preventing the wrong counter integers being implemented

Could an alternative Condition for when Counter is changed be considered an approach to use? Unless there is an error in the way market_open is working
User avatar
jamesedwards
Posts: 3948
Joined: Wed Nov 21, 2018 6:16 pm

smgreyuk wrote:
Wed Oct 16, 2024 3:00 pm
Hi James Edwards,

Hit the same issue as before (with V3 - The included Market Open SV) - According to the logs between two races it has put the dutching bets on the next race before the counter has had a chance to increment:


3rd race of the day at 12:00PM - Dutch back bets on next race occurs
2nd race of the day at 12:02PM - Increment occurs but the 3rd race has already had the dutch back bets applied.

This would suggest that the market_open SV isn't preventing the wrong counter integers being implemented

Could an alternative Condition for when Counter is changed be considered an approach to use? Unless there is an error in the way market_open is working
Why do you want to do this? You're always going to run into timing issues. What happens if a race is delayed by 30 mins or more? Do you really want all the scheduled races following to be deferred until the delayed race is complete? And the result of one race is in no way connected to the result of the previous race either, especially as they will be different tracks.
smgreyuk
Posts: 98
Joined: Tue Jul 30, 2024 4:20 pm

To make money.

I’m simply looking at statistical probabilities.

I’ll go with the Counter SV approach whereby if the counter has changed then I’d want it to place the dutched back bets, this way when the counter remains the same value with no change, it simply means the race beforehand hasn’t had its P+L calculated which is what I am after.

I feel like I’ve asked a lot of you so you don’t have to keep trying to help me, especially when I know you don’t agree with this approach. Thank you for all the support you’ve given me, I’ve learnt a lot along the way
Last edited by smgreyuk on Wed Oct 16, 2024 3:42 pm, edited 1 time in total.
User avatar
jamesedwards
Posts: 3948
Joined: Wed Nov 21, 2018 6:16 pm

smgreyuk wrote:
Wed Oct 16, 2024 3:31 pm
...I’ve learnt a lot along the way
That's what it's all about! 8-)
User avatar
jamesedwards
Posts: 3948
Joined: Wed Nov 21, 2018 6:16 pm

Try this. I've rewritten it to prevent any market triggering until the previously triggered market is closed.

I haven't tested it very thoroughly. Make sure you run it in practice mode to make sure it does what you expect.
Dutch Favourite 2 with 2.0 to 5.0 combined v5.baf
You do not have the required permissions to view the files attached to this post.
smgreyuk
Posts: 98
Joined: Tue Jul 30, 2024 4:20 pm

Thank you James, I shall give this a go
smgreyuk
Posts: 98
Joined: Tue Jul 30, 2024 4:20 pm

I think you've cracked it - I did have to make just one change to get it working: The "Reset market_open to 0" SV was storing for "The Market" and no races were getting triggered, so I changed this to "Bet Angel" and it has now been doing what's needed for the past hour or so now.

Interesting to have

a) The Conditions for the Dutch Back Bets for "Market Open" to be only for the 2nd favourites
and
b) The storing of "market_open" set to both The Market and Bet Angel

But hey, it works.

I see you've put the Set "market_open to 0" and "Set Counter to 0" SVs to the top of the rule list now too.

Massive thank you James Edwards
smgreyuk
Posts: 98
Joined: Tue Jul 30, 2024 4:20 pm

Hi again James Edwards

I had a full day (Friday) of testing with nothing going wrong.

However today (Saturday) it was going along great then just after 7PM the counter starts going wrong.

Doncaster 19:04 ( a win with counter at 2) - This should have made the counter at 0 for the next race

Monmore 19:06 Counter is still at 2!!! (Should be 0) and a loss occurs

Hove 19:16 The Counter is now at 1!! Which means I think its' correct from the 19:04 race, I think - It wins here (19:06 market value may have come in later)
__________
Then a bit later Oxford 19:51 we get a loss with the counter at 1

Then Perry Barr 19:53 another loss with the counter still at 1 !!!? (Should be 2)
___________
Then Romford 19:59 Counter at 2 with a win (Should be 2)

Then Central Park 20:01 another win with he counter at 2! (Should be 0)

At the time it went wrong I noticed some "Market P&L" values were ahead of others (for example Oxford 19:51's value wasn't present but Perry Barr's 19:53 was, so that may be the reason for the it going wrong, but I would have thought the "market_open" variable would have sorted this...

If it's nothing to do with the market values of later races coming in earlier than earlier races, then I haven't got a clue where this is going wrong - any ideas?
smgreyuk
Posts: 98
Joined: Tue Jul 30, 2024 4:20 pm

What I’m guessing is a race prior is in a state of Suspended/Closed but the p/l at rare times isn’t calculated , market_open goes to zero the next race jumps in without any change to the Counter

Maybe a check on “market P&L” being NULL or not and it behaves the same way the market_open SV behaves
(Or maybe a condition of market P&L being set added to storing market_open= 0 again) As in if market p&l is NULL all other races are locked out until the last value has been calculated?

I have gone for this and will test it on the races today (which is the additional SV I have spoken about above added to the market_open = 0 conditions) :
Screenshot 2024-10-20 043835.png
You do not have the required permissions to view the files attached to this post.
smgreyuk
Posts: 98
Joined: Tue Jul 30, 2024 4:20 pm

Grrr, still wrong, the counter still misbehaved today between Yarmouth 11:01 and Doncaster 11:21.

After the win at Yarmouth it showed have reset from 1 back to 0, but the counter is still at 1 for the Doncaster race.

I just don't understand how this is has happened based on the timings of the Automation Rules:

11:00:48 - Dutching for Yarmouth happens with the Counter at 1 (Correct)

11:04:00 - The Counter is reset (Correct)

11:11:32 - The Counter from a previous race (Doncaster 10:48) gets incremented at this time for the earlier loss! (Incorrect)

11:20:46 - Dutching for Doncaster happens with the Counter STILL at 1 (Incorrect)


So basically timings from earlier races are messing this up - I am out of ideas to make this run in proper order and locking out other races until every function of automation has happened.
Post Reply

Return to “Bet Angel - Automation”