Export to ASCII
Author: abate
Creation Date: 12/13/2009 4:28 AM
profile picture

abate

#1
I am trying to export fidelity data into one ascii file and the code works except when it runs into an empty data how do I check for empty data.
CODE:
Please log in to see this code.
profile picture

Eugene

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

abate

#3
Eugene,

Tried if( Bars.Count > 0 ) but I get the following error.
Error processing symbol MLV The process cannot access the file 'D:\WLPro-Ref\ASCII\Export.csv' because it is being used by another process.
profile picture

Eugene

#4
It has nothing to do with checking for Bars.Count.

Please don't break the working example of exporting data by moving certain code lines where they don't belong. Notice the correct code that should be executed in single symbol mode (not as a portfolio backtest):

Exporting to ASCII comma-separated files (CSV)
profile picture

abate

#5
Also added
if( Bars.Count <= 0 )
break;
to break out of the for loop but still get the same error.
profile picture

Eugene

#6
QUOTE:
...but still get the same error.

...because the code is broken. Revert to the working code from the Wiki, adding the check for Bars.Count.

P.S. Finally, your code dumps the whole portfolio data into a single file.
profile picture

jmason900

#7
Hi
Isn't there a simple export tool to target ascii, csv, xml as output formats for any selected data set we create in this product?
Did I miss that somewhere?
If not, why not?

Thanks
Jim Mason
profile picture

Eugene

#8
Hi Jim,

For ASCII/CSV, you see this easy and flexible export "tool" above: Exporting data out of WL6 to ASCII files. It shouldn't take long to come up with an XML (Database etc.) export routine if you're motivated. But the $64K question is: what's the point of exporting data? The purpose of Wealth-Lab is rather to import data and solve computational tasks rather than be a bridge for 3rd party programs.
profile picture

07nioe

#9
Hi Eugene, the export tool creates separate files for each stock. How do I get the list in only one file just with the close price?

Thank you for help.

Best
Niels
profile picture

Eugene

#10
Hi Niels,

Take a look at example in post #4:

Exporting data out of WL, deleting old files
profile picture

07nioe

#11
Hi Eugene, good starting point. But the file contains only stocks from the last day, not the ones of the whole period selected.

What do I have to change?
profile picture

Eugene

#12
Here's an DIY excercise for you. Look at the differences between that example and the original Knowledge Base article:

Exporting to ASCII comma-separated files (CSV)
profile picture

07nioe

#13
Hi Eugene, I tried this, but it doesn't work. Still the last day of the period is exported.

CODE:
Please log in to see this code.


Where is the problem?
profile picture

Eugene

#14
Hi Niels,

The problem is that your code processes just one last bar:
CODE:
Please log in to see this code.


I wonder where did you get it from. The example I pointed you at yesterday clearly demonstrates. Here's a copypaste from that page:
CODE:
Please log in to see this code.


profile picture

07nioe

#15
It is working now. Thank you Eugene.

Best
Niels
profile picture

Harapa

#16
Using V 6.9.24.4

I have used code shown in #4 to export data to a CSV file. Before today the snippet was producing Hourly data series ending on the hour (xx:00...a common format) for non fidelity input data series but today it exported data as open +1hr (first hour at 10:30EST...fidelity format).

I also noticed the hourly charts are also displaying fidelity format even though input data is from non fidelity sources. Previousally, I was getting hourly chart from non fidelity sources as xx:00 and fidelity as Open+1hr.

How can I export hourly data in xx:00 format (for non fidelity sources)? My current source is from MetaTrader or a CSV file.
profile picture

Eugene

#17
Not sure why you'd want to export to CSV from CSV but for both ASCII and MetaTrader it depends on the source data. In other words, different vendors set different ending hour formats. You might be able to affect this via the Market Manager but continuing discussion here would be offtopic in this thread.
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).