[R-SIG-Finance] meaning of IBroker mktData information
Stephen Choularton
stephen at organicfoodmarkets.com.au
Fri Feb 28 21:14:55 CET 2014
Hi Brian
I would imagine anyone using IB data would discover the problem I did on
first use. If not they are being a bit too trusting in their data which
should never be taken simply on face value.
Clearly others have come across this problem and thanks to everyone who
pointed me towards the TWSAPI Yahoo group which has some material on
it. A suggested cause is that IB sacrifices comprehensive coverage in
order to keep to real time. That is, they do NOT transmit all the tick
info as at busy times it can push the data many second back away from
real time.
I have emailed IB asking them how I can accurately extract price and
size information from the stream. I will advise the group if I get
anywhere.
Stephen Choularton PhD, FIoD
On 01/03/14 12:28 AM, Brian G. Peterson wrote:
> Look at the Interactive Brokers API docs, or call IB, as you are,
> after all, paying them.
>
> There are lots of people on this list. If no one has answered, it is
> likely because:
>
> 1> your example is not reproducible
>
> 2> no one else has encountered your problem
>
> 3> it would take too much time for someone to test and try to help,
> if this is the case, consider paying someone to do it.
> see 1> above to help yourself by producing reproducible code
>
> Brian
>
> On 02/27/2014 05:41 PM, Stephen Choularton wrote:
>> I hope someone can help me with this. No one has replied so far.
>>
>> I am working on the principal that:
>>
>> 1. Volume is issued each time a trade takes place and is the cumulative
>> volume for the day, and
>> 2. lastPrice is the last price a trade took place and that is only
>> issued again when the price changes.
>>
>> This would lead me to be able to deduce the size of each deal from the
>> change in volume and apply the (current) lastPrice to the transaction.
>>
>> Have I got that right?
>>
>> Even if I have I still have a problem. Logic dictates that Volume !< 1
>> but for example if I extract just the price volume data I get some
>> examples like this:
>>
>>
>> 10:17:12.158900 volume: 135 Price: 33.13
>> 10:17:13.720741 volume: -47 Price: 33.13
>> 10:17:22.875066 volume: 589 Price: 33.15
>>
>> The original data was:
>>
>> <20140210 10:17:12.158900> id=1 symbol=NAB Volume: 263348
>> <20140210 10:17:13.048749> id=1 symbol=NAB askSize: 2334
>> <20140210 10:17:13.720741> id=1 symbol=NAB Volume: 263301
>> <20140210 10:17:13.721744> id=1 symbol=NAB lastTimestamp: 1391987823
>> <20140210 10:17:13.723745> id=1 symbol=NAB lastPrice: 33.16
>> <20140210 10:17:13.724759> id=1 symbol=NAB lastSize: 88
>> <20140210 10:17:13.943221> id=1 symbol=NAB askSize: 2246
>> <20140210 10:17:17.308927> id=1 symbol=NAB askPrice: 33.15 askSize: 589
>> <20140210 10:17:17.309927> id=1 symbol=NAB askSize: 589
>> <20140210 10:17:18.195319> id=1 symbol=NAB askSize: 889
>> <20140210 10:17:20.466965> id=1 symbol=NAB bidSize: 3998
>> <20140210 10:17:21.219959> id=1 symbol=NAB askSize: 589
>> <20140210 10:17:22.868062> id=1 symbol=NAB lastTimestamp: 1391987832
>> <20140210 10:17:22.873064> id=1 symbol=NAB lastPrice: 33.15
>> <20140210 10:17:22.874064> id=1 symbol=NAB lastSize: 589
>> <20140210 10:17:22.875066> id=1 symbol=NAB Volume: 263890
>> <20140210 10:17:22.877067> id=1 symbol=NAB bidPrice: 33.14 bidSize: 762
>> <20140210 10:17:22.878067> id=1 symbol=NAB askPrice: 33.16 askSize: 3332
>>
>> As you can see we also have two lastPrice's before the change in volume!
>>
>> I know you might say just use lastPrice and lastSize but logic dictates
>> you could have a lastPrice and multiple lastSize's but not multiple
>> lastPrice's but see three lastPrices in a row below:
>>
>>
>> 10:15:45.332624> id=1 symbol=NAB lastSize: 93
>> 10:15:45.987894> id=1 symbol=NAB lastSize: 50
>> 10:15:46.888228> id=1 symbol=NAB lastSize: 104
>> 10:15:47.447062> id=1 symbol=NAB lastSize: 50
>> 10:15:48.552406> id=1 symbol=NAB lastPrice: 33.10
>> 10:15:49.450579> id=1 symbol=NAB lastSize: 42
>> 10:15:50.201786> id=1 symbol=NAB lastSize: 122
>> 10:15:51.455403> id=1 symbol=NAB lastSize: 50
>> 10:15:54.460002> id=1 symbol=NAB lastPrice: 33.085
>> 10:15:55.461604> id=1 symbol=NAB lastPrice: 33.10
>> 10:15:56.463385> id=1 symbol=NAB lastPrice: 33.11
>> 10:15:57.568193> id=1 symbol=NAB lastSize: 58
>> 10:15:58.466236> id=1 symbol=NAB lastPrice: 33.10
>> 10:15:59.585589> id=1 symbol=NAB lastPrice: 33.11
>> 10:16:00.457302> id=1 symbol=NAB lastSize: 8
>> 10:16:01.344762> id=1 symbol=NAB lastSize: 50
>> 10:16:02.016870> id=1 symbol=NAB lastSize: 85
>> 10:16:02.900224> id=1 symbol=NAB lastSize: 46
>> 10:16:03.654076> id=1 symbol=NAB lastSize: 50
>> 10:16:04.464855> id=1 symbol=NAB lastPrice: 33.095
>>
>> (I have only shown the relevant lines.)
>>
>> Have I got this wrong? All I am trying to do is get accurate deal by
>> deal price and size data.
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R
> questions should go.
>
More information about the R-SIG-Finance
mailing list