Export Price Data without using the "Price Data to Clipboard"
Author: slmy
Creation Date: 4/3/2009 3:30 PM
profile picture

slmy

#1
Is there another way to export price data to Excel/ASCII other than using the "Copy Price Data to Clipboard" feature? Can this be coded to run manually or automated? Thanks.
profile picture

Cone

#2
As Eugene likes to say, "get to know the Wealth-Lab Wiki!".

Specifically, in the KB:
Data | Exporting data out of WL5 to ASCII and WL4 native binary files
profile picture

slmy

#3
I found that and used it already - It does not export the indicator data like the copy to clipboard feature. I was hoping to find some code that would export the same data as the copy to clipboard feature (all price data and indicator data). If I added or deleted an indicator(s) then the data would download as the chart was built/created. Thanks.
profile picture

Eugene

#4
You can easily make the code export any indicator or data series just like the code already does it with, say, Close[bar].

But if you intended to export only drag-and-drop'd indicators on-the-fly, this has to be further researched - if it's possible to extract those from the Bars.Cache object.
profile picture

slmy

#5
Yes, I would like to export only drag-and-drop indicator data on the fly without having to use the clipboard feature. Why? - So I can get the data into an analysis tool on mulitiple/many securities thoughout a trading day. Manually copying and pasting is too slow. Thanks for the quick responses. Any help is appreciated.
profile picture

Eugene

#6
If you're playing with drag-and-dropped indicators, exporting it with code will not give you a great speed advantage - I'm at a loss, what's the difference with right-clicking if you'll still have to press the 'Go' button to export?

Anyway, probably it can be done in the manner similar to how Analysis Series view does it -- by looping through each string in Bars.Cache.Keys, extracting the attached data series, and exporting their values.
profile picture

slmy

#7
I see your point on the speed advantage or not but I wouldn't have to manually do it. Maybe I need to explain more. If possible I would like it to be automated - I.E. Loop through a Data Set of securities every 30 minutes or hourly (set to timer) thoughout the day or be able to run it at end of day on an entire data set. The Copy to Clipboard works great on 1 or 2 securites but running it on a large data set is not so easy/fast. Maybe this is wishful thinking. Again, I'm not the most technical so thanks.
profile picture

Cone

#8
There's no problem looping through a DataSet and exporting all symbols in one swoop, but what type of analysis requires you to export it in the first place? Call me crazy, but why not perform the analysis in Wealth-Lab? After all, the data is already there!
profile picture

Eugene

#9
Upon some quick test I've done, it doesn't seem that drag & dropped indicators are added to Bars.Cache to be available in Strategies. On the other hand, those data series declared in Strategy code, are available. So if I'm not overlooking something, then I don't see an easy way.
CODE:
Please log in to see this code.