0
$\begingroup$

I am working on importing some daily data from a public data source as csv format.

The csv convention of the file seems to be that if data is not available for a field, a single white space is used as NaN placeholder.

Now however, I have encountered a single row where the volume field contains -1. To me, the volume by definition has to be a positive number. - Or are there situation where a negative volume can occur?

$\endgroup$
  • $\begingroup$ What is the public data source? When did you get the data? Was it updated since then? What does the source say? $\endgroup$ – SRKX Dec 12 '14 at 2:17
1
$\begingroup$

Without knowing more about the data, the security was probably halted. Is the pricing staled day over day? More info would be good.

$\endgroup$
  • $\begingroup$ To be honest, I know very little about the data. My background is not in finance. What does "staled day over day" mean? It is a "yahoo finance"-type "date, open, close, high, low, volume"-type dataset. (Though not from yahoo finance.) $\endgroup$ – Max Dec 12 '14 at 21:29
1
$\begingroup$

Volume should never be negative. Period.

Volume can be zero (0) on rare occasions. Usually related to an ECN.

The most likely cause is during processing, the cumulative volume exceeded the int size of a variable (32-bit) and rolled over. Some programming languages will use -1 (0xFFFFFFFF) to designate an integer overflow.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.