problems retreiving realtime data V3 bloomberg
2 次查看(过去 30 天)
显示 更早的评论
i am running real time data retreival via bloomberg v3 like this
>> [subs,t] = realtime(c,{'IBM US Equity','F US Equity'}), {'Last_Trade','Volume'},'v3stockticker') Error using blp/realtime (line 32) Not enough input arguments.
I do not understand the error in line 32. The corresponding line is posted below:
if ischar(f)
0 个评论
采纳的回答
Geoff Hayes
2014-7-7
编辑:Geoff Hayes
2014-7-7
There is an additional bracket in your line of code
[subs,t] = realtime(c,{'IBM US Equity','F US Equity'}), ...
{'Last_Trade','Volume'},'v3stockticker')
Note the close bracket after {'IBM US Equity','F US Equity'} which means that the realtime function inputs are limited to just c and {'IBM US Equity','F US Equity'}
[subs,t] = realtime(c,{'IBM US Equity','F US Equity'})
and the last two inputs are ignored..which means that not enough inputs are supplied and so the error message makes sense.
Just remove that unneeded bracket, replacing your line of code with
[subs,t] = realtime(c,{'IBM US Equity','F US Equity'}, ...
{'Last_Trade','Volume'},'v3stockticker')
Try the above and see what happens!
3 个评论
Geoff Hayes
2014-7-7
The "..." means that the second line is just a continuation of the previous line. I did that in this case because I found that the line of code took two lines and it seemed cleaner to separate it in this fashion. Copying something like
x =
randi(4,1,1)
will fail with the Error: Expression or statement is incomplete or incorrect. when pasted into (and then run from) the Command Window, but
x = ...
randi(4,1,1)
will work.
As for accumulating the data, you could try to store the numeric data in a matrix (or cell array if some non-numeric data is expected) for each set of retrieved data points (in this case, I guess there would be data from IBM US Equity and F US Equity). You could probably just update the sample callback that you referenced in a previous question. Rather than storing the data in A that gets created on each call, you could use a persistent variable to store the data each time the callback is called. Of course, given the update rate (how often the callback is called) your new matrix might get very large.
I don't have the DataFeed Toolbox so can't provide much more detail. Type doc persistent in the Command Window for details on persistent local variables.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Bloomberg Desktop 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!