SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
EdisonCruise
Topic Author
Posts: 105
Joined: September 15th, 2012, 4:22 am

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

May 21st, 2017, 6:14 am

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.
 
User avatar
mtsm
Posts: 351
Joined: July 28th, 2010, 1:40 pm

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

May 22nd, 2017, 4:35 am

You can't and your back test should not do that either, it's bogus. You need to be more conservative. 
 
User avatar
EdisonCruise
Topic Author
Posts: 105
Joined: September 15th, 2012, 4:22 am

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

May 22nd, 2017, 6:43 am

Thank you. But which price should I use in back test? Should I use the first 5 minute price averaged by volume?
 
User avatar
Martinghoul
Posts: 3255
Joined: July 18th, 2006, 5:49 am

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

May 22nd, 2017, 8:14 am

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.
 
User avatar
outrun
Posts: 4573
Joined: April 29th, 2016, 1:40 pm

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

May 22nd, 2017, 9:09 am

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. 
 
User avatar
Alan
Posts: 9832
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

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

May 22nd, 2017, 7:36 pm

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?
 
User avatar
outrun
Posts: 4573
Joined: April 29th, 2016, 1:40 pm

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

May 22nd, 2017, 7:56 pm

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.
 
User avatar
mtsm
Posts: 351
Joined: July 28th, 2010, 1:40 pm

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

May 23rd, 2017, 2:16 am

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.
 
User avatar
EdisonCruise
Topic Author
Posts: 105
Joined: September 15th, 2012, 4:22 am

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

May 23rd, 2017, 9:40 am

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.
 
User avatar
mtsm
Posts: 351
Joined: July 28th, 2010, 1:40 pm

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

May 24th, 2017, 12:19 am

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.
 
User avatar
EdisonCruise
Topic Author
Posts: 105
Joined: September 15th, 2012, 4:22 am

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

May 24th, 2017, 8:33 am

Thank you. I am new in this area. Do you have any recommeded paper or book on this topic? 
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...


GZIP: On