Hi,
I have a question regarding datasets. I didn't find anything about that in the forum.
Is there a possibility to loop through several datasets?
Like...
CODE:
Please log in to see this code.
Thank you in advance!
Size:
Color:
Hi,
There's almost always a way, and certain topics do exist on the forum:
Iterate through DataSets. But before anything else let me find out what the real question is. Why do you
think that looping through DataSets is required?
Size:
Color:
Here an example. This script finds all the DataSets (DataSources) that includes the clicked symbol, and, if mutual fund symbols are contained in one of those DataSets found.
CODE:
Please log in to see this code.
Size:
Color:
Thank you for the quick response. However, that is not what I'm looking for.
The reason why I wanna loop through different Datasets is that I wanna export data for any symbols in the different datasets to ASCII files.
So it would be much easier for me to do that automatically than running the following code on each favored dataset:
Exporting to ASCII comma-separated files (CSV)
Size:
Color:
Create one master DataSet that holds all of your symbols (use Watchlist Provider extension if necessary) and run that export script. No iteration necessary. That's why I asked you about the objective. It's a good support strategy to let technicians lead the dance. :)
Size:
Color:
I know I can put all desired symbols in one dataset and run that export script. However, that is not what I'm looking for because I wanna have the symbols in different folders like they are located in the datasets (like all symbols belonging to the Dow30 in one separate folder, ...) How can I manage this by putting all symbols in one basket?
Size:
Color:
Size:
Color:
Here's a solution for you kiewo. It will loop through DataSets and save the CSV to specified path.
Note that Windows won't let you save a file whose name contains restricted chars and sequences - like "CON.DE.csv" ("Continental" from DAX 30, for example). So it would be sanitized to _CON.DE.csv.
CODE:
Please log in to see this code.
Size:
Color:
Eugene,
This is exactly what I need.
I modified the code so that only desired datasets are exported.
Thank you!
Size:
Color:
Wolfgang,
Glad I could be of assistance.
Size:
Color: