Adding Fundamental Data to WL5 from ASCII
Author: sf631
Creation Date: 4/22/2009 2:21 AM
profile picture

sf631

#1
*Disclaimer* I'm quite new to WLP (v5.3) but have done a ton of digging on this forum as well as the QuickRef and userguide and am stumped...

I'd like to add in a set of fundamental data elements (not price/volume) from a proprietary source (i.e., not available from the Fidelity, Yahoo, etc... feeds) and would like to do it from a simple ASCII file. I'd then like to use this fundamental data in the same way as one would use the pre-packaged Fidelity Fundamentals, Economic Indicators, etc... with complex rules.

Question 1: is it possible to add user-defined *fundamental* data (not just a new price/volume data series)?

Question 2: if so, are there any things different in WL5 vs WL4 in this regard? The user manual refers often to the DataSource Manager, but I see only the Data Manager, which only seems to allow DataSets. Semantics, I know, but makes me think something has changed w/o documentation updates...

Question 3: if not, is there a way to hack into the data files that store Fidelity etc... fundamental data and overwrite one of the fields I'm not using with the data elements I want to use?

My fallback if all of the above fail seems to be adding the data series as prices for imaginary tickers, but this limits which of the wizard-based rules are accessible (only "crosses above/below" and "is above/below" as far as I can tell

Thanks in advance.
profile picture

Cone

#2
1. Yes. There are at least two ways. The first is to have the fundamental data synchronized alongside the price/volume data in a single file. When creating the ASCII DataSource, you specify these as custom fields and access them from the Bars.Cache using Bars.FindNamedSeries. This is covered in the User Guide: Data > Data Manager > Create New DataSet > Data Providers > ASCII

The other way is programmatically reading and synchronizing the data from a separate file.

2. No real difference, no. By the way, an example of the the second method, albeit using a Daily indicator, is shown here in the v4 KB: Synchronizing Daily Series in Intraday Timeframes

3. N/A
profile picture

sf631

#3
Thanks for the quick reply Cone. I'll take a look at the section you referenced in the user guide and try option 1
profile picture

sf631

#4
OK, I've followed the UG procedures to add the indicator onto an ASCII file. Right now, what I've got is a very simple date,Close,[indicator] three column csv file (see below). No problem with the ASCII wizard, the dataset appears in the data tree.

CODE:
Please log in to see this code.


Where I'm having trouble is with the code at runtime. I'm using the following very simple code
CODE:
Please log in to see this code.


which compiles, but gives the following error message
CODE:
Please log in to see this code.


BTW, the ASCII file was named "RAW" inside of a DataSet named RAW and with a column heading of the series I'm wanting named "RAW". I'm not clear on which level is the one that defines the FindNamedSeries name so I stuck with all three being the same

Thanks
profile picture

Eugene

#5
FindNamedSeries is context-sensitive. You're probably getting the error because the column heading of your series is not called "RAW" exactly, but something like "Raw" or "raw". The DataSet name and symbol name doesn't matter in this case.
profile picture

sf631

#6
Thanks & you're right - it was a case sensitivity issue

What I'm trying to achieve is establish a set of macro indices (like CPI, unemployment, etc... but not ones that Fidelity includes) to reference from multiple strategies across multiple symbols. Is my best way to do that to make up a ticker for each variable and then reference with something like the below?

CODE:
Please log in to see this code.


Is it highly complex to add these to the global indicators via API?

profile picture

Eugene

#7
Creating a ticker for each variable is a good idea.

Making the data series globally available isn't complex:
CODE:
Please log in to see this code.
profile picture

sf631

#8
The above method for getting the data series loaded as global series worked like a charm (much faster execution times now that the ASCII files don't have to be read on each iteration).

However, I've recently discovered that the data is getting garbled during the GetExternalSymbol such that half the rows appear twice in a row and half don't appear at all. The code is:

CODE:
Please log in to see this code.


The input data as it should be is:
CODE:
Please log in to see this code.


And here's how it appears in the DataSeries USD_Adj (from PrintDebug right after the first line...)

CODE:
Please log in to see this code.


Note that the dates of the source file are all Saturdays, so it looks like the first appearance of each datapoint is one day before, on the Friday just prior, then the next time is on the following Friday. This appears to be affected by the "synchronize" boolean value but going without sync is causing all sorts of additional problems in the code.

Ideas?
profile picture

Eugene

#9
QUOTE:
And here's how it appears in the DataSeries USD_Adj (from PrintDebug right after the first line...)

I have had no problems extracting the right date from your data sample.
CODE:
Please log in to see this code.

Two things come to mind: incorrect data format specified or operating with an outdated copy of the data in global memory.
QUOTE:
much faster execution times now that the ASCII files don't have to be read on each iteration

Tip: Enabling "Cache ASCII Data" in the Data Manager tool (ASCII Data tab) will make ASCII get as fast as binary files.
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).