'Unable to read beyond the end of the stream.' with ibtws

조회 수: 7 (최근 30일)
Bartlomiej Winter
Bartlomiej Winter 2019년 6월 30일
편집: Annie Leonhart 2020년 3월 30일
Hi all,
I recently purchased the trading toolbox and I've been following the tutorial on how to obtain historical market data but I always get his error message
'Unable to read beyond the end of the stream.' Hope someone can help.
Here is my code
ib = ibtws('',7497);
ibContract = ib.Handle.createContract;
ibContract.symbol = 'MSFT';
ibContract.secType = 'STK';
ibContract.exchange = 'SMART';
ibContract.currency = 'USD';
bdc = 13;
startDate = daysadd(today,-20,bdc);
endDate = daysadd(today-1,-1,bdc);
  댓글 수: 1
Sandro Hantke
Sandro Hantke 2020년 1월 4일
Hello, have you already solved the problem? I have the same problem and no solution to it. greetings

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

답변 (1개)

Annie Leonhart
Annie Leonhart 2020년 1월 4일
You need to be subscribed to realtime data on IB.
You need these subscriptions on IBKR:
CBOE Realtime: $1/m
US Equity and Options Add-On Streaming Bundle: $4.50/m
US Securities Snapshot and Futures Value Bundle: $10/m
  댓글 수: 9
Annie Leonhart
Annie Leonhart 2020년 3월 30일
편집: Annie Leonhart 2020년 3월 30일
ib = ibtws('',7496);
ibForex = ib.Handle.createContract;
ibForex.symbol = 'CL';
ibForex.secType = 'FUT';
ibForex.primaryexchange = 'NYMEX';
ibForex.exchange = 'NYMEX';
ibForex.LastTradeDateOrContractMonth ='202004';
startdate = floor(now)-1;
enddate = floor(now);
barsize = '1 min';
ticktype = 'BID';
d = history(ib, ibForex, startdate, enddate, ticktype, barsize)
Try this.
If this doesn't work, you should download and use the IB Gateway and turn the log on. Then when you run it, you can see what it's doing and I can better see what's going on :)
Allen Lee
Allen Lee 2020년 3월 30일
ib = ibtws('',7496);
ibForex = ib.Handle.createContract;
ibForex.symbol = 'CL';
ibForex.secType = 'FUT';
ibForex.primaryexchange = 'NYMEX';
ibForex.exchange = 'NYMEX';
ibForex.LastTradeDateOrContractMonth ='20200421';
startdate = floor(now)-1;
enddate = floor(now);
barsize = '1 min';
ticktype = 'BID';
d = history(ib, ibForex, startdate, enddate,ticktype, barsize)
i tried this and it finally worked. thanks

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

카테고리

Help CenterFile Exchange에서 Transaction Cost Analysis에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by