Output historical data (OHLCV) to text file for all symbols in a DataSet
Author: instarac
Creation Date: 5/12/2016 4:28 PM
profile picture

instarac

#1
Does anyone know how to get data out of WL into text files for a series of symbols?

I would like to be able to execute a command that would create text files of price data beginning from a fixed starting point to the current minute using a fixed time interval (e.g. 5 minutes) for all securities in the watch list.

WL allows you to create a text file of price data from a single chart, but I'm looking to do it across multiple symbols.
profile picture

Eugene

#2
Simply run this code in Multi-Symbol Backtest mode:

Exporting to ASCII comma-separated files (CSV)

If unsure how, check out the Wealth-Lab User Guide > Strategy Window > Backtesting Strategies > Multi-Symbol Backtest.
profile picture

emskiphoto

#3
In addition to the OHLCV values for each bar, how could I output data to a CSV for technical indicator values? Code from a failed attempt is pasted below.

Would I encounter limitations if I attempt to export data for 100 indicators for 2000 bars of data?

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

Eugene

#4
At first glance, this line has incorrect syntax:
CODE:
Please log in to see this code.


See the WealthScript Programming Guide > DataSeries > Accessing a Single Value from a DataSeries.

As the example code before does it correctly to Date, Open and High, the EMA is no different so you have to follow the example. It's precisely how you access any value of a DataSeries at a given bar in any of your Strategy code.
profile picture

emskiphoto

#5
Thanks Eugene. The Programming Guide revealed some terms/syntax that was missing:

CODE:
Please log in to see this code.
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).