Skip to content

Instantly share code, notes, and snippets.

@creative-quant
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save creative-quant/a286d5c49280bc3f48e6 to your computer and use it in GitHub Desktop.

Select an option

Save creative-quant/a286d5c49280bc3f48e6 to your computer and use it in GitHub Desktop.
R - IBrokers - Historical Currency Data
library(IBrokers)
library(twsInstrument)
tws <- twsConnect(host='127.0.0.1', port=4001)
contract <- getContract("EUR.USD")
reqHistoricalData( tws, contract, verbose=T, whatToShow="BID" )
reqHistoricalData( tws, contract, verbose=T, whatToShow="ASK" )
twsDisconnect(tws)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment