开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

BID_ASK historical bars


 

I'm retrieving 5 minutely historical bars.
?
It appears the data for US stocks is in pennies (USD 0.01).?I'm surprised since BID_ASK should be a time average, the weighted average is unlikely to be pennies (always).
?
By comparison, OPTION_IMPLIED_VOLATILITY is reported to several more decimal places.
?
Has anyone else noticed a problem with BID_ASK ?
?
Example (json composite object with "sr" and "bar" - "stock request" and historical bar response - components)
?
```
{
? "sr": {
? ? "symbol": "NVDA",
? ? "primary": "NASDAQ",
? ? "tradingClass": "NMS",
? ? "reqBar": {
? ? ? "endDateTime": "",
? ? ? "durationStr": "21 D",
? ? ? "barSizeSetting": "5 mins",
? ? ? "whatToShow": "OPTION_IMPLIED_VOLATILITY"
? ? }
? },
? "bar": {
? ? "m_time": "20241031 13:20:00 America/New_York",
? ? "m_open": 0.6062792,
? ? "m_high": 0.6062792,
? ? "m_low": 0.60548548,
? ? "m_close": 0.60548548,
? ? "m_volume": 1.0,
? ? "m_count": 0,
? ? "m_wap": 0.6062792044330731
? }
},{
? "sr": {
? ? "symbol": "NVDA",
? ? "primary": "NASDAQ",
? ? "tradingClass": "NMS",
? ? "reqBar": {
? ? ? "endDateTime": "",
? ? ? "durationStr": "21 D",
? ? ? "barSizeSetting": "5 mins",
? ? ? "whatToShow": "BID_ASK"
? ? }
? },
? "bar": {
? ? "m_time": "20241003 09:30:00 America/New_York",
? ? "m_open": 121.31,
? ? "m_high": 122.0,
? ? "m_low": 120.34,
? ? "m_close": 121.33,
? ? "m_volume": -1.0,
? ? "m_count": -1,
? ? "m_wap": -1.0
? }
}
```


 

Per the definition of historical BID_ASK, you would expect that prices reported in the High and Low fields of the bars are integer multiples of minTick (in your case 0.01), since Ask and Bid prices will be:
  • High --> Max Ask?
  • Low --> Min Bid
Fields Open and Close return "Time average" prices, so that it is reasonable to expect at least occasionally sub-penny values:
  • Open --> Time average bid
  • Close --> Time average ask

But I can't tell you exactly how the time average over 5mins is calculated, or whether the result is rounded to minTick (on purpose or error). Probably a question for IBKR.

闯ü谤驳别苍
?
?
On Thu, Oct 31, 2024 at 04:54 PM, Kevin R Keane wrote:

I'm retrieving 5 minutely historical bars.
?
It appears the data for US stocks is in pennies (USD 0.01).?I'm surprised since BID_ASK should be a time average, the weighted average is unlikely to be pennies (always).
?
By comparison, OPTION_IMPLIED_VOLATILITY is reported to several more decimal places.
?
Has anyone else noticed a problem with BID_ASK ?
?
...
? "sr": {
? ? "symbol": "NVDA",
? ? "primary": "NASDAQ",
? ? "tradingClass": "NMS",
? ? "reqBar": {
? ? ? "endDateTime": "",
? ? ? "durationStr": "21 D",
? ? ? "barSizeSetting": "5 mins",
? ? ? "whatToShow": "BID_ASK"
? ? }
? },
? "bar": {
? ? "m_time": "20241003 09:30:00 America/New_York",
? ? "m_open": 121.31,
? ? "m_high": 122.0,
? ? "m_low": 120.34,
? ? "m_close": 121.33,
? ? "m_volume": -1.0,
? ? "m_count": -1,
? ? "m_wap": -1.0
? }
}
```