problems retreiving realtime data V3 bloomberg

1 view (last 30 days)
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)

Accepted Answer

Geoff Hayes
Geoff Hayes on 7 Jul 2014
Edited: Geoff Hayes on 7 Jul 2014
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 Comments
Geoff Hayes
Geoff Hayes on 7 Jul 2014
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.
Paul
Paul on 7 Jul 2014
thanks a lot really appreciated your help

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!