Hi all! i write a little program, based on IB API to enter into multiple positions right at market open, if certain criteria meet. now-one of the exit rules-exit on market close. i set my app to buy on 15:59:30. sometimes it works and i did get market close price, but many times-price move way above\below my price right at 16:00. today example-i short BRKS and cover at 19.41, but at 16:00-price drop to 19.25 and closing price is 19:25. that about 1% better! here is my question-how i can get a better price or when possibility to buy at bid greater than buying at ask? or-how to buy at bid and sell at ask? is market depth feature can help me some how? Thank you!