Is it possible to import a String field from ASCII Data Set?
Author: chamoun
Creation Date: 7/22/2012 9:05 AM
profile picture

chamoun

#1
For simulation purposes I need to import a Signal Name with my price and indicator data. The only field available to me is SecurityName which appears to be always populated by the value in the last line of the ASCII Data Set. Is it possible to access SecurityName for each Bar or import a String field?

Thank you.
profile picture

Eugene

#2
No. DataSeries are always of type double -- everything is else is a "filler", and the security name is static.

Here's a proposed solution of importing indicator data with signal name instead of creating an ASCII DataSet:

FillSeriesFromFile

The code is open source, and can be extended to import the Signal Name along with other data. What would I do:

1. Create a new class like MyData with fields for your price and indicator data and a synchronized collection containing signal names (i.e. bar number and signal name, or empty string when there's no signal on that bar)
2. Adjust the parsing routine accordingly (i.e. make FillSeriesFromFile grab signal names as well)
3. Make FillSeriesFromFile return an instance of that class instead of populating the DataSeries
4. Access the properties of the returned MyData class instance for the indicator data and signal name

That's just one possible way that came to mind. There may be alternatives.
profile picture

chamoun

#3
Thank you Eugene - I might try to use a numeric signal name to get started and then work towards migrating to your proposed proposed approach.
profile picture

Eugene

#4
Good and simple idea. Somehow I wasn't assuming that the choice of signal name probably remains in your control. ;)
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).