[R-SIG-Finance] IBrokers - problems getting prices with reqMktData

Stephen Choularton stephen at organicfoodmarkets.com.au
Tue Feb 1 03:05:45 CET 2011


Hi Joshua

No, I should have said I don't expect anyone to debug this - indeed I 
think it is probably something to do with TWS and how current market 
data rather than historic market data is managed and solving that might 
be getting rather outside the scope of the forum.

However, I was just wondering if someone else had a similar problem 
which would be likely if it is a 'system' type problem as likely as lots 
of people must be using reqMktData.

I once got into trouble with my lecturer when doing a 3rd year unit 
taking apart an emulation of the unix operating system.  He always said 
look at man, etc but this misses the well used technique of looking at 
your friend on the work bench and saying 'has that ever happened to 
you'.  You don't expect a free lunch, but a response often makes things 
a lot clearer.

I actually think the sort of help that web based groups (and 
particularly those associated with R) give is fantastic.

I had better make it clear in future posts that I don't want someone to 
work on an issue when all I want is a reaction if it has also happened 
to them.

Stephen Choularton Ph.D., FIoD


On 01/02/2011 12:23 PM, Joshua Ulrich wrote:
> Stephen,
>
> You're asking others to do an awful lot of work for you for free and
> in their spare time.  You're asking others to help debug ~800 lines of
> your code (not just R, but Perl as well!).  I would be surprised if
> anyone helps you with this (unless the issue is obvious to them).
>
> I don't say this to chide, but to help you ask questions that are more
> likely to be answered.  Someone will be much more likely to help you
> if you create a minimal example (without Perl) that replicates this
> issue with your callback code.
>
> Best,
> --
> Joshua Ulrich  |  FOSS Trading: www.fosstrading.com
>
>
>
> On Mon, Jan 31, 2011 at 5:14 PM, Stephen Choularton
> <stephen at organicfoodmarkets.com.au>  wrote:
>> Hi
>>
>> I am running on windows using an IB workstation with R talking to it.
>>
>> It all seems to work, but I find that when running my own callback (code
>> attached):
>>
>>   1. I have to make sure I start a clean (new) command windows or
>>      something goes wrong with the allocation of a transaction id via
>>      reqIds (Ok I just work around by opening a new command prompt and
>>   2. (big problem) I don't always get the prices back so the algorithms
>>      don't always work.  For example this is the output of that code:
>>
>> [1] "Existing Position: JBH " "18.51"
>> [3] "MYR "                    "3.65"
>> [5] "Spread "                 "14.86"
>> 2 -1 2103 Market data farm connection is broken:aufarm
>> [1] "I HAVE TRADED AT AVERAGE CLOSING SHORT. SELL"
>> [2] "52"
>> [3] "JBH. BUY"
>> [4] "280"
>> [5] "MYR"
>> [1] "Time"                    "2011-01-31 15:34:02.373"
>> [1] "LEI "                                NA
>> [3] "WOR "                                NA
>> [5] "Spread "                             NA
>> [7] "The boundaries are 4.46697721920205" "lower 2.44602278079795"
>> [9] " mean is 3.4565"
>> [1] "QBE "                                NA
>> [3] "AMP "                                NA
>> [5] "Spread "                             NA
>> [7] "The boundaries are 13.3779288310757" "lower 12.2030711689243"
>> [9] " mean is 12.7905"
>> [1] "QBE "                                NA
>> [3] "AXA "                                NA
>> [5] "Spread "                             NA
>> [7] "The boundaries are 12.1631661762672" "lower 11.1048338237328"
>> [9] " mean is 11.634"
>>
>> I'm getting the prices for JBH and MYR but not for the other stocks.  The
>> boundary/mean figures are hard coded in my function but were obtained in a
>> previous IB call but that was a different call reqHistoricalData where as
>> this is reqMktData.  My perl code to manage that part of the exercise is
>> attached.
>>
>> One thing I have noticed is that if I get my trader work station to show the
>> price and stop and restart my trading.R code I do get a price.  Does anyone
>> else have experience of reqMktData not showing prices if they are not live
>> on the TWS?
>> --
>> Stephen Choularton Ph.D., FIoD
>>
>>
>>
>> _______________________________________________
>> 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.
>>
>
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1204 / Virus Database: 1435/3414 - Release Date: 01/31/11
>
>
>



More information about the R-SIG-Finance mailing list