So, I'm trying to grab the weight of money (or an approximation of it) in a Stored Value, write the values to a history list, and then ultimately gain the average WOM value for a defined period of time that refreshes periodically.
To do this I've 'tried' creating a rules file that with every refresh (200ms):
1. Captures the sum of the money available at the Best Back and 2nd Best Back Price in a Stored value (S1)
2. Captures the sum of the money available at the Best Lay and 2nd Best Lay Price in a Stored value (S2)
3. Captures the sum of S1 and S2 and stores it (S3)
4. Writes the value of (S1) / (S3) to a History List (H1), rounded to 2DP.
A second rule file then every 15 seconds:
Creates a Stored Value which is the average of the values in H1 between 15 seconds ago and Now, sampling every 0.5 seconds (WOMAverage)
I then write WOMAverage to the additional data field for the selection on the Ladder.
However, when I observe the pre-market, the WOMAverage value always seems to show '1', when I'd be expecting values between 0.01 and 0.99.
Any ideas what I'm doing wrong here?
WOM in Stored Value
WOM is the total of the money available on the back side divided by the total of the money available on both sides.
e.g. If the back money available is £100 at 2.02, £150 at 2.04 and £175 at 2.06
and the lay money available is £75 at 2.08, £100 at 2.10 and £125 at 2.12.
Then WOM = (£100 + £150 + £175) / (£100 + £150 + £175 + £75 + £100 + £125) = £425 / £725 = 58.6%
So you'd need to start with
Store the sum of the money available at the Best Back (SV1)
Store the sum of the money available at the 2nd Best Back (SV2)
Store the sum of the money available at the 3rd Best Back (SV3)
Store the sum of (SV1) + (SV2) as (SV4)
Store the sum of (SV3) + (SV4) as (SV5)
(SV5) is now your total for your back money
Then do the same for the lay side and you should end up with (SV10) being the total lay
Next do (SV5) + (SV10) as (SV11)
Finally (SV5) / (SV11) as (SV12)
and SV12 will give you the WOM
You can then Store (SV12) to a history list as often as you want, then store (SV13) from a range of values in your history list, ie, the average during the last 30secs
e.g. If the back money available is £100 at 2.02, £150 at 2.04 and £175 at 2.06
and the lay money available is £75 at 2.08, £100 at 2.10 and £125 at 2.12.
Then WOM = (£100 + £150 + £175) / (£100 + £150 + £175 + £75 + £100 + £125) = £425 / £725 = 58.6%
So you'd need to start with
Store the sum of the money available at the Best Back (SV1)
Store the sum of the money available at the 2nd Best Back (SV2)
Store the sum of the money available at the 3rd Best Back (SV3)
Store the sum of (SV1) + (SV2) as (SV4)
Store the sum of (SV3) + (SV4) as (SV5)
(SV5) is now your total for your back money
Then do the same for the lay side and you should end up with (SV10) being the total lay
Next do (SV5) + (SV10) as (SV11)
Finally (SV5) / (SV11) as (SV12)
and SV12 will give you the WOM
You can then Store (SV12) to a history list as often as you want, then store (SV13) from a range of values in your history list, ie, the average during the last 30secs
Thanks Dallas, that sounds pretty close to what I am doing (aside the additional 3rd best price values, which I wasn't that concerned about).
Can most of this be done in a single rules line (with all the stored values conducted in sequence) or does any of it need splitting out into separate rules within the file (the periodic averaging aside)?
Thanks again. Any idea other than the 3rd best prices (my current model essentially imitates a 50%:50%:0% WOM config), what I might be doing wrong with what I'm doing currently?
Thanks!
Can most of this be done in a single rules line (with all the stored values conducted in sequence) or does any of it need splitting out into separate rules within the file (the periodic averaging aside)?
Thanks again. Any idea other than the 3rd best prices (my current model essentially imitates a 50%:50%:0% WOM config), what I might be doing wrong with what I'm doing currently?
Thanks!
Yes all those SV's could be put in one rule, but I'd go as far as SV12 in a single ruleStubbo wrote: ↑Thu Mar 17, 2022 1:28 pmThanks Dallas, that sounds pretty close to what I am doing (aside the additional 3rd best price values, which I wasn't that concerned about).
Can most of this be done in a single rules line (with all the stored values conducted in sequence) or does any of it need splitting out into separate rules within the file (the periodic averaging aside)?
Thanks again. Any idea other than the 3rd best prices (my current model essentially imitates a 50%:50%:0% WOM config), what I might be doing wrong with what I'm doing currently?
Thanks!
Then put SV13 on its own rule for the HL
Your final value (SV12) should be stored to 2 decimal places, it'll then look something like 0.61
I forgot to add you'll then need one more SV after that( SV12a) which stores the value (SV12) multiplied by 100
That's all basically what I'm doing aside the multiply by 100 (which I'm not too fussed about as happy to interpret the values as 0.61 instead of 61). Not sure why it's not working.
I'll try recreating and see if it works. If not can I post a rules file for someone to take a look at?
I'll try recreating and see if it works. If not can I post a rules file for someone to take a look at?
On the last SV did you round it to 2 decimal places?Stubbo wrote: ↑Thu Mar 17, 2022 1:48 pmThat's all basically what I'm doing aside the multiply by 100 (which I'm not too fussed about as happy to interpret the values as 0.61 instead of 61). Not sure why it's not working.
I'll try recreating and see if it works. If not can I post a rules file for someone to take a look at?
If not any value <0.99 (which they'll always be) will just be returned at 1
Did you manage to sort this?
I found I had a template already 95% set up for it so finished that off and I've just merged it into an example I was going to post next week but can do it sooner if you still need it
Hi Dallas, Sorry to bother you. Did you ever post a template with this in it? I am looking to do exactly the same thing (avg WOM over last x seconds) but am struggling to find the bot if you did post it. Thanks very much.
Probably this one, the date fits around 2 weeks after my message above at the timeMrPants wrote: ↑Fri Jan 31, 2025 4:56 pmHi Dallas, Sorry to bother you. Did you ever post a template with this in it? I am looking to do exactly the same thing (avg WOM over last x seconds) but am struggling to find the bot if you did post it. Thanks very much.
viewtopic.php?p=296412
Lovely, that looks like it. Thanks very much, that has saved me a lot of work!Dallas wrote: ↑Fri Jan 31, 2025 5:34 pmProbably this one, the date fits around 2 weeks after my message above at the time
viewtopic.php?p=296412