Hi,
In the attached code, I trade only using limit orders, but the fills I get don't seem to correspond. I would be grateful if someone could help me reconcile it. The code is extremely simple and minimal and the idea is:
- at start of each day place a limit order to buy at a set price
- if it is unfilled at the end of the day, cancel it.
This is done using scheduler.
Expected results
On Nov 1, 4, 5, 6 we should buy 100 TLT at 85.50, then nothing for a while, then again on the 27 and 29th.
Yahoo OHLC data
Observed results
We trade on the right days, and usually for the right amount (100 shares).
The trade prices are not my limit price, but tend to be 10 to 15 cents off either way.
On Nov 1st we somehow buy 300 shares, up to 86.06.
Clearly there is something I've misunderstood even in this simple test script. Can anyone see how these fills are resulting from a simple limit order?