Export To ASCII is slow
Author: Assenzio
Creation Date: 3/9/2011 5:22 AM
profile picture

Assenzio

#1
Thanks to the knowledge base I have written this code to export my Bloomberg static data into ASCII files. But unfortunately there is something that doesn't work properly. When running, the code very quickly collect data then the "backtesting" mode stopped (while running...) at "Running The Strategy" and the whole process begin very longer and usually I have to stop it pressing the ESC buttun. Any suggestion ? Could it be because the files are already present before converting again ?

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

Eugene

#2
1. Make sure you run this strategy in Single-Symbol mode. Otherwise you'll be running the DataSetSymbols loop over and over * N symbols times, and it's not designed for that.
2. Turn off on demand data updates.
profile picture

Assenzio

#3
What did you mean with "Single-Symbol Mode". I have to select one symbol in the DataSets Folder instead of the folder itself ?
profile picture

Eugene

#4
Exactly.

This code does not need to be run in Multi-Symbol mode (on a DataSet) to be able to process the whole DataSet.
profile picture

Assenzio

#5
Okay but in this way I got a runtime error (at WealthLabPro.ChartForm) always that says: "Runtime Error: Value of'7' is not valid for 'value'". 'Value' should be between minimum and maximum. Plus many more details ...
profile picture

Eugene

#6
As could be found in the Knowledge Base, this one time issue (of an unknown origin) is usually gone after reopening the strategy window:

Strategy compiles but produces a specific runtime error > Runtime error: Value of '7' is not valid for 'Value'. 'Value' should be between 'minumim' and 'maximum'
profile picture

Assenzio

#7
That's correct, Eugene.

I just reopened the code in the strategy window and all works fine now. Thank You.
profile picture

Assenzio

#8
just wondering ... but there is a way, like in the old WLD 4 Scan Feature, to apply the Export feature to more datafolders at the same time ?
profile picture

Eugene

#9
Add the strategy to Strategy Monitor several times, each time selecting a different DataSet.
profile picture

Assenzio

#10
Okay ... but, as a feedback, will be cool to add a "Run All strategy" Button ;)
profile picture

Eugene

#11
Since the SM is already designed to automatically execute strategies at intervals, there would be no need for that button.
profile picture

Assenzio

#12
Right.

one more thing ... how to export the description of the tickers ? Using the code below doesn't work:

CODE:
Please log in to see this code.


It export the ticker istead of the description (such as "S&P500").
profile picture

Eugene

#13
You probably mean to say Bars.SecurityName instead of Close.Description?
profile picture

Assenzio

#14
On the same code, using the strategy monitor to run it on selected watchlists, I found that the process export the data beginning from the dates that are available in the symbol selected. How to export data from the FIRST date available in every case?

I mean, I selected for example the ticker X in the watchlist that have an historical that start, let say, from 1.1.1987. All the other symbol will be exported with the code above starting (unfurtunately) from that date and time frame. The Y in the same watchlist, for ecapmple, even if it has an historical that starts from 1950 will be converted starting from 1.1.1987. I can select the whole watchlist as a data ... but the code I think goes in loop ...
profile picture

Eugene

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

Assenzio

#16
No, the problem persist. Probably I do not describe well the problem. Let's try again ... I create a strategy monitor, I selected ALL DATA, then one symbol in the watchlist. I run the code and the code export the data into ASCII as preferred. The problem is:

1. Export all starting from the date of the X symbol selected (not ALL DATA!)
2. if the symbol selected is scale Monthly, even symbol with daily scale became monthly.
3. If I selected the Watchlist Name instead of a ticker, the code export data but don't know why only till 2009 :)
profile picture

Eugene

#17
1, 3. Date Range should not be used in Strategy Monitor because of this bug (deferred):

(4167) End Date should be ignored in Strategy Monitor Date Range settings

Otherwise, works for me.
profile picture

Assenzio

#18
Does not work for me, absolutely. Still have all the issues above. Maybe because I am trying to convert Bloomberg static data (not internet, but real BLG data, in watchlists) into ASCII with my script. These are the settings I am using:

PAPERACCOUNT1
Data Range (all data or even 1.1.1940 to nothing)
Position Size: 50.000 Fixed Dollar
Scale: Daily

I selected CESIEUR from the ticker inside the watchlist called "Macro Europe" that is a daily time series since 2003. In this case the conversion goes rapidly but all symbols starts from 2003 even if they have historical since 1950. The monthly series in the watchlist have data completely WRONG! Seem that it recalc something.

If I selected the NAPMPMI (Ism) ticker inside the watchlist called "Macro Europe" (that is monthly) the conversion uses data since the start of the historical date in the ISM for all other tickers (CESIEUR included with zeros) but the CESIEUR became a monthly series, and this is not correct.
profile picture

Eugene

#19
I don't have access to Bloomberg data so can't prove or disprove. Could you simply use a regular Strategy for what you've been doing?
profile picture

Assenzio

#20
What do ya mean Eugene ? I do not use regular strategy (with buy & sells) I use strategies just to convert mutiple watchlist (15) of bloomberg data.

Anyway putting SetContext to true or false doesn't affect in any way the process. The results are the same.
profile picture

Eugene

#21
I mean, what gives executing the task in a Strategy window vs. Strategy Monitor? After all, I don't understand the point of using the SM for exporting data. You can access external DataSeries with WealthScript, isn't it?
profile picture

Assenzio

#22
In Strategy Windows this code works perfectly with Posizion Size Fixed Dollar, scale Daily, Data Range fixed by the user:

CODE:
Please log in to see this code.


I was using Strategy Monitor just becasue I have to applied it to 15 different watchlist and i found more easy to start all in just one place and I saw when the processes starts and when they finished.
profile picture

Eugene

#23
I see. Then, to minimize your routine work, how about creating a workspace with 15 copies of your Strategy applied to different DataSets and loading this on demand?
profile picture

Cone

#24
Eugene, I'm going to change those ASCII examples so that they don't use DataSetSymbols. It simplifies the code anyway and then you can run it on one symbol or the whole DataSet.
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).