1

I would like to get historical execution data for the past n days (up to 60 days) through IBrokers package in R. Is this even possible via reqExecutions()? I have seen some examples, such as that posted at RMetrics. Sorry to cross-list in a sense...

If there is not an approach via IBrokers, is there another way to access this data and pull it into R for analytics?

Thanks-

tws <- ibgConnect()
id <- reqIds(tws)      
reqExecutions(tws, reqId = as.character(.Last.orderId), 
ExecutionFilter = twsExecutionFilter(clientId=id))
jd8585
  • 187
  • 1
  • 8

1 Answers1

1

You can only get executions for those days that you can check off in the TWS trade log. Bizzare but true and it limits you to a week.

You could log in to order management and download them but that will be hard to automate with a security token.

I've noticed a file in TWS directory jts\d???\executions.txt Here's an excerpt from today for another question I just answered.

USD,BOT,100000,1.20990,22:01:49,20150511,IDEALPRO,DU000000,,,

(the DU0's are my acct #)

SO no need to get the executions, you have them already if you're at the same computer.

brian
  • 10,619
  • 4
  • 21
  • 79
  • Someone just upvoted but this no longer works. The executions file isn't there in the latest version and all the logs are encoded. You could decode the logs every week and save them or save the unencoded api logs and extract/parse the execution and commissionReport data from them. Turn on api logging in the settings. – brian Nov 11 '19 at 21:27