HOME FORUMS BROKERS SOFTWARE BOOKS CONTACT US
Elite Trader Your Account  •  Become a Member  •  Help  •  Search    
    Forums ›› Technically Speaking ›› Automated Trading ›› Simulating Limit Trades in IB TWS  


Post A Reply
    
sf631
 

Registered: Jun 2009
Posts: 104

 

10-27-12 07:01 AM

I am building out an ATS stack to connect with IB (using the TradeLink framework to connect) and wanted to see if anyone has advice regarding how to best simulate order execution.

I rely heavily on limit orders at or slightly inside the NBBO (so a buy limit equal to best bid or best bid + 0.01) rather than market orders. I think this will create a couple of issues with regard to accurately testing my executions.

1) I assume when I use my papertrading account, which is based on live market data, my papertrading buy order doesn't appear on the NBBO since it's not real.
2) Also, I'm not sure whether the IB paper trading account is smart enough to execute my limit order (which is not displayed on the real NBBO) when the quote crosses it, or only an executed trade. As an example, the market is at 1.00 x 1.02, I place a (paper) limit buy order at 1.01. If the market moves to 1.00 x 1.01 but no order has been executed at 1.01 or less, will my buy order simFill?

If TWS paper trading doesn't handle these situations, does anyone know of a good solution? I've verified that TradeLink's simulator is not sophisticated to handle this scenario so that's not an option at present.

I know one route is to build my own simulator from scratch but I'd prefer to avoid that if at all possible

    Edit/Delete Quote Complain
Kevin Schmit
 

Registered: Nov 2005
Posts: 568

 

10-27-12 10:00 PM


Quote from sf631:

I'm not sure whether the IB paper trading account is smart enough to execute my limit order when the quote crosses it



Yes, the papertrading account is at least that smart. It does not appear to take into account your simulated queue position though, not even if you route direct. It does appear to execute against a consolidated order book built off of a full feed, not IB's retail snapshot feed.

All in all, though, it is a pretty accurate simulator. It's superior to most, if not all, of extant retail sims.

If you roll your own sim, and you want it to be more accurate than IB's, you will not only have to subscribe to an all-message all-venue feed (expensive), but you will have build a realtime consolidated limit order book (harder than it sounds), and then you will have to build an emulator for the local server-side IB socket API so that your OMS can interface with your sim in the same way your OMS will interface with IB once you start trading.

    Edit/Delete Quote Complain
EliteTraderNYC
 

Registered: Feb 2008
Posts: 178

 

10-27-12 10:38 PM

Hey why don't you try a real account with small money and a simulated account and see how big a percentage diff there is?

    Edit/Delete Quote Complain
Bowgett
 

Registered: Jul 2004
Posts: 908

 

10-27-12 10:41 PM

Test on live account with small 100 share lots.

    Edit/Delete Quote Complain
braincell
 

Registered: Jul 2011
Posts: 538

 

10-28-12 01:01 AM


Quote from Kevin Schmit:


All in all, though, it is a pretty accurate simulator. It's superior to most, if not all, of extant retail sims.



Based on a year or so of my experience in this area, I have to disagree with this. Your paper buy limit orders will execute if there are any trades occuring at or below your price. This is unrealistic because it places you directly at the top of the queue so to speak, as if you are an HFT. This can create very significant differences between paper and real money executions, especially in low liquidity.

The best approach is to consider your order filled (at the limit price) if a tick occurs below your buy limit price, because in reality, those two events will almost always coincide, unless your limit order has been sitting there from the previous day and you are among the first in the queue (and not even then in some cases). To do this, you need a feed that doesn't miss a single tick, and the IB feed will not be good enough for that.

    Edit/Delete Quote Complain
    
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