Page 1 of 1

How to trade open price in practice as in my backtest?

Posted: May 21st, 2017, 6:14 am
by EdisonCruise
I have developed a strategy by trading open price. However, how should I make order in practice to make the return of my strategy as close as in backtest? There are some ways I can think of:
1) Send limit order with limit price in call auction period before market open. This way seems to able to get the open price but I think if the amount is big, it will be not applicable.
2) Send market order in a few minutes after market open. Then hope most of the positive and negative fluctuations can cancel each other, then we can get the open price in average in the long term. But how can I estimate this effect in my backtest?
3) The combination of the above two.
So what's the common method in practice?
Thank you.

Re: How to trade open price in practice as in my backtest?

Posted: May 22nd, 2017, 4:35 am
by mtsm
You can't and your back test should not do that either, it's bogus. You need to be more conservative. 

Re: How to trade open price in practice as in my backtest?

Posted: May 22nd, 2017, 6:43 am
by EdisonCruise
Thank you. But which price should I use in back test? Should I use the first 5 minute price averaged by volume?

Re: How to trade open price in practice as in my backtest?

Posted: May 22nd, 2017, 8:14 am
by Martinghoul
You need to figure out what your strategy does: hit/lift the mkt or place limit orders and wait for hits/lifts.  Depending on this, you will need to estimate either the expected transaction costs or fill percentages, which can then be used to run the backtest.

Re: How to trade open price in practice as in my backtest?

Posted: May 22nd, 2017, 9:09 am
by outrun
Trading the opening is tricky. Before the exchange is open there will be a large set of both limit and market orders in the order book. The opening price and volume will be based on a matching algorithm that typically tries to maximize the traded volume (at a single price) by matching order.

What's tricky is that the orderbook is visible to parties and a lot of people are placing orders based on the orders already in the book. Everybody will monitor the theoretical opening price, and how it changes when the orders in the book change. It's a system with a lot of feedback and tactical behaviour. 

Re: How to trade open price in practice as in my backtest?

Posted: May 22nd, 2017, 7:36 pm
by Alan
So, the NYSE offers a market-on-open (MOO) order here. Presumably, your broker has to offer this order type and then I will guess there is a time limit preventing you from entering this order too close to the time of the open. (I see 9:28am as the cutoff for MOO reported at some websites). Beyond those qualifications, why doesn't this order work?

Re: How to trade open price in practice as in my backtest?

Posted: May 22nd, 2017, 7:56 pm
by outrun
Yes, that order will get filled at the opening (unless there is too much imbalance), that's what I would assume in my backtest if my orders were relatively small.

The issue is "if the amount it big". If that's the case then you'll get gamed: you do a large market buy order in the book, all offers increase their limit, you open very high, and the next print is low.

Re: How to trade open price in practice as in my backtest?

Posted: May 23rd, 2017, 2:16 am
by mtsm
Thank you. But which price should I use in back test? Should I use the first 5 minute price averaged by volume?
Yes something like this is commonly done, but more likely with a much much larger time interval. What I was saying is that if your strategy/backtest relies explicitly on open, it is of dubious quality. You need to factor in some kind of execution.

Re: How to trade open price in practice as in my backtest?

Posted: May 23rd, 2017, 9:40 am
by EdisonCruise
Thank you all for your replies.

My strategy is that first to forecast the up or down of a stock in the coming 5 days. If up, I buy, otherwise short. After 5 days, I close my position. In my back test, I just use the open price to open and close my position. 5 days should be a relatively long period. So intuitively if I finish my trades in the first 5 minute after open, then the 5 days return should not be too different from the assumption that I can trade open price in back test. Also the volume of first 5-miniute restricts my position size.

Re: How to trade open price in practice as in my backtest?

Posted: May 24th, 2017, 12:19 am
by mtsm
There is nothing wrong with the basic idea you describe. Lots of institutional players do this kind of stuff. However the way you think about it is probably a bit amateurish. We already said that you cannot realistically think about the opening market the way you do. Not possible. Also, you need to rethink the way you would manage your portfolio. In other words, you need to do some reading.

Re: How to trade open price in practice as in my backtest?

Posted: May 24th, 2017, 8:33 am
by EdisonCruise
Thank you. I am new in this area. Do you have any recommeded paper or book on this topic?