Trading Simulator - what to do with non-fillable orders?

Discussion in 'Automated Trading' started by NetTecture, Feb 5, 2012.

  1. byteme

    byteme

    As I said, you could model it using some kind of randomness - based on statistical data you've previously gathered for how your orders were filled in the past (in the edge case scenarios).

    Or, make your strategy more conservative - don't send orders larger than what the book is showing....except if your strategy depends on this feature.
     
    #11     Feb 6, 2012
  2. byteme

    byteme

    You have to build in triggers in your strategy that detect outlier events and deal with them as best as you can i.e getting flat/emergency hedging.

    If you have a position in the market that you can't get out of - perhaps it will make you a lot of money :D

    I don't think anyone will be able to give you a simple answer.
     
    #12     Feb 6, 2012
  3. there are two types of orders... Marketable and non-marketable. Don't submit (or cancel) non-marketable orders.

    For Example a marketable limit order could be offering out 10c BELOW the bid.


    A good rule of thumb for initial testing is to wait until the stock trades through your price by a penny. This will assure you got filled and offer enough of a pecimistic approach to make it realistic.
     
    #13     Feb 8, 2012
  4. To expand on this a little more - in an ATS you should never be submitting simple "Market" orders. You should be submitting marketable or non-marketable limit orders only (for example bidding cheap waiting for a big sweep down in the book {that you think will revert back to previous levels} is a non-marketable limit order).

    Have your system (especially in SIM) bid or offer with limit orders at a specific size & price. If the security trades through your price by a penny (if you are offering at $35.00 and the stock trades $35.01 you know your entire lot @ $35 would have been filled because you were either willing to sell cheaper than $35 or someone would always want to buy a penny cheaper).

    In real life most simulations are much more optimistic than trading actual shares/money. If you find something that works as I described above you will find it will perform about the same with money behind it (possibly better). This is when you can start to compare - run side-by-side simulation and real money once you get a strategy working and compare the numbers and fills until you know how much to adjust your simulation results.
     
    #14     Feb 8, 2012
  5. Example -

    Order book's: bid 1000 lots @ $10.00 / $10.01 @ 500 lots ask

    That's the whole book. Nothing else above/below.

    Your order is to BUY 2000 lots @ $10.03.

    Result is a partial fill: 500 lots @ $10.01

    Your unfilled 1500 lots is the new bid. Ask is empty.

    Book looks like: 1500 lots @ $10.03 / $0.00 @ 0 lots.

    The original bid is below you.

    ---

    If you want to make the simulation more complex, add all the price layers.

    Edit: WinstonTJ, +1.
     
    #15     Feb 8, 2012
  6. * Unless they are smaller than you. :D
     
    #16     Feb 8, 2012
  7. There is no way to predict market reaction to simulated orders when back test tick data has no volume change. Try:

    #1. Market Price must go through your order price and trade volume must support order size to simulate a fill.

    #2. Use volume as your fill trigger for sizing. ie. price must go through and traded volume > simulated order size x 2. If volume is < order size record a partial fill of 1/2 volume traded. rinse and repeat...

    #3. For limit orders depending on your order staging rules you may be able to use a combination of price touch and % of traded volume to simulate fills.

    #4. Add your processing and execution latency into your sim calculations if your using message accurate tick data. ie. if your system takes 50ms to receive and process ticks. Adjust your back test data to 50ms samples discarding all messages in between as in-actionable.

    #5: Use the leading tick for calculating results on simulated resting orders (stops, limits etc). Post results and process action triggers in the following message/tick to simulate lag. ie. cancels, new orders.

    #6. Key Fields are Bid, Ask BidSize, AskSize, last price and total traded volume. Cut new records on any change to bid/ask/last and calculate the volume differential. This way you can gauge what side is being hit and calculate accordingly.

    #7. Thin markets... illiquid options... Heavily quoted without volume. The above should filter these automatically. Fast markets and spikes may be handled by order staging rules. ie. Price must hit X in an orderly fashion before Resting order is submitted.
     
    #17     Feb 8, 2012
  8. Not really - it won't trade through you unless there is size to fill your order. It can't***


    ***It can technically however with price improvement and inter-exchange arbs someone will usually pick you up before it prints higher elsewhere.

    Let's say I'm looking to buy GOOG at $600.00 so I place a GTC bid to buy 1,000,000 shares (yeah one million) at $600.00.

    Why would GOOG trade $599 before my lot is filled?

    Conversely, if I'm offering 1,000,000 shares of GOOG at $625 (offering out to sell short) why would it trade through to $626 before my lot is filled?

    In both cases anyone buying would want the lower price and anyone selling would be above the NBO and outside the market.
     
    #18     Feb 8, 2012
  9. Just saying the order that crossed the spread and consumed whatever's in front of you may not be big enough to fill you entirely. So seeing price trade through your price in historical data may not imply you would have been filled entirely.

    "Let's say I'm looking to buy GOOG at $600.00 so I place a GTC bid to buy 1,000,000 shares (yeah one million) at $600.00.

    Why would GOOG trade $599 before my lot is filled?"

    It wouldn't. But your big-ass bid size might stop price from getting down to 599.

    I'm sure you know this .. but, it's hard to accurately test multi-lot liquidity providing strategies.

    1 lots crossing the spread .. easy.
     
    #19     Feb 8, 2012
  10. Using 1M shares for size was a bit over the top.

    Is OP trading futures? I didn't pick up on that and I don't know the first thing about futures markets.

    The message I was trying to relay to the OP is that if he assumes a fill at his target price when the price trades through his order by a penny, two pennies, etc. then he'll be able to assume a reasonable fill rate.

    I think we are saying the same thing except I don't know anything about how futures trade.
     
    #20     Feb 8, 2012