Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
413 views
in Technique[技术] by (71.8m points)

c# - Interactive Brokers IBAPI - Cannot get tick-by-tick data for ForEx contract

I am using Interactive Brokers IBAPI to connect to a running instance of TWS.

I am wanting to obtain tick-by-tick data for the forex pair EUR/USD. (The particular pair does really not matter.)

I am using the following API function to request the tick-by-tick data:

_ibClient.ClientSocket.reqTickByTickData(tickerId, contract, "Last", 0, false);

This call works fine for a stock contract like, say, TSLA.

The error message being returned in the case of a ForEx contract is:

Error. Id: 2, Code: 10189, Msg: Failed to request tick-by-tick data:No historical market data for EUR/CASH@FXSUBPIP Last 0

I am not requesting historical data.

Here is the contract object:

contract = new Contract
{
    Symbol = "EUR",
    SecType = "CASH",
    Exchange = "IDEALPRO",
    PrimaryExch = "IDEALPRO",
    Currency = "USD",
};

Here is the contents of the log file:

Next Valid Id: 1
Account list: *********
Market data farm connection is OK:cashfarm
Market data farm connection is OK:usfarm
HMDS data farm connection is OK:euhmds
HMDS data farm connection is OK:cashhmds
HMDS data farm connection is OK:fundfarm
HMDS data farm connection is OK:ushmds
Sec-def data farm connection is OK:secdefil
Error. Id: 2, Code: 10189, Msg: Failed to request tick-by-tick data:No historical market data for EUR/CASH@FXSUBPIP Last 0

Can anyone help me understand why I am not able to obtain tick-by-tick data for a ForEx contract?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...