Limit order fills

Discussion in 'Strategy Building' started by Dhalsim, Nov 14, 2012.

  1. Dhalsim

    Dhalsim

    I have some strategies which use limit orders for both entries and exits.

    Now when back-testing when target is hit (which is limit order) then the program exits at that target price. My last system trades the ES and therefore assumes when price hits both entry limit order and target limit order that we get filled both times.

    Do you guys do worst case scenario or limit orders for entries and exits??
    When backtesting i have started to put all my entry limit orders so price has to trade through entry price 1 tick (but i still place entry as the limit order price if filled). So this therefore assumes if prices hits entry price we do not get filled unless price trades through.

    I have done the same for targets and target being hit is only if price has traded though our target line.

    All stops are hit and filled if prices even touches stop price.

    Therefore, with trading something like the ES i would assume this method of entry and target would have no slippage (or in rare cases slippage in my favour), and maybe some slippage in very fast market with the stops.

    How do you guys program limit orders and what is the correct way to do this?
     
  2. jelite

    jelite

    What you are doing is essentially correct. In liquid instruments like ES, this should get you pretty close to actual live trading results (backtest ~ live). Of course, if you wanted to be absolutely conservative, you would also include all trades that only touched the entry (not traded through) and subsequently lost. But this scenario is most likely offset by all the trades that only touched and subsequently won and therefore shouldn't make much difference for your strategy (assuming you are not talking about some high-frequency trading strategy, where this could matter). By the way, even for breakout type strategies, I often adopt this approach (testing entries with limit orders) as it allows to filter out those few trades that ran away (in your favor...) and most likely wouldn't have been filled (or would have incurred huge slippage if filled as market order).
     
  3. DrewLR

    DrewLR

    If you entry on a position on limit, it essentially means that you are trying to buy low and sell high. Assuming that the price has to trade through your fill level is a conservative assumption, which is good.
    The problem could be with stops and targets.
    With stops, you are right to assume that you get stopped out once the price hits the stop level, however in reality you would get some slippage on that, which could be either positive or negative.

    Similar arguments goes with targets, which could be set either through stop orders or limit orders (with the relevant advavantages/disadvantages)
     
  4. feng456

    feng456

    I've NEVER, not once, had slippage on my stop trading the ES.

    Limit targets are filled once in a while (without price going through), but it is definitely good to go with worst case scenario when backtesting.
     
  5. emg

    emg



    u not supposed to know if u had slippage on stop. that is what slippage is all about.


    Higher education will able u to figure that out


    Higher Education!
     
  6. You've "graduated" to a new "slogan". :cool: :p :D
     
  7. Visaria

    Visaria

    Can u explain this pls for the benefit of those of us who do have higher education?
     
  8. dom993

    dom993

    I agree ... and would add that your strategy must include proper trade management for the situations where your entry level is hit (*not* traded through) and your entry order gets filled.

    I created a "FillType" for Ninja that gives systematic fill when entry order is hit, so that I can easily test my systems under those circumstances.
     
  9. Whenever I trade the ES in real time, the market has to hit my limit price a bunch of times first before I get filled. It is very frustrating.