Skip to content
All library documents

Diagnosing Negative Volume Values in Market Data

Article Quant Q&A · Author: Max

Summary

This discussion considers how to interpret a negative volume entry in a daily market-data file when blanks represent unavailable values. The replies agree that traded volume is not ordinarily negative, while zero volume can occur in some circumstances. One response suggests checking whether prices stayed unchanged, since a trading halt could explain the surrounding data, but emphasizes that the source and instrument details are needed to assess that possibility.

A second explanation is a data-processing failure: a cumulative volume counter stored in a limited-width integer may overflow, with the bit pattern appearing as -1 in some systems. This makes the value a likely sentinel or corruption artifact rather than genuine trading activity. The note offers diagnostic possibilities, not a confirmed cause for the specific record. It advises validating the feed and its encoding conventions before treating the observation as a market fact; it does not provide a method for correcting or imputing the value.

Key ideas

  • Market volume is generally nonnegative, though zero-volume observations may occur.
  • A negative entry should prompt investigation of the feed and its surrounding records.
  • A halt may be a plausible explanation when prices are stale, but the data alone does not confirm it.
  • Integer overflow can cause a cumulative volume value to appear as a negative sentinel.

Tags

Full text
# Importing daily data: '-1' in volume column


# Importing daily data: '-1' in volume column












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?

## Answer by Luke (score 1)

https://quant.stackexchange.com/a/15829

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

## Answer by SpzToid (score 1)

https://quant.stackexchange.com/a/21562

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.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.