I have a dynamic watchlist script using intraday price data that has been functioning well. I wanted to add a benign parabolic stop using daily price. I setup a ParablicStop series under SetScaleDaily and then syncronize it. However, when I access the series in the bar loop, it keeps coming back with the Parabolic Stop for the underlying symbol (the one I click on) rather than the active position / SetContext symbol. It also gives me a rutime error "Index out of range". I included the portion of script that is involved in the parabolic stop. Can you point me in the right direction to get it to pick up the symbol under test?
CODE:
Please log in to see this code.
Size:
Color:
You only created one Parabolic series for the primary Bars, so that's the only one the script can reference.
After you SetContext, you need to grab a reference to the Parabolic.Series for the Bars in the current context.
Size:
Color:
Thanks Cone. I assume that I then SetScaleDaily in the bar loop as shown below. I'm still getting the Runtime error: Index was out of range. "Must be non-negative and less than the size of the collection."
CODE:
Please log in to see this code.
Size:
Color:
On the surface, the ParabolicStop1 isn't synchronized.
Size:
Color:
It would be much more efficient to create 2 DataSeries references before the loop so that you could refer to the correct one within the loop. If this is a script that operates on DataSetSymbols, then, store the series references in a Dictionary<string, DataSeries> so that you can easily recall the one for the string key (the symbol).
Size:
Color:
Thanks Cone. I'll work on it.
Size:
Color: