You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to fetch historical data from a NQ future contract in IBKR and I couldn't. First thing,
Example contract: val asset = futureContract( symbol = "NQ", month = Month.DECEMBER, year = 2024, multiplier = 20.0, exchangeCode = "CME", )
When function "tofutureContract" builds an Asset creates a futureSymbol as NQZ24 when it should be NQZ4, this quick change fixes it:
old: val futureSymbol = "$symbol$monthEncoding${yearCode.takeLast(2)}"
new: val futureSymbol = "$symbol$monthEncoding${yearCode.last()}"
Second thing, when I want to retrieve the data like so:
java.time.format.DateTimeParseException: Text '20241119 08:30:00 US/Central' could not be parsed at index 9
at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2108)
at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:2010)
at java.base/java.time.LocalDateTime.parse(LocalDateTime.java:494)
at org.roboquant.ibkr.IBKRHistoricFeed$Wrapper.historicalData(IBKRHistoricFeed.kt:134)
at com.ib.client.EDecoder.processHistoricalDataMsg(Unknown Source)
at com.ib.client.EDecoder.processMsg(Unknown Source)
at com.ib.client.EReader.processMsgs(Unknown Source)
at org.roboquant.ibkr.IBKR.connect$lambda$1(IBKR.kt:95)
Could it be this date formatter? seems that has two white spaces betwen date and time but the time string been parsed has only one white space. private val dtf = DateTimeFormatter.ofPattern("yyyyMMdd HH:mm:ss")
Btw, great project.
The text was updated successfully, but these errors were encountered:
Hi,
I've tried to fetch historical data from a NQ future contract in IBKR and I couldn't. First thing,
Example contract:
val asset = futureContract( symbol = "NQ", month = Month.DECEMBER, year = 2024, multiplier = 20.0, exchangeCode = "CME", )
When function "tofutureContract" builds an Asset creates a futureSymbol as NQZ24 when it should be NQZ4, this quick change fixes it:
old:
val futureSymbol = "$symbol$monthEncoding${yearCode.takeLast(2)}"
new:
val futureSymbol = "$symbol$monthEncoding${yearCode.last()}"
Second thing, when I want to retrieve the data like so:
I get an error:
Could it be this date formatter? seems that has two white spaces betwen date and time but the time string been parsed has only one white space.
private val dtf = DateTimeFormatter.ofPattern("yyyyMMdd HH:mm:ss")
Btw, great project.
The text was updated successfully, but these errors were encountered: