ASCII data cannot be imported
Author: bonanza
Creation Date: 6/6/2011 11:57 PM
profile picture

bonanza

#1
Hello!
I'm having problems with importing files in ASCII.
A sample file looks like this:

QUOTE:
<TICKER>,<PER>,<DTYYYYMMDD>,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>,<OPENINT>
RIZ1,D,20110209,,,,,,
RIZ1,D,20110210,,,,,,
RIZ1,D,20110211,187000,187000,184300,184300,5,2
RIZ1,D,20110214,,,,,,2
RIZ1,D,20110215,,,,,,2
RIZ1,D,20110216,,,,,,2
RIZ1,D,20110217,188000,188000,188000,188000,2,6
RIZ1,D,20110218,,,,,,6
RIZ1,D,20110221,,,,,,6
RIZ1,D,20110222,,,,,,6
RIZ1,D,20110224,,,,,,6
RIZ1,D,20110225,177635,191395,177585,191395,22,6
RIZ1,D,20110228,195000,195000,195000,195000,1,6
RIZ1,D,20110301,,,,,,6
RIZ1,D,20110302,196000,196000,196000,196000,1,8
RIZ1,D,20110303,198700,198700,198700,198700,5,16


Probably the case in consecutive commas.
How can I fix it?
profile picture

Eugene

#2
Hello Dmitry,

No, consecutive commas is not the problem. Your data vendor's software (or its ASCII export settings) is.

Just give it a thought: what does this sequence mean to the computer? How should a PC interpret it:
CODE:
Please log in to see this code.

Why have nobody made a single trade so that there existed open interest, but how come the price evaporated?
Then has the trading stopped?
Or does it mean the price was $0 during that bar? Wait, price can't be zero. Then what was the price? Maybe we should "borrow" it from the preceding bar? (WHY?)
Is this a broken line of data not containing any numbers? etc.

As you can see, it's impossible to tell reliably which scenario is right. The provider isn't making assumptions and does no guesswork, so the best it can do is signal you about a possible flaw in the data. (Anticipating a question on possible provider "enhancement" to support this data, the answer is no. Early in the ASCII provider development, it was resolved that in cases like this, the provider should not "decide" on its own what to do when there's any data ambiguity. The user should fix her/his data while the provider should remain precise.)

So what to do? Configure your software so that it won't skip any meaningful data. If this is impossible, just remove the lines. It should be extremely easy to do in any scripting language: just find and trim all those lines with consecutive commas.
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).