Help with Stored Values

Advanced automation available in Guardian - Chat with others and share files here.
Post Reply
uksoundz
Posts: 27
Joined: Thu Jun 24, 2010 5:51 pm

Hi all, I'm trying to build a simple in-play scalping strategy in automation, and I’m stuck trying to replicate the following logic using BA.

I want to check if a horse's Last Traded Price has increased by say 15% or more compared to what it was 3 seconds ago.
Example: if it was 6.0 and now it’s 6.9+, that’s a spike I want to detect.

Then, once that spike has occurred, I want to check if the price has started to fall — i.e., the current LTP is lower than it was 1 second ago.

I've tried using Relative Odds and Historical Odds conditions, but I can’t seem to compare the current price to the price from 3 seconds ago (or find the minimum in the last few seconds).

Is the best approach to store the LTP every few seconds using a stored value, then compare it using a Stored Value Condition? If so, what’s the best way to do that accurately for fast in-play changes?

Would really appreciate if anyone can help me figure out the best way to build these conditions. Thanks!
User avatar
jamesedwards
Posts: 4239
Joined: Wed Nov 21, 2018 6:16 pm

z188.jpg
You do not have the required permissions to view the files attached to this post.
uksoundz
Posts: 27
Joined: Thu Jun 24, 2010 5:51 pm

Thank you. Will that do both? I see the 15% but will it also monitor the LTP falling too?
User avatar
jamesedwards
Posts: 4239
Joined: Wed Nov 21, 2018 6:16 pm

uksoundz wrote:
Mon Aug 04, 2025 4:53 pm
Thank you. Will that do both? I see the 15% but will it also monitor the LTP falling too?
That's just the 15% increase. You would need to duplicate and adjust for the decrease part.
uksoundz
Posts: 27
Joined: Thu Jun 24, 2010 5:51 pm

Here's another question, I know how to store the TPD value of speed, but is there a way to store the TPD value of speed say 10 seconds ago and compare whether the speed is slower than it was?
User avatar
Euler
Posts: 26464
Joined: Wed Nov 10, 2010 1:39 pm

I asked ChatGPT, it's done a reasonable job. Basically, use history lists.

Compare a horse’s current TPD speed with the value 10 s ago (Automation how-to)

Goal: trigger a rule when a runner is travelling more slowly than it was 10 seconds ago, without using Excel.

1 ) Capture the live speed on every refresh
  1. Add a Set/Modify a Stored Value rule.
  2. Action: Store a value in a History List.
  3. History List: pick an unused list (e.g. History List 1).
  4. Value to store: TPD – Speed (m/s).
  5. Timing: trigger Every refresh (or every 0.2 s if you run the main screen that fast).
Each refresh appends the latest speed to HL-1, giving you a rolling record you can look back through. Bet Angel can subsequently look up any earlier entry in that list.

2 ) Test the current speed against the value 10 seconds ago
  1. Create a second rule (e.g. “Check speed drop”) and give it whatever action you want when the horse is slowing (alert, hedge, lay, etc.).
  2. On the Conditions tab add a Stored Value condition:

    Code: Select all

    Value A:  TPD – Speed (current)
    Compare :  Less Than
    Value B:  History List 1 – 10 seconds ago
If the current speed is lower than it was 10 s earlier, the condition passes and the rule can fire.

3 ) Optional – require a minimum % drop

In the same condition you can use the Adjustment box to tighten the test, e.g.:

Code: Select all

Value B × 0.98
…would only trigger after at least a 2 % slowdown.

4 ) Guard against stale data

Add a Total Performance Data condition such as:

Code: Select all

TPD update occurred < 0.25 s ago
…to make sure you’re never comparing out-of-date numbers.

5 ) (Nice-to-have) display the historic figures
  • Create a custom column (or Ladder Additional Info cell) that shows
    “History List 1 – 10 seconds ago” so you can see the reference value live.
  • Or tick Excel > Export Historic Values if you want to chart the speeds externally.

Recap
  • Store live speed into a History List every refresh.
  • Use a Stored Value condition to compare the current entry with the one from 10 s ago.
  • Trigger your alert/bet when the horse is travelling more slowly than before.
That’s all done entirely within Advanced Automation—no spreadsheets or coding required.
uksoundz
Posts: 27
Joined: Thu Jun 24, 2010 5:51 pm

thats brilliant, I've tried using chatgpt but it never seems to understand betangel properly!
uksoundz
Posts: 27
Joined: Thu Jun 24, 2010 5:51 pm

Momentum Collapse.baf
Could anyone take a look at this, I'm getting myself all confused with the stored values and history lists, I think I've got it right but it never triggers so something must be off, any experienced folk help?

Thanks
You do not have the required permissions to view the files attached to this post.
User avatar
jamesedwards
Posts: 4239
Joined: Wed Nov 21, 2018 6:16 pm

uksoundz wrote:
Wed Aug 06, 2025 6:05 pm
Momentum Collapse.baf

Could anyone take a look at this, I'm getting myself all confused with the stored values and history lists, I think I've got it right but it never triggers so something must be off, any experienced folk help?

Thanks
I suggest you focus on one thing at a time, and park the TPD stuff for now until you have the basic lay up and running.

For the first part:
> You were storing unlimited number of 'initial_odds' SVs every 5 seconds. I assume you wanted to just do this once?
> Perhaps you would be better off using the SP rather than storing a separate SV?
> You're trying to trigger a bet on the favourite at that moment in time. The favourite will change throughout the race based on the latest price. Perhaps use a custom ranking based on SP to identify the fav?
> I've never used the' weight of money' condition, but that might be a little high at >60%?
Momentum Collapse v2.baf
You do not have the required permissions to view the files attached to this post.
uksoundz
Posts: 27
Joined: Thu Jun 24, 2010 5:51 pm

thanks, would this not always place a lay bet on what was the favourite at the start of the race, what if he fell back, and another horse took the lead?
User avatar
jamesedwards
Posts: 4239
Joined: Wed Nov 21, 2018 6:16 pm

uksoundz wrote:
Thu Aug 07, 2025 8:15 am
thanks, would this not always place a lay bet on what was the favourite at the start of the race, what if he fell back, and another horse took the lead?
I'm not sure what it is that you are trying to do.

If you want a static fav based on SP then set a rank based on SP and do it that way. If you want to use whatever is fav at that moment then it's easier, just use the 'historic relative odds' condition that I screenshotted earlier.
Post Reply

Return to “Bet Angel - Automation”