HOME FORUMS BROKERS SOFTWARE BOOKS CONTACT US
Elite Trader Your Account  •  Become a Member  •  Help  •  Search    
    Forums ›› Technically Speaking ›› Automated Trading ›› Interactive Brokers API: How to get Routing Destination?  


Post A Reply
    Page 1 of 2:   1  2  
trader422
 

Registered: Jun 2006
Posts: 61

 

08-06-12 11:42 PM

I don't think there is any way, using the API, to get the routing destination data field for an order working in Trader Workstation (that is, the field with TWS header "Destination"). Can anyone prove me wrong?

After using the API for more than 10 years it just recently occurred to me that this would always have been really useful data to have, and would have solved a lot of problems over the years... not to mention, there seems to be no excuse for IB to not have provided it starting with version 1.0.

    Edit/Delete Quote Complain
tradelink
 

Registered: Feb 2008
Posts: 577

 

08-07-12 05:14 PM

the destination (SMART/ARCA/IDEALPRO/etc) is specified in the contract that is attached to the order, prior to sending.

you may wish to look at the tradelink.org code for the tws connector in source-> brokerservers -> twsserver for an example

    Edit/Delete Quote Complain
trader422
 

Registered: Jun 2006
Posts: 61

 

08-07-12 06:34 PM

Sorry, maybe I wasn't clear ... I'm talking about getting the routing destination for SMART routed orders that can get routed, and rerouted, anywhere after the order is transmitted.

    Edit/Delete Quote Complain
braincell
 

Registered: Jul 2011
Posts: 533

 

08-07-12 09:19 PM

According to the docs, if you specify the "exchange" field of the IContract, you can route it using that.

http://www.interactivebrokers.com/p...x/icontract.htm



exchange() As String
The order destination, such as Smart.



Try giving the exchange field a string such as "BATS" or whatever, and see where it goes.

If you mean for orders that are active in TWS but not initiated by the API, then you'd have to keep track of that yourself using contract ID (conID) fields. At least I think so. I'm still not sure I understood your question though.

    Edit/Delete Quote Complain
trader422
 

Registered: Jun 2006
Posts: 61

 

08-07-12 09:34 PM

Thanks for the post, braincell, but it sounds like you are talking about routing orders, whereas I'm just talking about finding the routing destination of already-routed orders ...

I promise this question is simple, so I must not be making myself clear ... one more time:

I've got a bunch of orders (U.S. equities) working. All the orders appear normally in TWS, and all the orders are fully known by my app using the API. TWS has a field with header "Destination" which reports the current routing destination for each order (NYSE, BATS, ISLAND, ARCA, etcetera). Since the orders were all SMART-routed, this data is unknown when I place the orders, plus for any order it might change at any time as the order gets rerouted.

The question is: TWS reports this information accurately in real time, all the time ... so why can't I get it through the API? Or, can I get it through the API?

    Edit/Delete Quote Complain
Craig66
 

Registered: Sep 2006
Posts: 384

 

08-07-12 10:09 PM

The routed-to exchange is in the 'execution' message.

    Edit/Delete Quote Complain
    Page 1 of 2:   1  2  
Post A Reply


Receive an email whenever a new post is added to this thread by subscribing to it.
 
Rate This Thread:

Forum Jump:
 

 

   Conduct Rules  -  Privacy Policy  -  Day Trader -  Day Trader Forum -  Best Trading Software -  Sitemap Copyright © 2013, Elite Trader. All rights reserved.    
 
WHILE YOU'RE HERE, TAKE A MINUTE TO VISIT SOME OF OUR SPONSORS:
Advantage Futures
Futures Brokerage & Clearing
AMP Global Clearing
Futures and FX Trading
Bright Trading
Professional Equities Trading
CTS
Futures Trading Software
DaytradingBias.com
Professional Trading Analytics
ECHOtrade
Professional Trading Firm
eSignal
Trading Software Provider
FXCM
Forex Trading Services
Global Futures
Futures, Options & FX Trading
Interactive Brokers
Pro Gateway to World Markets
JC Trading Group
Direct Access Trading
MB Trading
Direct Access Trading
MultiCharts
Trading Software Provider
NinjaTrader
Trading Software Provider
OANDA
Currency Trading
optionshouse
Option Trading & Education
Rithmic
Futures Trade Execution Platform
SpeedTrader
Direct Access Trading
SpreadProfessor
Spread Trading Instruction
thinkorswim by TD Ameritrade
Direct Access TradingAdvertisement
TradersStudio
System Building & Backtesting
Trading Technologies
Trading Software Provider
Trend Following
Trading Systems Provider