For daily bars, that will basically work because the orders placed will most certainly result in fills. So in this particular case, MarketPosition is not really needed unless you want to place these orders only when already flat.
In that case, just qualify the orders:
If MarketPosition = 0...