Is there some way to place Market On Open orders? Or to place an order before the day starts so it executes immediately? (A couple responses I saw in other comments seems to make me think this cannot currently be done.)
The first and last minutes of the day often seem to have some of the most dramatic swings. As such, an order placed a minute or two after the market opens can be significantly different from the opening price.
For example, I ran a quick algorithm that used the schedule_function to buy first thing in the morning and sell at the end of the day. The close price is aright at the closing time, but the opening prices that I got are usually 2 minutes after the market opens. Here are the prices I got (along with the Open & Close data from Yahoo Finance and the differences) for the week of July 13-17. (The columns are a little misaligned)
DATE O(Yahoo) C(Yahoo) O(Quant) C(Quant) Delta(O) Delta(C)
2015-07-13 208.99 209.76 209.11 209.73 0.12 -0.03
2015-07-14 209.72 210.72 209.81 210.65 0.09 -0.07
2015-07-15 210.73 210.63 210.64 210.6 -0.09 -0.03
2015-07-16 211.87 212.27 211.84 212.22 -0.03 -0.05
2015-07-17 212.29 212.47 212.16 212.42 -0.13 -0.05
The opening prices that I get are up to $0.13 off that week-- sometimes high; sometimes low. The Closing prices are closer -- within about a nickel. Unfortunately, the algorithm I have dreamed up and tested in a spreadsheet draws heavily on Open & Close prices (mostly because they are freely available). As such, the results using Quantopian will be much different different from the spreadsheet's calculations.
PS. A second related question (but not related specifically to Quantopian). If I had placed Market on Open orders with a broker, could I have expected to have gotten the quoted values for the Open & Close? Or would I have gotten a price that might be off a few cents. (Assuming my order would not have been big enough to influence the market).
Tim