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
History Lists and Stored Values
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.
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
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:
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.
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
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:
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.
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, gotchasniffer66 wrote: ↑Thu Sep 10, 2020 12:22 pm
Yes, which is fine for what I'm using it for. Doesnt need sharing in this instance