Historical FX Data via IBrokers API

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Historical FX Data via IBrokers API

Glenn Dunster
Greetings,

Is anybody here using the IB API and R to download historical FX data?  I
couldn't find any references to success or failure using RSeek or Googling.

The response my attempts elicit suggest that the data isn't available,
though I can fetch the same without problem using ActiveX/Excel. As I'm a R
neophyte, I'd like to check firstly if my code is incorrect in my various
attempts. Note that I've had no problem retrieving quotes and market data
for the same currency:

[1] "GBPJPY"
> GBPJPY <- getContract("GBPJPY")
> get_quote("GBPJPY")
2 -1 2104 Market data farm connection is OK:usfuture
2 -1 2104 Market data farm connection is OK:hkfarm
2 -1 2104 Market data farm connection is OK:cashfarm
2 -1 2104 Market data farm connection is OK:usfarm
2 -1 2106 HMDS data farm connection is OK:ushmds2a
        BidSize BidPrice AskPrice AskSize
GBP.JPY   2e+06  131.275   131.31 1.5e+07

 > reqMktData(tws,twsCurrency("GBP"))
<20120314 18:03:20.843750> id=1 symbol=GBP bidPrice: 1.57055  bidSize:
14310000
<20120314 18:03:20.843750> id=1 symbol=GBP askPrice: 1.57065  askSize:
1000000
<20120314 18:03:20.843750> id=1 symbol=GBP bidSize: 14310000
<20120314 18:03:20.843750> id=1 symbol=GBP askSize: 1000000
<20120314 18:03:20.843750> id=1 symbol=GBP highPrice: 1.57460

> reqHistoricalData(tws, Contract=contract)
TWS Message: 2 -1 2104 Market data farm connection is OK:usfuture
TWS Message: 2 -1 2104 Market data farm connection is OK:hkfarm
TWS Message: 2 -1 2104 Market data farm connection is OK:cashfarm
TWS Message: 2 -1 2104 Market data farm connection is OK:usfarm
TWS Message: 2 -1 2106 HMDS data farm connection is OK:ushmds2a
waiting for TWS reply on GBP ....failed.
NULL
Warning message:
In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
  Historical Market Data Service error message:No data of type EODChart is
available for the exchange 'IDEAL' and the security type 'Forex' and '1 m'
and '1 day'

> reqHistoricalData(tws,Contract=contract,endDateTime='20120302 17:00:00
GMT', barSize='1 day', duration='2 W', useRTH="0",
whatToShow='MIDPOINT',file="")
waiting for TWS reply on GBP .....failed.
NULL
Warning message:
In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
  Historical Market Data Service error message:No data of type EODChart is
available for the exchange 'IDEAL' and the security type 'Forex' and '2 W'
and '1 day'

 > reqHistoricalData(tws,twsCurrency("GBP"))
waiting for TWS reply on GBP ....failed.
NULL
Warning message:
In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
  Historical Market Data Service error message:No historical market data
for GBP/CASH@IDEALPRO Last 1d

Appreciate corrections or advice, thank you

Glenn

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Historical FX Data via IBrokers API

Enrico Schumann

Hi Glenn,

this works for me:

require("IBrokers")
contr <- twsCurrency(symbol = "GBP", currency = "JPY")
tws <- twsConnect(sample(1e6,1))
results <- reqHistoricalData(tws,
                              Contract = contr,
                              endDateTime = "20120301 09:00:00",
                              barSize = "5 mins",
                              duration = "5 D",
                              useRTH = 0,
                              whatToShow = "MIDPOINT")

twsDisconnect(tws)
head(results, 5)

## should be something like
                     GBP.JPY.Open GBP.JPY.High GBP.JPY.Low GBP.JPY.Close
2012-02-23 23:15:00     125.9100     125.9100     125.840      125.8825
2012-02-23 23:20:00     125.8825     125.8825     125.815      125.8150
2012-02-23 23:25:00     125.8150     125.8550     125.815      125.8350
2012-02-23 23:30:00     125.8350     125.8800     125.825      125.8350
2012-02-23 23:35:00     125.8350     125.8925     125.825      125.8575

###[...]


Regards,
Enrico


--
Enrico Schumann
Lucerne, Switzerland
http://nmof.net/


Am 14.03.2012 11:32, schrieb Glenn Dunster:

> Greetings,
>
> Is anybody here using the IB API and R to download historical FX data?  I
> couldn't find any references to success or failure using RSeek or Googling.
>
> The response my attempts elicit suggest that the data isn't available,
> though I can fetch the same without problem using ActiveX/Excel. As I'm a R
> neophyte, I'd like to check firstly if my code is incorrect in my various
> attempts. Note that I've had no problem retrieving quotes and market data
> for the same currency:
>
> [1] "GBPJPY"
>> GBPJPY<- getContract("GBPJPY")
>> get_quote("GBPJPY")
> 2 -1 2104 Market data farm connection is OK:usfuture
> 2 -1 2104 Market data farm connection is OK:hkfarm
> 2 -1 2104 Market data farm connection is OK:cashfarm
> 2 -1 2104 Market data farm connection is OK:usfarm
> 2 -1 2106 HMDS data farm connection is OK:ushmds2a
>          BidSize BidPrice AskPrice AskSize
> GBP.JPY   2e+06  131.275   131.31 1.5e+07
>
>   >  reqMktData(tws,twsCurrency("GBP"))
> <20120314 18:03:20.843750>  id=1 symbol=GBP bidPrice: 1.57055  bidSize:
> 14310000
> <20120314 18:03:20.843750>  id=1 symbol=GBP askPrice: 1.57065  askSize:
> 1000000
> <20120314 18:03:20.843750>  id=1 symbol=GBP bidSize: 14310000
> <20120314 18:03:20.843750>  id=1 symbol=GBP askSize: 1000000
> <20120314 18:03:20.843750>  id=1 symbol=GBP highPrice: 1.57460
>
>> reqHistoricalData(tws, Contract=contract)
> TWS Message: 2 -1 2104 Market data farm connection is OK:usfuture
> TWS Message: 2 -1 2104 Market data farm connection is OK:hkfarm
> TWS Message: 2 -1 2104 Market data farm connection is OK:cashfarm
> TWS Message: 2 -1 2104 Market data farm connection is OK:usfarm
> TWS Message: 2 -1 2106 HMDS data farm connection is OK:ushmds2a
> waiting for TWS reply on GBP ....failed.
> NULL
> Warning message:
> In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
>    Historical Market Data Service error message:No data of type EODChart is
> available for the exchange 'IDEAL' and the security type 'Forex' and '1 m'
> and '1 day'
>
>> reqHistoricalData(tws,Contract=contract,endDateTime='20120302 17:00:00
> GMT', barSize='1 day', duration='2 W', useRTH="0",
> whatToShow='MIDPOINT',file="")
> waiting for TWS reply on GBP .....failed.
> NULL
> Warning message:
> In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
>    Historical Market Data Service error message:No data of type EODChart is
> available for the exchange 'IDEAL' and the security type 'Forex' and '2 W'
> and '1 day'
>
>   >  reqHistoricalData(tws,twsCurrency("GBP"))
> waiting for TWS reply on GBP ....failed.
> NULL
> Warning message:
> In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
>    Historical Market Data Service error message:No historical market data
> for GBP/CASH@IDEALPRO Last 1d
>
> Appreciate corrections or advice, thank you
>
> Glenn

_______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Historical FX Data via IBrokers API

harrisonmark1
In reply to this post by Glenn Dunster
You may also want to check out the 'twsInstrument' package as I think it
makes things easier.

Then you can do:
# Connect to TWS
tws <- twsConnect()

# Build the contract for GBP/JPY
contract <- buildIBcontract("GBPJPY")

# Request historical data
gbp <- reqHistoricalData(tws,
                  Contract = contract,
                  endDateTime = "20120312 17:00:00 GMT",
                  barSize = "1 day",
                  duration = "2 W",
                  useRTH = "1",
                  whatToShow = "MIDPOINT",
                  timeFormat = "1",
                  tzone = "",
                  verbose = TRUE,
                  tickerId = "1")




On Wed, Mar 14, 2012 at 5:32 AM, Glenn Dunster <[hidden email]>wrote:

> Greetings,
>
> Is anybody here using the IB API and R to download historical FX data?  I
> couldn't find any references to success or failure using RSeek or Googling.
>
> The response my attempts elicit suggest that the data isn't available,
> though I can fetch the same without problem using ActiveX/Excel. As I'm a R
> neophyte, I'd like to check firstly if my code is incorrect in my various
> attempts. Note that I've had no problem retrieving quotes and market data
> for the same currency:
>
> [1] "GBPJPY"
> > GBPJPY <- getContract("GBPJPY")
> > get_quote("GBPJPY")
> 2 -1 2104 Market data farm connection is OK:usfuture
> 2 -1 2104 Market data farm connection is OK:hkfarm
> 2 -1 2104 Market data farm connection is OK:cashfarm
> 2 -1 2104 Market data farm connection is OK:usfarm
> 2 -1 2106 HMDS data farm connection is OK:ushmds2a
>        BidSize BidPrice AskPrice AskSize
> GBP.JPY   2e+06  131.275   131.31 1.5e+07
>
>  > reqMktData(tws,twsCurrency("GBP"))
> <20120314 18:03:20.843750> id=1 symbol=GBP bidPrice: 1.57055  bidSize:
> 14310000
> <20120314 18:03:20.843750> id=1 symbol=GBP askPrice: 1.57065  askSize:
> 1000000
> <20120314 18:03:20.843750> id=1 symbol=GBP bidSize: 14310000
> <20120314 18:03:20.843750> id=1 symbol=GBP askSize: 1000000
> <20120314 18:03:20.843750> id=1 symbol=GBP highPrice: 1.57460
>
> > reqHistoricalData(tws, Contract=contract)
> TWS Message: 2 -1 2104 Market data farm connection is OK:usfuture
> TWS Message: 2 -1 2104 Market data farm connection is OK:hkfarm
> TWS Message: 2 -1 2104 Market data farm connection is OK:cashfarm
> TWS Message: 2 -1 2104 Market data farm connection is OK:usfarm
> TWS Message: 2 -1 2106 HMDS data farm connection is OK:ushmds2a
> waiting for TWS reply on GBP ....failed.
> NULL
> Warning message:
> In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
>  Historical Market Data Service error message:No data of type EODChart is
> available for the exchange 'IDEAL' and the security type 'Forex' and '1 m'
> and '1 day'
>
> > reqHistoricalData(tws,Contract=contract,endDateTime='20120302 17:00:00
> GMT', barSize='1 day', duration='2 W', useRTH="0",
> whatToShow='MIDPOINT',file="")
> waiting for TWS reply on GBP .....failed.
> NULL
> Warning message:
> In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
>  Historical Market Data Service error message:No data of type EODChart is
> available for the exchange 'IDEAL' and the security type 'Forex' and '2 W'
> and '1 day'
>
>  > reqHistoricalData(tws,twsCurrency("GBP"))
> waiting for TWS reply on GBP ....failed.
> NULL
> Warning message:
> In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
>  Historical Market Data Service error message:No historical market data
> for GBP/CASH@IDEALPRO Last 1d
>
> Appreciate corrections or advice, thank you
>
> Glenn
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> [hidden email] 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.
>

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Historical FX Data via IBrokers API

gsee
In reply to this post by Glenn Dunster
You have given us code that uses an object called "contract," but you
have not shown us what "contract" is.

If I define contract like this (using the twsInstrument package as you have)

contract <- getContract("GBPJPY")

then your code works for me.

1> contract <- getContract("GBPJPY")
Connected with clientId 100.
Request complete: GBP CASH JPY.
Disconnected.
> tws <- ibgConnect()  ## or twsConnect() or ConnectIB()
> reqHistoricalData(tws,Contract=contract,endDateTime='20120302 17:00:00 GMT',
+     barSize='1 day', duration='2 W', useRTH="0",
whatToShow='MIDPOINT',file="")
waiting for TWS reply on GBP ....... done.
1329717600,126.5975,126.840,125.785,126.225,-1,-1.000,0,-1
1329804000,126.2375,126.660,125.6575,125.820,-1,-1.000,0,-1
1329890400,125.780,126.6275,125.605,125.800,-1,-1.000,0,-1
1329976800,125.775,126.210,125.475,125.955,-1,-1.000,0,-1
1330063200,125.910,128.980,125.815,128.885,-1,-1.000,0,-1
1330322400,129.4025,129.785,126.9625,127.5425,-1,-1.000,0,-1
1330408800,127.5275,128.245,126.6925,127.935,-1,-1.000,0,-1
1330495200,127.925,129.6225,127.825,129.1475,-1,-1.000,0,-1
1330581600,129.2475,129.6025,128.7575,129.4375,-1,-1.000,0,-1
1330668000,129.395,130.110,129.1525,129.530,-1,-1.000,0,-1
NULL

Garrett

On Wed, Mar 14, 2012 at 5:32 AM, Glenn Dunster <[hidden email]> wrote:

> Greetings,
>
> Is anybody here using the IB API and R to download historical FX data?  I
> couldn't find any references to success or failure using RSeek or Googling.
>
> The response my attempts elicit suggest that the data isn't available,
> though I can fetch the same without problem using ActiveX/Excel. As I'm a R
> neophyte, I'd like to check firstly if my code is incorrect in my various
> attempts. Note that I've had no problem retrieving quotes and market data
> for the same currency:
>
> [1] "GBPJPY"
>> GBPJPY <- getContract("GBPJPY")
>> get_quote("GBPJPY")
> 2 -1 2104 Market data farm connection is OK:usfuture
> 2 -1 2104 Market data farm connection is OK:hkfarm
> 2 -1 2104 Market data farm connection is OK:cashfarm
> 2 -1 2104 Market data farm connection is OK:usfarm
> 2 -1 2106 HMDS data farm connection is OK:ushmds2a
>        BidSize BidPrice AskPrice AskSize
> GBP.JPY   2e+06  131.275   131.31 1.5e+07
>
>  > reqMktData(tws,twsCurrency("GBP"))
> <20120314 18:03:20.843750> id=1 symbol=GBP bidPrice: 1.57055  bidSize:
> 14310000
> <20120314 18:03:20.843750> id=1 symbol=GBP askPrice: 1.57065  askSize:
> 1000000
> <20120314 18:03:20.843750> id=1 symbol=GBP bidSize: 14310000
> <20120314 18:03:20.843750> id=1 symbol=GBP askSize: 1000000
> <20120314 18:03:20.843750> id=1 symbol=GBP highPrice: 1.57460
>
>> reqHistoricalData(tws, Contract=contract)
> TWS Message: 2 -1 2104 Market data farm connection is OK:usfuture
> TWS Message: 2 -1 2104 Market data farm connection is OK:hkfarm
> TWS Message: 2 -1 2104 Market data farm connection is OK:cashfarm
> TWS Message: 2 -1 2104 Market data farm connection is OK:usfarm
> TWS Message: 2 -1 2106 HMDS data farm connection is OK:ushmds2a
> waiting for TWS reply on GBP ....failed.
> NULL
> Warning message:
> In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
>  Historical Market Data Service error message:No data of type EODChart is
> available for the exchange 'IDEAL' and the security type 'Forex' and '1 m'
> and '1 day'
>
>> reqHistoricalData(tws,Contract=contract,endDateTime='20120302 17:00:00
> GMT', barSize='1 day', duration='2 W', useRTH="0",
> whatToShow='MIDPOINT',file="")
> waiting for TWS reply on GBP .....failed.
> NULL
> Warning message:
> In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
>  Historical Market Data Service error message:No data of type EODChart is
> available for the exchange 'IDEAL' and the security type 'Forex' and '2 W'
> and '1 day'
>
>  > reqHistoricalData(tws,twsCurrency("GBP"))
> waiting for TWS reply on GBP ....failed.
> NULL
> Warning message:
> In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
>  Historical Market Data Service error message:No historical market data
> for GBP/CASH@IDEALPRO Last 1d
>
> Appreciate corrections or advice, thank you
>
> Glenn
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> [hidden email] 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.

_______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Historical FX Data via IBrokers API

Glenn Dunster
In reply to this post by harrisonmark1
Garrett, apologies, I've just read your post after replying to Mark. As
mentioned, I miscopied my full example, but it appears I still made an
error, and/or mixed twsInstrument with alternative approaches to create my
own problem.

Now, it's much clearer

thanks & regards,
Glenn

P.S. and apologies to the board for forgetting to "reply all"

On 14 March 2012 22:36, Glenn Dunster <[hidden email]> wrote:

> Mark, thank you for the additional dimension. Coincidentally I had begun
> my code with twsInstrument, but accidentally sliced it off from my example
> posted to R-SIG.  I had written it:
>
> > twsInstrument(twsCASH(symbol='GBP',currency='JPY'))
>  Connected with clientId 100.
> Request complete: GBP CASH JPY.
> Disconnected.
> [1] "GBPJPY"
>
> I hadn't found the twsInstrument vignette the easiest read, so I'm pleased
> to have your alternative input format,and the ensuing example.
>
>
> Regards,
> Glenn
>
> On 14 March 2012 21:58, Mark Harrison <[hidden email]> wrote:
>
>> You may also want to check out the 'twsInstrument' package as I think it
>> makes things easier.
>>
>> Then you can do:
>> # Connect to TWS
>> tws <- twsConnect()
>>
>> # Build the contract for GBP/JPY
>> contract <- buildIBcontract("GBPJPY")
>>
>> # Request historical data
>> gbp <- reqHistoricalData(tws,
>>                   Contract = contract,
>>                   endDateTime = "20120312 17:00:00 GMT",
>>                   barSize = "1 day",
>>                   duration = "2 W",
>>                   useRTH = "1",
>>                   whatToShow = "MIDPOINT",
>>                   timeFormat = "1",
>>                   tzone = "",
>>                   verbose = TRUE,
>>                   tickerId = "1")
>>
>>
>>
>>
>> On Wed, Mar 14, 2012 at 5:32 AM, Glenn Dunster <[hidden email]>wrote:
>>
>>> Greetings,
>>>
>>> Is anybody here using the IB API and R to download historical FX data?  I
>>> couldn't find any references to success or failure using RSeek or
>>> Googling.
>>>
>>> The response my attempts elicit suggest that the data isn't available,
>>> though I can fetch the same without problem using ActiveX/Excel. As I'm
>>> a R
>>> neophyte, I'd like to check firstly if my code is incorrect in my various
>>> attempts. Note that I've had no problem retrieving quotes and market data
>>> for the same currency:
>>>
>>> [1] "GBPJPY"
>>> > GBPJPY <- getContract("GBPJPY")
>>> > get_quote("GBPJPY")
>>> 2 -1 2104 Market data farm connection is OK:usfuture
>>> 2 -1 2104 Market data farm connection is OK:hkfarm
>>> 2 -1 2104 Market data farm connection is OK:cashfarm
>>> 2 -1 2104 Market data farm connection is OK:usfarm
>>> 2 -1 2106 HMDS data farm connection is OK:ushmds2a
>>>        BidSize BidPrice AskPrice AskSize
>>> GBP.JPY   2e+06  131.275   131.31 1.5e+07
>>>
>>>  > reqMktData(tws,twsCurrency("GBP"))
>>> <20120314 18:03:20.843750> id=1 symbol=GBP bidPrice: 1.57055  bidSize:
>>> 14310000
>>> <20120314 18:03:20.843750> id=1 symbol=GBP askPrice: 1.57065  askSize:
>>> 1000000
>>> <20120314 18:03:20.843750> id=1 symbol=GBP bidSize: 14310000
>>> <20120314 18:03:20.843750> id=1 symbol=GBP askSize: 1000000
>>> <20120314 18:03:20.843750> id=1 symbol=GBP highPrice: 1.57460
>>>
>>> > reqHistoricalData(tws, Contract=contract)
>>> TWS Message: 2 -1 2104 Market data farm connection is OK:usfuture
>>> TWS Message: 2 -1 2104 Market data farm connection is OK:hkfarm
>>> TWS Message: 2 -1 2104 Market data farm connection is OK:cashfarm
>>> TWS Message: 2 -1 2104 Market data farm connection is OK:usfarm
>>> TWS Message: 2 -1 2106 HMDS data farm connection is OK:ushmds2a
>>> waiting for TWS reply on GBP ....failed.
>>> NULL
>>> Warning message:
>>> In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
>>>  Historical Market Data Service error message:No data of type EODChart is
>>> available for the exchange 'IDEAL' and the security type 'Forex' and '1
>>> m'
>>> and '1 day'
>>>
>>> > reqHistoricalData(tws,Contract=contract,endDateTime='20120302 17:00:00
>>> GMT', barSize='1 day', duration='2 W', useRTH="0",
>>> whatToShow='MIDPOINT',file="")
>>> waiting for TWS reply on GBP .....failed.
>>> NULL
>>> Warning message:
>>> In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
>>>  Historical Market Data Service error message:No data of type EODChart is
>>> available for the exchange 'IDEAL' and the security type 'Forex' and '2
>>> W'
>>> and '1 day'
>>>
>>>  > reqHistoricalData(tws,twsCurrency("GBP"))
>>> waiting for TWS reply on GBP ....failed.
>>> NULL
>>> Warning message:
>>> In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
>>>  Historical Market Data Service error message:No historical market data
>>> for GBP/CASH@IDEALPRO Last 1d
>>>
>>> Appreciate corrections or advice, thank you
>>>
>>> Glenn
>>>
>>>        [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> [hidden email] 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.
>>>
>>
>>
>

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Historical FX Data via IBrokers API

gsee
On Wed, Mar 14, 2012 at 9:57 AM, Glenn Dunster <[hidden email]> wrote:

> Garrett, apologies, I've just read your post after replying to Mark. As
> mentioned, I miscopied my full example, but it appears I still made an
> error, and/or mixed twsInstrument with alternative approaches to create my
> own problem.
>
> Now, it's much clearer
>
> thanks & regards,
> Glenn
>
> P.S. and apologies to the board for forgetting to "reply all"
>
> On 14 March 2012 22:36, Glenn Dunster <[hidden email]> wrote:
>
>> Mark, thank you for the additional dimension. Coincidentally I had begun
>> my code with twsInstrument, but accidentally sliced it off from my example
>> posted to R-SIG.  I had written it:
>>
>> > twsInstrument(twsCASH(symbol='GBP',currency='JPY'))
>>  Connected with clientId 100.
>> Request complete: GBP CASH JPY.
>> Disconnected.
>> [1] "GBPJPY"
>>
>> I hadn't found the twsInstrument vignette the easiest read, so I'm pleased
>> to have your alternative input format,and the ensuing example.
>>

I agree that the twsInstrument vignette is extremely difficult to read
because no one has written a vignette for twsInstrument! ;-)  If
anyone would like to write and contribute one I'd be happy to include
it.

Garrett

_______________________________________________
[hidden email] 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.