Paul, nice idea but it won’t work in practice. You are trying to beat the market maker, which is unless you are faster, has no edge. Try it yourself and see. In addition theoretical execution (deterministic close price in simulation) is never equals to the price you get (MKT order out).

Traveling Trader