Note that there are some explanatory texts on larger screens.

plurals
  1. POR IBrokers. How to get currency contract to work in reqHistoricalData calls? e.g. CADUSD rates? And how to pull index prices? e.g. S&P, DJI?
    primarykey
    data
    text
    <p>I am currently learning how to use the <code>IBrokers</code> package.</p> <p>I can pull equity prices at frequencies I want, and option prices, but I'm currently stuck on pulling foreign exchange rates.</p> <p>I don't know how to set up the right <code>twsContract</code>, for calling with <code>reqHistoricalData</code>.</p> <p>I am interested in getting CADUSD currencies on say a 1 min basis. How can I do this?</p> <p>The example in the manual gives:</p> <pre><code>currency &lt;- twsCurrency("EUR") </code></pre> <p>When I try and call this with say <code>reqHistoricalData(tws, currency)</code> it comes back with an error saying something like "no historical data available 1D". As I can't even get the example in the manual to work, I'm rather stuck...</p> <p>Can someone please enlighten me as to what the correct syntax is? If I have a couple of examples that actually work, I can take it from there.</p> <p>Also, when I try using <code>"USD.CAD"</code> or <code>"CAD.USD"</code> as the ticker in the <code>twsContract</code> object, I'm getting complaints that this isn't a valid security. How can I find out what the right ticker name for <code>USD.CAD</code> would be? Right now I figure out the ticket for stocks by looking at my interactive brokers application which is open at the same time obviously, and typing the company name and doing a search. The ticker generally comes back e.g. (type apple, get back AAPL when I want to add this security to my portfolio in the interactive brokers workstation).</p> <p>Any help would be much appreciated.</p> <p>Also, another related question is how can I pull the historical of say the S&amp;P500 price index on a 1 min basis say?</p> <p>I am guessing I would use a <code>twsContract</code> object in R, but I don't know what parameters to use. What should the ticker be? The trade workstation mentions it's an "index" product type (obviously), which doesn't fit into any of the wrappers like <code>twsStock</code>, <code>twsCurrency</code> etc... Again, Is there an example of this somewhere, which actually works? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload