Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sample call to Interactive Brokers for a currency pair?

Tags:

trading

forex

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

like image 726
Erik Avatar asked Feb 14 '23 02:02

Erik


1 Answers

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

like image 156
Erik Avatar answered May 16 '23 07:05

Erik