¿ªÔÆÌåÓý

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

Re: Historical bars and WAP


 

So I probably answered my own question via an experiment - getting the same 5 secs bars as real-time and as historical.
They seem to match exactly except for field naming and precision.

Docs here are basically wrong -?.

"average" and "barCount" fields of historical bars are the same as "wap" and "count" fields of real-time bars except that "wap" in real-time bars has decimal precision of 3 digits after period and "average" of historical bars seem to have only 2 digits precision.
I checked just for one symbol of stocks and options and it seems to hold true. Perhaps, there are occasional discrepancies - I didn't check at large scale.


On Wed, Feb 17, 2021 at 1:03 AM Alex Gorbachev <ag@...> wrote:
Hi all,

Is WAP available for historical bars?

Looking at the API docs .

WAP is supposed to be present in the historical bars but I don't see it (I'm using ib_insync?Python module if that makes any difference). I can see WAP is returned in real-time bars but not in historical. I can see average. I wonder if that's basically WAP and just named differently than in the docs. I'm using IB Gateway?978.

{'average': 801.119,
?'barCount': 13,
?'close': 801.26,
?'date': datetime.datetime(2021, 2, 16, 16, 42, 30, tzinfo=datetime.timezone.utc),
?'high': 801.3,
?'low': 800.92,
?'open': 801.0,
?'volume': 20}


Also, I'm using 5 seconds bars in both cases (real-time and historical) and whatToShow='TRADES'.

Thanks in advance,
Alex

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