How do I access individual symbols in a dataseries?
Author: aresnik
Creation Date: 12/3/2010 7:44 PM
profile picture

aresnik

#1
Hi all,

I have the following dataseries:

CODE:
Please log in to see this code.


How do I access the individual symbols in the series in code?

Thanks in advance
profile picture

Eugene

#2
This syntax would be invalid in WealthScript. It's likely that you're using WealthScript Translator output (unsupported). In this case, I would strongly caution against touching it for the purpose of mixing it with native WealthScript code.

In a pure WealthScript Strategy, however, your code would then become something like this:
CODE:
Please log in to see this code.

Further reading:

WealthScript Guide: DataSeries > Accessing Secondary Symbols
profile picture

aresnik

#3
Thanks for your quick response Eugene.

I still don't know how to access the individual symbols inside the dataseries "dsSP100".
For example there are 100 individual symbols AA, AAPL, ABT, ... Is there a syntax to specify them or do I need to write a seperate dataseries for each one?

profile picture

Eugene

#4
No you don't need to create a separate DataSeries but let's start by answering what are you trying to accomplish in general. This is not clear to me.
profile picture

aresnik

#5
I am trying to write a strategy that will take the S&P 100 and calculate how many advancing issues there are in 15-Minute time scale in reference to the closing price of the previous day.

Here is my code so far (I know it's not right yet):

CODE:
Please log in to see this code.
profile picture

Eugene

#6
CODE:
Please log in to see this code.
profile picture

aresnik

#7
Thanks Eugene very much for the code.

I am not sure it is doing what I want though or maybe I don't understand it.

Is it using the S&P 100? -Because I don't see it referenced anywhere in the code. Also the "Advancing Issues" -Shouldn't it be from 0 to 100?
profile picture

Eugene

#8
Obviously, a Bars object or a DataSeries represents just this single symbol. Having just a single symbol for the 15-min S&P-100 is not enough for your task. That's why it makes zero sense to reference it or anything else, just give it a thought.

(And that's why your question was vague initially. Now I answer: you can't access individual symbols in a DataSeries if by that you mean getting access to index components where the DataSeries is associated with some index.)

The code is to be run on a DataSet that consists of the S&P 100 symbols.

Not sure about the last remark i.e. from 0 to 100 - actually, from 0 to the number of symbols having their closing price of the current intraday bar above the previous day's closing price.
profile picture

aresnik

#9
Hi Eugene and all,

I need some help with some bug in my strategy. I keep getting an "index out of range" exception when I run it on a time period longer than 8 weeks.

Heres the code:

CODE:
Please log in to see this code.


Any help would be gratefully appreciated.
profile picture

Eugene

#10
If you're asking for my help, then I suggest looking at my code above (see reply from 12/4/2010 11:19 AM).
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).