Picking up underlying symbol indicator vs. SetContext symbol
Author: WLTrader23
Creation Date: 2/21/2011 4:35 PM
profile picture

WLTrader23

#1
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.
profile picture

Cone

#2
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.
profile picture

WLTrader23

#3
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.
profile picture

Eugene

#4
On the surface, the ParabolicStop1 isn't synchronized.
profile picture

Cone

#5
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).
profile picture

WLTrader23

#6
Thanks Cone. I'll work on it.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).