Problem using 'getdata' function using the Trading Toolbox

조회 수: 7 (최근 30일)
Gijs van Beek
Gijs van Beek 2020년 2월 25일
댓글: Annie Leonhart 2020년 3월 24일
I recently bought the Trading Toolbox to be able to receive data from Interactive Brokers (IB) in a simple way. A lot of the functions work fine, though I do experience some problems when using the 'getdata' and 'realtime' functions that are provided by the toolbox. They are somewhat the same functions and I do get the same errors as well when using them. In this topic I would like to focus on the 'getdata' function in this topic. When I use the following function I get the following error:
clear ibBuiltInErrMsg
d= getdata(ib,ibContract)
Error using comeventcallback (line 24)
Error firing event 'tickPrice' to
'@(varargin)ibBuiltInGetDataEventHandler(varargin{:},c)'.
Error using comeventcallback (line 24)
Error firing event 'tickPrice' to
'@(varargin)ibBuiltInGetDataEventHandler(varargin{:},c)'.
d =
struct with fields:
BID_SIZE: 6000000
ASK_SIZE: 1000000
As you can see, I do get the 'tickSize' data returned, but not the 'tickPrice' data. It seems the datarequest itself is fine, but processing the data gives the errors. Also, requesting historical data works great.
I tried requesting livedata using the PythonAPI and that works perfectly fine. Therefore I argue the problem is not in my configuration, but in the MATLAB function.
Anyone familiar with this problem? How can I solve this problem and receive the live price data? Thank you in advance!
I use the latest TWS API, MATLAB 2019b and the most recent Trading Toolbox. I tried other TWS API versions, but that did not resolve the problem.
  댓글 수: 4
Gijs van Beek
Gijs van Beek 2020년 3월 1일
편집: Gijs van Beek 2020년 3월 1일
Thanks a lot Annie! I finally got a response from MATLAB support as well. The problem in my case is/was that varargin{9}.price does not exist, but varargin{9}.Price does. This solved the problem!
Looking forward to the 'how to create event handlers to return TWS data'. Thank you in advance.
By the way, my system setup is:
- The most recent version of the IB API (9.79.01).
- My Matlab version 9.7.0.1296695 (R2019b) Update 4
- The Trading Toolbox is also the most recent (Version 3.6 (R2019b) 18-Jul-2019)

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Financial Toolbox에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by