Question about limit order fill in live vs demo trade

Discussion in 'Order Execution' started by ycxc16588, Dec 4, 2009.

  1. I have order execution question for ES mini daytrader, especially scalper.
    I started paper trading Emini recently. I've used ThinkorSwim and another simulator software. My observation is, in ToS, my limit order will always get filled as soon as last sale price touches it, however, in the other simulator, buy limit order will not get filled until last sale price moves one ticker (0.25pt in ES) below it, when it becomes ask price; vice versa, the sell limit order will only get filled until last sale price moves one ticker (0.25pt in ES) above it.
    My question is in live mode, what is the probability that sell order gets filled at ask and buy order gets filled at bid during normal trading hour when volatitity is not too high and volumes are decent.

  2. Soweeak


    Nice, I wanted to post the same thread.

    I think we were a bit naive with ToS; I mean if you watch the times & sales, you'll see that volume is not that big to fill all the bid in three or four seconds (unless T&S is false).

    But i also agree that for Ninja or IB demo accounts seems you are the last one to be filled.

    If someone has the truth, let us know... my sclaping strategy mainly depends on execution...
  3. MTE


    First of all, you cannot interpolate your experience in a demo to real trading. These demos are good for one thing only - getting yourself familiar with the platform. If your strategy depends on execution then you won't know whether you have a legit strategy or not until you actually start trading real money.

    There's a good chance that you will get filled on the bid (for buys) or ask (for sells), it just means that someone else has crossed the spread. The probability also depends on the depth of the bid/ask and your position in a queue.
  4. Soweeak


    Do you mean I have to test my strategy with real money ?
  5. MTE


  6. Well, MTE - you are wrong. Point.

    You can definitely write a simulator that has a worse behavior than the real market, and thus is "realistic" to the fact you wont get worse fills when switching to live.

    The trick is to make realistic assumptions about order low, and agreeable quite a lot of the demo accounts out there suck here.

    NinjaTrader and my own simulator (based on the approach from Ninja, just even "worse" in fills) are good examples here.

    What you have to do is, first, get a full order book to see bid/ask.
    Then, assume and track your order in the book - this is pretty easy. You start at the end of the order book (whenever it gets into view), whenever the order book gets smaller due to a trade, you move forward, when it grows bigger, nothing happens. This is in fact worse than the real exchange assumption as it is realistic people cancel orders in front of you - which you ignore.

    Then, you basically execute in line - and will get realistic fills. Same with market orders and stops - basically, dont assume you get hit "right away". When a stop is triggered, my own code makes a small delay (20ms at the moment), THEN takes the best prices it can get, but never better than the triggered price. THis makes sure I dont execute "in front" of a large order trigger - in fact, I most likely get a worse fill in fast markets than an exchange handled stop trigger, as my code mostly will always put my market order into the end, while realistically I may be a lot more in front.

    It really is a matter of having the proper simulation logic. Idiocies found are:
    * Execute market orders at best price, not realistically at bid/ask
    * not delaying execution (I delay by 150 ms), giving you the impression you get the price "visible" and then in real life you have an "internet delay" in there.
    * Not tracking limit order position and and market order position (the later only for stop orders).

    All this leads to REALLY bad divergences between simulation and real live and makes things bad in regards to quite a lof ot things - for example, you wont get in flight exeution issues with automatic strategies in such a market (because without artificial delay there is no "in flight" situation to start with). This leads to all kinds of crappy errors in automatic trading then (when one gets executions for already cancelled orders and is not prepared to handle them).

    But at the end, realistically, those are not issues in the form of "simulation is unrelistic", they are issues in the form of "bad simulators are unrealistic".

    I acutally work on my own framework, and my goal is to run all my strategies in both, real account AND sim in parallel - and to benchmark my sim code this way against the market, to see that my executions are realistic or a little worse than real.

    If you ask me - there is a lot of stuff I find crappy at NinjaTrader, but the simulator code there has some really nice features.
  7. MTE


    OK. :)
  8. Soweeak


    I am a little bit confused about T&S.

    I actually work for a french broker and I deal stocks. It is unbelievable for me to deal if I dont see each and every trade. But when I read forums it seems that is not 100% correct for futures (latency, connection problem or whatever).

    Could you please confirm ? Give a solution ?

    PS : I want to trade exclusively ES or YG.
  9. Well, IT DEPENDS.

    * Futures T&S are eithe accurate or total imagination, depending whether you trade electronic (ES) or Pit. See, electronically the computer outputs every change in bid/ask, trade, everything, without human error. Put - is people standing there reporting what they hear, which is prone to error, especially in fast markets. False prints (wrong price on a tick) is something happening there, for example, when the person just mistypes.

    * Then you have the data provider. If you ahve a high end provider (Zen-Fire, Rithmic, or others) you get every reported tick (according to the exchange rules). If you have a cheaper one, they may get aggregated - either "same price within 10ms", for example (which can be seen as ok - my T&W window does the same now, with a 1ms window), OR... in cases like Interactive Brokers, they deliver 10 price snapshots per second, which obviously is not a good way to get high/low and/or construct a time and sales report.

    So, if you do electronc (Globex) feed, you CAN have a high quality feed, but your provider must support it. If you get Pit, the feed quality is lower per definition.
  10. Thank you all for your comments. Especially NT has made excellents points regarding simulation vs live order execution though it is definitely too technical for most of us.
    Here are something I learned based on my research of internet trading forums.
    1. ES order execution is based on FIFO (first in first out algrithm). In reality, buy/sell limit order should expect 100% or near 100% fill at ask/bid assuming liquidity is not a problem, which might be very good assumption since average daily volume for ES was 2.8M during 2008 (in normal trading hour). Buy/sell limit order can get filled at bid/ask, but not 100% guaranteed. So my question to experienced scalper is what is the statistical percentage rate that buy/sell limit order can get filled at bid/ask.

    2. For practicing scalping strategy, we probabbly should assume worst scenario that buy/sell limit order will get filled only at ask/bid. Therefore, if price fluctuate within 5 tickes (0.5point), there would be nothing to scalp in that range. Mathematically, in order to scalp 0.25 pt, price range has to be at least 3 tickers, and 6 tickers for 1 pt and so on so forth.

    I have another interesting question. Is decimalization of stock quotation making scalping easier or harder? We assume liquidity is not a problem here.
    #10     Dec 4, 2009