Hi
I can get prices for KC when I run the code below (with WH commented out and KC uncommented)
library("IBrokers")
tws <- twsConnect()
contract1 <- twsContract(0,"WH", "CONTFUT", "SNFE","","","0.0","AUD","","","",NULL,NULL,"0")
#contract1 <- twsContract(0,"KC", "CONTFUT", "NYBOT","","","0.0","USD","","","",NULL,NULL,"0")
reqHistoricalData(tws, contract1, endDateTime = format(Sys.Date(), "%Y%m%d 24:00:00"), duration = "3 M")
but when I try for WH I get an error:
waiting for TWS reply on WH …failed.
NULL
Warning message:
In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106, :
Historical Market Data Service error message:HMDS query returned no data: WKF0@SNFE Trades
>
I can't figure out what I am doing wrong. Can anyone help?
The R Query is alright. But WH does not appear on the list of future products on SNFE exchange.
You can check for the same here.
https://www.interactivebrokers.co.in/en/index.php?f=41295&exch=snfe&showcategories=FUTGRP#productbuffer
You can try a different Australian exchange instead of SNFE.
Hope this helps!
Hi
I can't find any exchanges other than SNFE or ASX. Can anyone suggest some others?
Stephen
Yeah sure. After searching for the contract, It should be SNFE as per the product codes.
https://www.asx.com.au/prices/commodity-codes.htm
But it seems that the contract was delisted on 19/03/2002.
WH |
Wheat Futures | 26/03/96 | 19/03/02 |
Can you please share if you are able to see the contract historical data on TWS?
Will revert soon if anything else is noticed.
Hope this helps!