Automatic Pairs-trading Execution

Discussion in 'Automated Trading' started by econometrics, Apr 4, 2010.

  1. I am looking to automate my pairs trading and the signal model is ready, but am a little stuck in the execution phase.

    Anyone has experience building an automated pairs execution strategy? how do you decide when to add/remove liquidity
  2. Sent you a PM with more detail.

    It comes down to a few things that you probably already recognize. When you want to enter a trade do you NEED to get in at a set time/price? Usually you will be forced to take on the way in because you want into the trade now/ASAP but on the way out its much easier to add.

    If you have a profit target just throw it out there - if you want a trailing stop (and you can be fast enough) just cancel and resend a limit order instead of using a trailing stop.

    Usually getting into the trade is 50/50 but getting out is adding most of the time unless stopped out.
  3. you are right.

    Most of the time I try to add liquidity on one leg and take on the other. i don't mind paying a 1 cent b-a spread but some stocks trade at 3-4 cents spread which is too wide to take.

    I am thinking of something like this:

    calculate the cost of taking liquidity on a leg ( (bid-ask spread) * # of shares + ECN fee ) and if both legs cost about the same then go to [Execution 1], if the long leg costs unevenly more then go to [Execution 2], if the short costs a lot more then [execution 3].

    [Execution 1]: Enter both legs by adding liquidity, wait for one leg to be executed, enter the remaining leg immediately by taking whatever liquidity is available

    [Execution 2]: Enter the long leg at the bid and wait until the entire long leg is executed then enter the short leg by taking liquidity.

    [Exeuction 3]: reverse of 2
  4. couple things as food for thought....

    1) why do you mind about 3-4 cents spread on a stock priced at 500 dollar levels vs a 1-2 cent spread on a 9.99 stock? Percentages is all that matters...
    2) maybe you could run some backtests to get a better idea of your risk/reward ratios of a) taking one leg off first and then the other vs b) getting out all at once vs c) reducing both legs incrementally but in a balanced fashion, you will probably make an interesting observation (at least I did) which is that getting out of one leg completely before reducing the other is almost always the worst choice. Just my 2 cents...

  5. thanks. the 3-4 cents b-a spread is actually on some 50ish stocks.

    I am currently more focused on entering into the trade as opposed to getting out.
  6. bone

    bone ET Sponsor

    I am using Knight Direct - they have an institutional grade pairs order driver platform that is server based.