Buying Stock on Close - Or as close to it as possible
Posted: Mar 11 2015
Hi,
I have a strategy that trades stocks at the end of the day (in this case SPY). I have tested the strategy on daily bars. When I take the strategies that trade on the close and change the chart type to a 389 minute bar which will have a custom close time of 3:59PM. In this situation, my trade would be placed at 3:59 instead of 4PM. My broker is Interactive brokers and they do let me trade after 4PM, but I believe they will only allow limit orders after 4PM.
When I switch the strategies from a daily close to a close of 3:59, the performance degrades slightly. The strategy still looks great, but it tells me there is some extra money to be made if I continue to let the market sell off in that final minute.
My question is.....What options do I have to place my order closer to the close of the bar or even trading in the after hours session? My thoughts are the following:
1) Can I send an order a couple seconds before the actual close of the bar instead of using a custom session? If so, would I use intrabar order generation as well as a qualifying statement saying that "if my signal is hit and the time is >= 3:59:55
2)Can I send my order to buy the close using a limit order that would most likely fill seconds after the market closes? If this is possible, I believe the order needs to be a GTC order as well as a limit order. How do you send a GTC order with Powerlanguage and what settings do I need to set at Interactive Brokers? This of course puts me in a situation where I might not get a fill. Are there any settings that I should select to inform me of mismatches in the strategy position and the position at the broker?
3) I really don't want to do a market on close order because I want my signal to be generated just before the end of the day.
Is there anything I am not thinking of? I am moving towards having this automated and need to work through these details. Any best practices from people who have been in the same or similar position would be greatly appreciated.
Thanks
Jeremy
I have a strategy that trades stocks at the end of the day (in this case SPY). I have tested the strategy on daily bars. When I take the strategies that trade on the close and change the chart type to a 389 minute bar which will have a custom close time of 3:59PM. In this situation, my trade would be placed at 3:59 instead of 4PM. My broker is Interactive brokers and they do let me trade after 4PM, but I believe they will only allow limit orders after 4PM.
When I switch the strategies from a daily close to a close of 3:59, the performance degrades slightly. The strategy still looks great, but it tells me there is some extra money to be made if I continue to let the market sell off in that final minute.
My question is.....What options do I have to place my order closer to the close of the bar or even trading in the after hours session? My thoughts are the following:
1) Can I send an order a couple seconds before the actual close of the bar instead of using a custom session? If so, would I use intrabar order generation as well as a qualifying statement saying that "if my signal is hit and the time is >= 3:59:55
2)Can I send my order to buy the close using a limit order that would most likely fill seconds after the market closes? If this is possible, I believe the order needs to be a GTC order as well as a limit order. How do you send a GTC order with Powerlanguage and what settings do I need to set at Interactive Brokers? This of course puts me in a situation where I might not get a fill. Are there any settings that I should select to inform me of mismatches in the strategy position and the position at the broker?
3) I really don't want to do a market on close order because I want my signal to be generated just before the end of the day.
Is there anything I am not thinking of? I am moving towards having this automated and need to work through these details. Any best practices from people who have been in the same or similar position would be greatly appreciated.
Thanks
Jeremy