Limit orders in TS automated system?

Discussion in 'Automated Trading' started by sv651, Feb 4, 2006.

  1. sv651


    I have a non-optimized system in TradeStation that generated a smooth equity curve right off the bat.

    The core trading logic is very simple:

    If ConditionX then begin
    Buynext bar at BuyPrice limit ;
    SellShort next bar at SellPrice limit ;

    Based on the following characteristics, I'm wondering whether the system would be a good candidate for automated execution, either directly with TS or w/ signals routed elsewhere (IB or wherever):

    * Trades equities w/ tick-based bars
    * Stop-and-reverse (always in the market)
    * Average trade duration 12-16 bars, or about 9 minutes
    * 30-100 trades per day

    I could do a live run of course, but I'd prefer to go into it knowing more than I do now about the potential pitfalls. Any thoughts appreciated.
  2. Do not believe TS limit order fills as they appear in backtesting. TS grants a fill (in testing) after a single tick at the limit price. Even at times when the market trades at your price for a while, you might not get filled. This effects subsequent trades etc.

    Try it for a day and you will see.

    If your system can survive a tick of slippage each way then you could implement the convert to market after x amount of time feature.

    I had a lot of disappointments in real time automated trading when I counted on limits being filled on a short time frame.

    On the bright side, some folks on the TS o forum have used push pop and/or global variables to estimate trade through on limit orders. The techniques they have posted may enable you to glean a more accurate idea of what might actually happen.

    I decided to make my systems market order friendly and test accordingly.
  3. that's good advice.

    i've been experimenting for the first time with these myself. conversion to mkt orders after x seconds will usually kill these types of curves, especially in proportion to the frequency of the trades. so as mercurial pointed out, if there's a sweet spot you can find with these, it has to be slow enough that the slip doesn't destroy it

    a 'tick-through' backtesting option in TS would be significant

    the interesting thing i've encountered toying around with noise catcher limit code is that it seems to elicit trend. it's also nice to observe such high hit rates in production coming from a situation where i'm losing most of the time as i wait for infrequent dramatic recovery days. even if these operate at only a small profit margin after comms and especially slip, i think they're still giving pretty decent competition to mm's. been thinking about publishing some here on et with the hopes of initiating some kind of response to the increasing 'fuzz' in this stage of er2's lifecycle. experiment with SARs on high freq er2 vol break fades

    unfortunately, if er2 is headed anywhere like es, this wouldn't result in better autocorrelation so much as larger queues. not sure
  4. sv651


    I'm familiar w/ some of the backtesting limitations of TS w/ limit orders & have tried to get around them w/ the following adjustment to my code:

    Buy next bar at BuyPrice - N points limit ;
    SellShort next bar at SellPrice + N points limit ;

    With N set to 1, I lose < 1% of the trades. The naive assumption would be that I should expect fills 99% of the time since price trades through the original entry prices. How far off is this assumption?

    Even w/ N set to 22, only 10% of the trades are lost & the equity curve sitll looks OK.

    Thanks for comments.
  5. sv651


    Whoops -- correction; gave figures from the wrong version of the system.

    Offsetting the limit price by 1 cent reduces the number of trades by 3.5%, not 1%; and offseting the limit price by 5 cents reduces the number of trades by 20%.

    Equity curves still look solid though.
  6. i think i misunderstood. is this code attempting to capture a range, or enter some sort of breakout after a small retrace?
  7. sv651


    Nope, it's an extremely primitive counter-trend system -- price drops, you buy; price goes up, you sell.

    Entry & exit efficiencies are all over the map, as you'd expect, but results seem very robust no matter how I mess around with the parameters.
  8. Cents ? Can you talk in ticks here ? When you mentioned 1 "cent", did you really mean 1 "tick" ?
    BTW: this is a really interesting discussion....especially with regards to strategies using limit exits or entries that are not guaranteed to execute.
  9. sv651


    The underlying is a stock, so I really did mean "1 cent" ...