My modified version of the above indicator is attached here in this post for reference purposes.
In the attached picture, one can identify the two new plots which I added by looking for the yellow colored lines in the subgraph.
For testing purposes, I added an input which allows the user to enable or disable the new plots which I added.
When the input called "OSC_strengthband_show" is set to false, the code always works and is identical to the older original version from the link above.
When the input called "OSC_strengthband_show" is set to true, I have observed that the indicator only works on certain combinations of instrument, resolution, and session but not on others. I suspect that the code is throwing an exception due to a null value or a NaN or something similar which is being generated within the code changes which I added.
My lack of deep experience with ninjascript programming should be noted. If anyone here can offer any ideas on how to fix the attached code, it would be greatly appreciated.
workspaces and log for replication of problem conditions
I have uploaded two sample workspaces and a log. These should make it easy to replicate the problem that I described earlier.
The first workspace should not have any problems, it is called "test_eOscBands_1".
The second workspace called "test_eOscBands_2" simply changes resolution from 6 point to 12 point, and the indicator stops working as described previously.
After loading the second workspace called "test_eOscBands_2", the log reports:
"12/9/2011 1:05:51 PM|3|4|Error on calling 'OnBarUpdate' method for indicator 'ElliotOscBands' on bar 559: Index was outside the bounds of the array."