joshuaulrich / IBrokers

R API to Interactive Brokers Trader Workstation
65 stars 54 forks source link

Realtime feed restart after gateway reset #20

Open richard987 opened 4 years ago

richard987 commented 4 years ago

Hi Josh,

I have been enjoying using IBrokers. However I am having one issue: I’m using the IBController (github) to run IB gateway version 972. Sometimes the internet will drop out and then I will get reconnected from the gateway to IB with no issues. However my live data feed (eg EURAUD) using IBrokers in R which runs continuously will not restart and I have to manually restart my script. Is there a way to fix this so that the R script will stop the feed so that it can restart successfully?

Also – could you point me to an explanation of what blocking=TRUE does? Should I be setting this to false?

Thanks and regards,

Richard

richard987 commented 4 years ago

My script uses the following realtime feed: fh <- file('E:\live\euraud\euraud.dat',open='a') contract<-twsCASH(symbol="EUR",exch="IDEALPRO", currency="AUD") reqRealTimeBars(tws, contract, whatToShow="BID", file=fh, useRTH = FALSE,verbose=TRUE)