Automated trading, market orders and less liquid instruments

Discussion in 'Automated Trading' started by chvid, Sep 29, 2007.

  1. chvid



    I am in process of putting my first automated trading system into production.

    It uses Interactive Brokers.

    Part of what it trades are commodity etfs and it does a form of trend following.

    It place orders a fixed times (10.45, 11.45, 12.45 ... 15.45, New York time) and it always does market orders.

    It will hold a position for around a week.

    I am wondering whether using market orders will be a problem given the liquidity of the instruments the system will trade.

    The least liquid of the funds is PowerShares DB Commodity Index (AMEX : DBC):

    Is the implied spread I get using Interactive Brokers' paper trading realistic?

    Or do I need to do some more refined order placement - i.e. a limit order.
  2. chvid


    For an example - the model catches the upward trend in gold of the past few weeks but is stopped out on tuesday as the gold price drops sharply.

    Gold opens 2% lower and drops further - at 10.45 NY time the last price from IB is 72.61 - and the model places a market sell order.

    The price it gets, and this is in paper trading, is 71.85! Nearly one percent lower than the last recorded price.


    The model gets about the worse price of the whole day :-(

    I guess this is the downside of stop/loss and market orders.

    <img src=""/>
  3. (1) IB paper trading is meant to learn basics... not back-test strategies.

    (2) I wouldn't use even IB's live data for anything...
    They won't even give you an NBBO quote...
    They won't give you a quote for their own IDEAL ecn...
    Which I get through a 3rd party.
    To trade ETFs.... spend the $200/month on a pro quote terminal like Thomson ONE or a Reuters product.

    (3) Your competition in ETFs...
    Is experienced traders equipped with high-end products from Reuters, etc...
    And black boxes running at < 10 ms latencies.

    (4) Your general approach of trend following... is probably worthless.

    (5) That said...
    Don't give up... and use ONLY Limit Orders.
  4. chvid


    QuantPlus - thanks for the answer.


    Yes. Probably.

    But there are certain things I cannot test in my back testing setup - i.e. how orders are filled.

    As well as the impact of the loss in or low quality of the data feed from IB.



    I know this is a problem.

    The holding period is pretty long - around one week on average.

    I am hoping this makes it less of a problem since I use price data from bigger windows.

    (I look at the OHLC bar for a 2 hour window rather than just the last close price.)



    But that applies to any instrument you can trade.

    And regardless of whether you do it by hand or via an ATS.



    I know.

    This is just to get started.

    I picked the ETFs since they appeared to be trending in a tradeable way.


    I have no intention of giving up ... yet.


    And limit orders - yes:

    Any good heurestics/simple algorithms for placing a limit order in this context?

    It should work in a stop/loss like situation - being able to get a good price in a market that moves against the trade (i.e a sell in a falling market).

    The order is placed after the fact (the drop leading to a sell order is already started).

    It should be executed within an hour.
  5. chvid


    I have been thinking about ways to improve the algorithm's short term order placement.

    Here are two simple approaches I am considering:

    1) Use market orders but only buy as the short term price movement is down.

    Keep using market orders but only place buy orders as the price is moving (short term) down.

    And vice versa for sell orders.

    2) Place a limit order at last recorded price +/-0.1% in opposite direction of the trade - good for 55 minutes.

    I.e. for a buy order where the last recorded price is 100 - place a limit all or nothing order good for 55 minutes at 99.9.

    If the order is not executed it will be cancelled by the model does it next pass one hour later.

    If there is still a buy signal and the price is at 100.5, the model will place a buy limit all or nothing order good for 55 minutes at 100.4.

    (And in this way continue until the order is succesful or the buy signal is gone.)