¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Negative volume in tickString


 

Our code just does that, ignore ticks with negative volume. And as i said, this was put in place several years back after we did see negative volumes.

I took a quick look at the current API documentation before I sent my initial answer and realized, that our filter is actually too restrictive, though. As currently implemented it ignores RtVolume and RtTradeVolume ticks unless volume > 0. The correct filter would be volume >= 0 according to this sentence from the IB documentation:

As volume for US stocks is reported in lots, a volume of 0 reported in RTVolume will typically indicate an odd lot data point (less than 100 shares).
JR

PS. Not to make this more complicated, but other tick types do have documented cases of price or volume values of -1

From Receiving Market Data
When and are reported as -1, this indicates that there is no data currently available. Most commonly this occurs when requesting data from markets that are closed. It can also occur for infrequently trading instruments which do not have open bids or offers at that time of the request.

On Mon, Aug 9, 2021 at 09:28 AM, Edward wrote:
JR,
?
Thanks for the prompt response. Strange that I've never encountered this before but maybe just didn't notice it. I guess the simplest solution would be just to ignore those negative volume messages. Would you agree?
?
E

On Mon, Aug 9, 2021 at 4:40 PM JR via <TwsApiOnGroupsIo=[email protected]> wrote:

Negative volume fields for RtVolume (TickId 48) have been around for years, not just since TWS 985.1h. They may be related to "Unreportable Trades". that are included in the data feed ( see )

I can't say for sure, but I believe we did not see negative volumes for the companion? "RTTradeVolume" (TickId 77) since it includes "Reportable Trades" only ( see )

?

Join [email protected] to automatically receive all group messages.