Accessing all DataSeries in Strategy
Author: Christos
Creation Date: 2/13/2012 10:54 AM
profile picture

Christos

#1
Is there any way to create a loop for each dataseries created within a strategy?

e.g. If I have created:
DataSeries abc = new DataSeries(Bars,"abc");
DataSeries HiOp = High/Open-1;

is there anyway to access each one's values via a loop without specifying their names (something like for each DataSeries in MyStrategy)?

The reason I want to do that is because I want to create a method to export all dataseries values to a csv file without having to specify every time all the DataSeries names....

Would it be possible to post a simple example if such a solution exists?
profile picture

Eugene

#2
See the QuickRef example of Bars.Cache.
profile picture

Eugene

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

Christos

#4
Eugene,

Thanks a lot for your answer! However, I still have one more question regarding the same issue. I can't see the DataSeries that I have created by calculating each bar value, bar by bar, within a loop. Is there any way to include them as well?
profile picture

Cone

#5
If you add it to the cache, sure.

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

Christos

#6
Thanks a lot for your instant reply Cone! This is also really helpfull for the "Analysis Series" performance visualiser!
profile picture

Cone

#7
See also User Guide: Preferences > Performance Visualizers > Analysis Series

It's there too ;)
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).