I finally found the problem with this indicator; it was an interesting
journey....
Basically what the difficulty boils down to is the following:
1. In most places, the representation of an indicator is determined
programmatically through the parsing algorithm in
GT::ArgsTree::parse_args
2. But the name of an indicator is determined as typed in @NAMES
Now in the ByName indicator, these two come into conflict in that (2) is
used to determine what indicator to look up, but (2) is used to store
that indicator. Most of the time they are the same, but there is no
guarantee, as the hand-written spelling does not necessarily have to
match up with the programmatically produced spelling.
The only solution is to also make sure that the precise appearance of
the name of the indicator is programmatically determined, so that we can
always assure both are the same.
In the attached, I have made those changes. The one user visible
difference is that now in the name of indicators there is always a space
after the commas. E.g., SMA[12, {I:Prices CLOSE}]. I tried to take that
out, but without rewriting the parsing algorithm that is not possible.
This change affects only the I:Generic:ByName indicator and the visual
appearance of the indicator name. I have tried all my test cases and
they pass now. I also made a small change to the name under which
indicator objects are cached to make them shorter.
Attachment:
ByName.pm
Description: ByName.pm
Attachment:
Registry.pm
Description: Registry.pm