4

I'm attempting to run Interactive Broker's included code sample.

http://www.interactivebrokers.com/download/JavaAPIGettingStarted.pdf

On about page 42 it details how to pull market data feeds. My question is, has anyone successfully put in the parameters needed to pull currency pair data??

 public synchronized void reqMktData(int tickerId, Contract contract, String genericTickList, boolean snapshot)

I cannot find the valid inputs that will correct the errors I'm seeing from the client.

Parameters needed

List of values inside Contract class are here : https://www.interactivebrokers.com/en/software/api/apiguide/java/contract.htm

STK == "stock" , should this be set to CASH for Forex data?

IDEALPRO == the exchange according to this page : http://ibkb.interactivebrokers.com/tag/fx-trader

USD.JPY = SYMBOL (this here is a guess on my part)

USD == "underlying currency" , here I am guessing again.. seems the currency needs to match the transaction currency.

the pair in the format Transaction Currency.Settlement Currency (example: EUR.USD). The Underlying column will display only the Transaction Currency.

dialog box of inputs

Erik
  • 2,782
  • 3
  • 34
  • 64

2 Answers2

8

After scouring IB's forum I have found something that works for FX data feeds. You need to put the TransactionCurrency as the Symbol, and the SettlementCurrency as the underlying in the dialog box.

correct dialog box

Here is the resulting data feed

resulting data feed

Erik
  • 2,782
  • 3
  • 34
  • 64
  • Thanks for this answer. There's nothing else online that helps solve this...not even through IB (easily, at least). – Greg Apr 16 '15 at 17:59
0

As I can remember, I used: CASH, IDEALPRO, EUR.USD, USD

You can see all parameters example in the TradeStation client. Just find the needed instrument and look at it's properties.

And remember that not all parameters must be necessarily filled

At the worst, show the error.

astef
  • 8,575
  • 4
  • 56
  • 95
  • I believe I've found typos then.. should the underlying be the transaction currency? or should it be the Settlement currency? I'm seeing both in places on their site / docs.. Many thanks for the params, and yes I understand not all are required. – Erik Jan 14 '14 at 07:43
  • Sorry, I can't say for sure – astef Jan 14 '14 at 08:01
  • I'm getting an error : "1 | 200 | No security definition has been found for the request" – Erik Jan 14 '14 at 16:12