2

I am a beginning trader who is just using iBrokers package of R for algorithm trading.

My goal is to let R implement a strategy instantly when I get the right signal(market price).

But now I am stuck at the point that when I call function "reqMktData" to receive real-time data, I found R will not stop unless I manually stop it or I ask the function to return snapshot data.

Even though I may be able to write a while loop to get real-time data for the latter case, I found it very slow compared to what I want it to be (each call of reqMktData will take a few seconds).

I was wondering if anyone could provide some hints to achieve my goal. Or can anyone provide a working example of a loop that collects real time data through the IBrokers package and allows trading logic to be executed? I have spent a few days searching for solutions on internet and found nothing. Hope this is not a bad question. Thank you!

user3284048
  • 103
  • 1
  • 1
  • 5
  • I agree, there's little to nothing in terms of usable examples for real time trading using the IBrokers package. The last few pages of the following presentation are the most I've found. https://www.rmetrics.org/files/Meielisalp2009/Presentations/Ryan.pdf – bill_080 Feb 07 '14 at 16:17
  • You should probably reword your last paragraph so that it's a specific question. I suggest "Can anyone provide a working example of a loop that collects real time data through the IBrokers package and allows trading logic to be executed?" – bill_080 Feb 07 '14 at 16:45
  • Thanks for the suggestion. I will make my question more specific. – user3284048 Feb 08 '14 at 13:05
  • Here's a modified "snapShot" that runs fast, but it gets the "Last" price only. Also, there's no timestamp. http://stackoverflow.com/questions/15096987/ibrokers-reqmktdata-how-to-add-timeout-to-the-callback-function – bill_080 Feb 08 '14 at 19:57
  • To update for people interested, I finally gave up this way and turn to specific trading software like openquant. – user3284048 Jun 16 '15 at 13:02

0 Answers0