In the above code, the initial order would be "Buy 10 next bar at market".
Code: Select all
if LastBarOnChart then begin
if MarketPosition = 0 then
buy Qty Contracts next bar at market
else if MarketPosition = 1 then
sell Qty Contracts next bar at market;
end; // LastBarOnChart
In most cases, this market order is filled, but sometimes it happens that it is only partially filled in some brokerage order systems. In that partial fill case for Market order, MC seems to ignore the partial filled Market order. For example, if 7 contracts were filled, MC would not issue next Sell order at all. Wouldn't it be better if MC recognize the partially filled Market order and issue next Sell 13 contracts market order?