I am trying to get a stock's intraday prices including the close at 16:00, but seems 16:00 itself is outside of RTH so up to 15:59.
For NVDA on 21 Jun, Google and Yahoo show closed at 126.57.
When I read 1-min bars from IBKR, I get (date time zone open close)
20240621 09:30:00 America/New_York, 127.11, 126.71
20240621 09:31:00 America/New_York, 126.71, 127.65
20240621 09:32:00 America/New_York, 127.65, 127.65
20240621 09:33:00 America/New_York, 127.65, 127.54
20240621 09:34:00 America/New_York, 127.54, 128.43
20240621 09:35:00 America/New_York, 128.43, 128.3
........
20240621 15:55:00 America/New_York, 126.42, 126.52
20240621 15:56:00 America/New_York, 126.52, 126.49
20240621 15:57:00 America/New_York, 126.49, 126.21
20240621 15:58:00 America/New_York, 126.21, 126.15
20240621 15:59:00 America/New_York, 126.15, 127.06
Isn't the close at 15:59:00 of 127.06 the closing price, which was 126.57 in Google Finance? Has SMART to do with it or using TRADES data? For 1hr bars, is the close of 15:00 the closing price of the day?
For AAPL, I got 20240621 15:59:00 America/New_York, 208.01, 207.11, while Google shows 207.49.
I use
For NVDA on 21 Jun, Google and Yahoo show closed at 126.57.
When I read 1-min bars from IBKR, I get (date time zone open close)
20240621 09:30:00 America/New_York, 127.11, 126.71
20240621 09:31:00 America/New_York, 126.71, 127.65
20240621 09:32:00 America/New_York, 127.65, 127.65
20240621 09:33:00 America/New_York, 127.65, 127.54
20240621 09:34:00 America/New_York, 127.54, 128.43
20240621 09:35:00 America/New_York, 128.43, 128.3
........
20240621 15:55:00 America/New_York, 126.42, 126.52
20240621 15:56:00 America/New_York, 126.52, 126.49
20240621 15:57:00 America/New_York, 126.49, 126.21
20240621 15:58:00 America/New_York, 126.21, 126.15
20240621 15:59:00 America/New_York, 126.15, 127.06
Isn't the close at 15:59:00 of 127.06 the closing price, which was 126.57 in Google Finance? Has SMART to do with it or using TRADES data? For 1hr bars, is the close of 15:00 the closing price of the day?
For AAPL, I got 20240621 15:59:00 America/New_York, 208.01, 207.11, while Google shows 207.49.
I use
Code:
private Contract contract = new Contract(); //Contract obj
private String ticker = "NVDA";
private String reqEndDateTime = "20240621 16:00:00";
private String reqLookbackWindow = "1 D";
private PriceDataType reqDataType = PriceDataType.TRADES;
private String reqBarSize = "1 min";
private void setContract() {
this.contract.symbol(this.ticker);
this.contract.secType("STK");
this.contract.currency("USD");
this.contract.exchange("SMART");
}
private void request() {
this.setContract();
this.client.reqHistoricalData(1, this.contract, this.reqEndDateTime, this.reqLookbackWindow, this.reqBarSize, this.reqDataType.name(), 1, 1, false, null);
}
Last edited: