# How near to "open" and "close" can I get?



## Punta (27 October 2011)

Hi all,

I am a total newbie to all this.  

How near can I get to buying a stock (etc) at the "open" price, and selling it at the "close" price?

I have been using end-of-day data to develop a strategy, and given that the data contains "open" and "close" prices, my strategy is based on realising these prices.  

As I understand it, the offers to sell, that remain outstanding once the "open" price is determined, will generally be above the open price, meaning that I won't actually be able to buy a stock at this price.  So I'm curious as to how near to the "open" price I could actually buy.  E.g. is it reasonable to assume I could buy for "open" plus one tick?

Thanks in advance for any answers,


----------



## Gringotts Bank (27 October 2011)

Open is staggered depending on the first letter of the code, close is at 4.10 pm.

ASX website will give you the details of the open times, but keep in mind there is a +/- 15 second window for each of the open stages.

To get the open and close prices, you enter the 'auction' period.  If your system is based on buying/selling the open/close and the system is buying spec or illiquid stocks, you may well not get the price that your system has indicated.  This will render many brilliant systems useless and is known as 'slippage'.


----------



## Punta (27 October 2011)

Ah okay, so the symbols do not all open at the same time.  I didn't know that.

So to get around slippage, I could e.g.

1) introduce a liquidity condition to my algorithm, e.g. only only trade days with reasonable volumes, meaning there is liquidity in the system and you should be able to open/close positions. 

2) In backtesting, check whether the prices in the first-bar post-opening are not systematically biassed compared with the open price.  I.e. check that realising the opening price it is not crucial to the system's success.  (And the same with the close side of things of course).


----------



## Gringotts Bank (27 October 2011)

yeh.  Getting the open and closing prices in a way that matches your backtested system is only realistic if trading say the top 20 stocks.  

The shorter the time frame between buying and selling, the gretaer will be the impact of needing to match what your system has shown you.  If your average % gain on all trades is say 0.4%, then getting the exact price is crucial, and unlikely!


----------



## Punta (27 October 2011)

Yeah that is what we're talking about here - averaging small percentages per day in intraday trading.  

I get what you're saying about not being able to obtain the official open/close prices.  But if statistically, close is higher than open, I would hope that buying at the start of the day, and selling at the end would net a profit.  

I have done a little bit of checking to see that on my "buy days", the price does not suddenly jump at the beginning/end (rendering "open" and "close" academic).  If, on average, the difference between open and close is realised steadily throughout the day, I should be able to buy low and sell high?!?  

Perhaps I won't know until I actually take the plunge and implement?!?


----------



## AlterEgo (28 October 2011)

Hi Punta,

You can certainly get filled *at* the open and close prices, by placing your order above the auction “match price” for a buy and below the “match price” for a sell during the opening and closing auctions. It’s possible that your orders could alter the open and closing prices though, depending on how liquid the stock is and what size volume you’re trading. However, given the small $ position sizes that you mention in another thread, I’d think you shouldn’t have much difficulty getting filled at the open and close prices, except in the more illiquid stocks. If you want to allow for the worst case, by all means add or subtract 1 tick from each order in your backtesting to ensure that the system would still be profitable with the added slippage. In your system you should filter out all stocks that are too illiquid for the volume that you are trading – check the stock’s average daily volume to ensure the stock is liquid enough to trade.


----------



## rx2 (22 December 2011)

I am also in the throws of developing a short term mechanical trading system and just starting to look at slippage. It is an EOD trading system, signals are taken based on the close and orders placed the following day on open. Avg. Profit/Loss % per trade is 1.01% with a duration of ~4 days. During backtesting it is important that the system buys/sells at open - it can handle a 1 tick difference and still be positive but with a significant performance hit.



AlterEgo said:


> Hi Punta,
> You can certainly get filled *at* the open and close prices, by placing your order above the auction “match price” for a buy and below the “match price” for a sell during the opening and closing auctions. It’s possible that your orders could alter the open and closing prices though, depending on how liquid the stock is and what size volume you’re trading. However, given the small $ position sizes that you mention in another thread, I’d think you shouldn’t have much difficulty getting filled at the open and close prices, except in the more illiquid stocks. If you want to allow for the worst case, by all means add or subtract 1 tick from each order in your backtesting to ensure that the system would still be profitable with the added slippage. In your system you should filter out all stocks that are too illiquid for the volume that you are trading – check the stock’s average daily volume to ensure the stock is liquid enough to trade.




A couple of questions pop into mind:-

1. How do you determine the "match price" for the auction? Isn't that only determined once the auction is complete?

2. When placing an order for the pre-open auction, how do others calculate there prices to ensure they are met in the auction? For a buy, would you just put a limit order in based on yesterdays close?


----------



## Punta (22 December 2011)

rx2 said:


> ... can handle a 1 tick difference and still be positive but with a significant performance hit.
> 
> 
> 
> ...




The first thing that springs to mind is how does one tick hammer a 1% profit? Unless you are massively leveraged, I wouldn't have thought one tick could have such a large impact?

By the time the auction match price is determined, it's obviously too late to be part of the auction.  I find that I am having trouble getting filled at "open", so write code that allows my position to be filled at (open + a small fraction), determined in backtesting.

Another option is to look at  products on the NYSE, which have a "market on open", or MOO order that is native to the exchange - the open is not determined like the ASX, but instead actually takes account of the number of buy/sell MOO orders.  I guess that if you are not putting through large volumes, you could submit MOO orders and hope that you don't affect the "dynamics" that make your system profitable


----------



## Gringotts Bank (22 December 2011)

I don't get this!

How can anyone not get filled at open?  You simply enter the auction with a bid that is at a healthy premium to the IAP.  Depending on the stock and how much you're buying, sure you might move the price up a touch, but you still get filled.

I can see how 1 tick slippage will destroy a lot of good systems.  1 tick in spec stocks can be 5%.

There's also MOC (market on close) which might help.  I think this will often reflect the actual close pretty closely.  It is a market order which buys the best sell at 3.59.59 or something like that, I think.


----------



## rx2 (22 December 2011)

Gringotts Bank said:


> I don't get this!
> 
> How can anyone not get filled at open?  You simply enter the auction with a bid that is at a healthy premium to the IAP.  Depending on the stock and how much you're buying, sure you might move the price up a touch, but you still get filled.




What is the IAP? (something Auction Price?)


----------



## Gringotts Bank (22 December 2011)

'indicative', since it moves around a bit in the pre-open before the final open is determined.


----------



## skyQuake (22 December 2011)

> Another option is to look at products on the NYSE, which have a "market on open", or MOO order that is native to the exchange - the open is not determined like the ASX, but instead actually takes account of the number of buy/sell MOO orders. I guess that if you are not putting through large volumes, you could submit MOO orders and hope that you don't affect the "dynamics" that make your system profitable




There is virtually NO volume at open for US stocks. They don't really have an opening match (or closing) like we do.

rx2, look up pre-open: https://www.aussiestockforums.com/forums/showthread.php?t=11619&highlight=pre-open

and http://www.asx.com.au/products/calculate-open-close-prices.htm

Though keep in mind that though some stocks may do good volume thru the day, they may do tiny tiny volume at the open. Eg. HGG


----------



## Gringotts Bank (22 December 2011)

....But they do have pre- and after market trading, whereas we don't.


----------



## Wysiwyg (22 December 2011)

> In your system you should filter out all stocks that are too illiquid for the volume that you are trading – check the stock’s average daily volume to ensure the stock is liquid enough to trade.



 Raising the liquidity filter to accommodate the size you are trading is the only way to back test reasonably accurately this system. Otherwise you can take part in the open and close every time in real time which would give a test forward indication of efficiency.


----------



## Punta (22 December 2011)

Gringotts Bank said:


> I don't get this!
> 
> How can anyone not get filled at open?  You simply enter the auction ...




I am reluctant to enter the auction, because I don't want to influence it.  I guess it all depends on the volume - if it is large then your bid/offer will have no impact.  

But I obviously wasn't in the auction when a strategy was developed and backtested, so have been reluctant to enter during forward testing.  I am having difficulty getting filled though, so maybe I should join in.  This can't be tested with paper trading though, and testing with real numbers would make me sweat.


----------



## Gringotts Bank (22 December 2011)

I'd just enter the auction and then make an assumption that this will be equivalent to Open + n% for your backtests.

Alternatively, you could write a macro to capture the surplus volume just before open, in order to see whether you really are influencing price all that much.  Do that for a month or two and you will know what n% really is.


----------



## rx2 (28 February 2012)

skyQuake said:


> Though keep in mind that though some stocks may do good volume thru the day, they may do tiny tiny volume at the open. Eg. HGG




I have noticed this with a few stocks on the asx300, in particular closing auction volume is always significantly higher than opening auction. I don't know whether this observation applies just to the stocks I have been watching or whether it's a general pattern that closing is always higher than opening?


----------

