Action based on the largest or smallest of a series of Stored Values

Advanced automation available in Guardian - Chat with others and share files here.
Post Reply
User avatar
firlandsfarm
Posts: 3321
Joined: Sat May 03, 2014 8:20 am

The heading probably doesn't explain my problem very well so let me set out an example …

Assume you have calculated a Stored Value for each runner. How can you select the runner with the largest Stored Value and/or the runner with the smallest Stored Value to place a bet on that runner? OK, let's stupidly assume I have a rule that calculates a Stored Value for each runner as (Stall Draw) x (Back Price) and I then want to identify the runner with the lowest Stored Value based on that calculation … It may be stupid but is it possible? I can do it with Excel by having a column for the calculation, compare the results to find the minimum (or maximum) value and then identify the runner with that minimum (or maximum) value but I'm wondering if it's possible with Automation.
sniffer66
Posts: 1816
Joined: Thu May 02, 2019 8:37 am

I asked the same a while ago. It was Sa7med that gave me the answer

Try this - take a value way outside the range of your SV's then compare each one in turn. I posted a baf with how I did it on this thread

viewtopic.php?f=37&t=19118&p=192197#p192197

Edit: Actually, that will give you the lowest/largest SV in your range. You'd have to find a way to relate that back to a runner
User avatar
firlandsfarm
Posts: 3321
Joined: Sat May 03, 2014 8:20 am

sniffer66 wrote:
Mon Dec 09, 2019 4:11 pm
Edit: Actually, that will give you the lowest/largest SV in your range. You'd have to find a way to relate that back to a runner
Thanks sniffer, it's the relating back that I think is the problem. I'll have a read of that thread and see if it switches on any cells. :)

UPDATE: Yep, I saw a picture in my mind how to 'relate back' and the baf file you posted confirmed my image would work. Basically I see it as …

1. Freeze all relevant current values by creating Stored Values (SV) for each runner
2. Assign the SV for the first runner to a common SV
3. Compare each runner's SV with the common SV and assign the runner's SV to the common SV if higher (for largest) or lower (if smallest)
4. The common SV will equal the largest/smallest runner SV after one pass through all runners
5. Place your bet conditional on the runner's SV being equal to the common SV :)

I like it, obvious really … with thanks and acknowledgements to sa7med as the author of the process and to you for bringing it to my attention.
JTulley
Posts: 8
Joined: Wed May 15, 2019 1:25 pm

In case it's an issue I think that this technique might occasionally select multiple selections e.g. if the favourite and second favourite have the same odds ( I guess it would be joint favourites in that case)
I'm sure you could add a clause to check for this if it is an issue.
sniffer66
Posts: 1816
Joined: Thu May 02, 2019 8:37 am

firlandsfarm wrote:
Mon Dec 09, 2019 5:04 pm
sniffer66 wrote:
Mon Dec 09, 2019 4:11 pm
Edit: Actually, that will give you the lowest/largest SV in your range. You'd have to find a way to relate that back to a runner
Thanks sniffer, it's the relating back that I think is the problem. I'll have a read of that thread and see if it switches on any cells. :)

UPDATE: Yep, I saw a picture in my mind how to 'relate back' and the baf file you posted confirmed my image would work. Basically I see it as …

1. Freeze all relevant current values by creating Stored Values (SV) for each runner
2. Assign the SV for the first runner to a common SV
3. Compare each runner's SV with the common SV and assign the runner's SV to the common SV if higher (for largest) or lower (if smallest)
4. The common SV will equal the largest/smallest runner SV after one pass through all runners
5. Place your bet conditional on the runner's SV being equal to the common SV :)

I like it, obvious really … with thanks and acknowledgements to sa7med as the author of the process and to you for bringing it to my attention.
Nice one. I had a think through it after your post but hadn't quite grasped it. Matching the common SV to the runners actual does it :)
Post Reply

Return to “Bet Angel - Automation”