I have back tested a strategy that appears to be rather promising. My back testing parameters require that I buy or short at the opening price and vice versa at the close. My general problem is identifying the gap in pre-market and then and ensuring that I get the correct opening price at the open. I could send market on open orders or limit orders but the problem is that the price could change if is send it via NASDAQ and the order has been processed. So how would i ensure that I get the correct opening price as indicated in my back testing? I'm new at this and I would appreciate any help I can get?