History Lists and Stored Values

Help improve Bet Angel.
Post Reply
User avatar
jimibt
Posts: 3641
Joined: Mon Nov 30, 2015 6:42 pm
Location: Narnia

First off, History Lists, what can i say - excellent, extends the abilities in BA far more than any recent update -love them so much.

However, there is a small side effect that's been introduced as a result. When populating History Lists and using SV's to perform the necessary calculations I've hit a few brick walls. It took me a while to figure out what was going wrong as I've been using SV's since they were introduced without problem. The issue with History Lists and SV's working together is based on the fact that you can request a value from a History List that doesn't yet exist. So if for example, you were to request the Last Traded Price from 45 seconds ago and the item wasn't present in the History List, the SV simply won't get created. This has unintended consequences in terms of preventing entire calculation chains from completing (until such a time as the requested item *arrives*).

The same issue was spotted in a recent thread:

viewtopic.php?f=61&t=21775

There are workarounds that can be performed, such as populating all SV's with default values BEFORE they are used. However, this additional layer can lead to oversight if the rules change or further SV's are added.

I would like to suggest a more elegant solution. Would it be possible to include a DEFAULT value for SV's when creating them. This could be a hardcoded value as I'm sure most folk will have an idea of what values are required as defaults ('0' anyone?? :)). This way, we can be sure that our SV's and logic will complete as expected if no entries are present in the History Lists.

I'm sure I'm not the only one that pushes SV's in this way ;)
sniffer66
Posts: 1666
Joined: Thu May 02, 2019 8:37 am

Big +1 from me.

The ability to be able to select a value, as opposed to defaulting to 0, would be preferable
User avatar
jimibt
Posts: 3641
Joined: Mon Nov 30, 2015 6:42 pm
Location: Narnia

sniffer66 wrote:
Fri Aug 21, 2020 5:15 pm
Big +1 from me.

The ability to be able to select a value, as opposed to defaulting to 0, would be preferable
I guess that *component* already exists tbh i'd imagine, so should be easy enough (maybe ;)) to select a DEFAULT value from a list such as this:
You do not have the required permissions to view the files attached to this post.
Anbell
Posts: 2007
Joined: Fri Apr 05, 2019 2:31 am

+1
sniffer66
Posts: 1666
Joined: Thu May 02, 2019 8:37 am

Can I add some more weight to this suggestion please ?

Had an instance this morning where my rules file adds an SV to itself +1 when a condition is met

To meet the requirement for this to happen the SV has to be set to 0
So, I have a run once rule that sets every SV I may use to 0
Capture.JPG


I then get the correct logfile entry for that set:

10/09/2020 08:54:30: [G_Auto] : Store Value for Yannick Hanfmann: NonNomineeScored30 = 0

But, when I go to sum that SV:

Capture.JPG
I get this:


10/09/2020 09:51:44: [G_Auto] : Unable to : Store: 'NonNomineeScored30' for current selection. First value invalid.

I don't know if this is a bug or I've made an error (although its an intermittent result - often works fine)

But 0 + 0 + 1 = 1 for the SV. The first value can't be invalid as I've already set it !

By setting the default value of an SV to 0 it saves us having to declare it as 0 for EVERY used SV, plus it prevents the issue happening above.
You do not have the required permissions to view the files attached to this post.
sniffer66
Posts: 1666
Joined: Thu May 02, 2019 8:37 am

And just had an example when it worked, so why the difference ?

10/09/2020 11:15:30: [G_Auto] : Store Value for Danka Kovinic: NonNomineeScored30 = 0 + 1 = 1

Same rules file, same apply time
User avatar
jimibt
Posts: 3641
Joined: Mon Nov 30, 2015 6:42 pm
Location: Narnia

sniffer66 wrote:
Thu Sep 10, 2020 11:25 am
And just had an example when it worked, so why the difference ?

10/09/2020 11:15:30: [G_Auto] : Store Value for Danka Kovinic: NonNomineeScored30 = 0 + 1 = 1

Same rules file, same apply time
I notice that you don't have the [x] Shared value selected in the screenshot. This in effect means that the SV is local to that rule (and only for the duration of that trigger), rather than to the entire automation file, ad infinitum ;)
sniffer66
Posts: 1666
Joined: Thu May 02, 2019 8:37 am

jimibt wrote:
Thu Sep 10, 2020 12:10 pm
sniffer66 wrote:
Thu Sep 10, 2020 11:25 am
And just had an example when it worked, so why the difference ?

10/09/2020 11:15:30: [G_Auto] : Store Value for Danka Kovinic: NonNomineeScored30 = 0 + 1 = 1

Same rules file, same apply time
I notice that you don't have the [x] Shared value selected in the screenshot. This in effect means that the SV is local to that rule (and only for the duration of that trigger), rather than to the entire automation file, ad infinitum ;)

Yes, which is fine for what I'm using it for. Doesnt need sharing in this instance
User avatar
jimibt
Posts: 3641
Joined: Mon Nov 30, 2015 6:42 pm
Location: Narnia

sniffer66 wrote:
Thu Sep 10, 2020 12:22 pm
jimibt wrote:
Thu Sep 10, 2020 12:10 pm
sniffer66 wrote:
Thu Sep 10, 2020 11:25 am
And just had an example when it worked, so why the difference ?

10/09/2020 11:15:30: [G_Auto] : Store Value for Danka Kovinic: NonNomineeScored30 = 0 + 1 = 1

Same rules file, same apply time
I notice that you don't have the [x] Shared value selected in the screenshot. This in effect means that the SV is local to that rule (and only for the duration of that trigger), rather than to the entire automation file, ad infinitum ;)

Yes, which is fine for what I'm using it for. Doesnt need sharing in this instance
ok, gotcha ;)
Post Reply

Return to “Suggestions”