These are both market orders.
The only difference is that there are chances that you may have Buy this bar on close; unexecuted due to the session end.
You may set your session to end a little bit earlier than actual one.
Thanks, but I am getting confused!
1) What do you mean by "unexcuted due to the session end"?
2) To me, a market order is a market order, i.e. it will send the order, to buy the quantity specified, without considering the price. So, the order won't be unexecuted.
3) If both are market orders and there is a chance that the order will be unexecuted as you said. Does it mean that "Buy next bar at market" (Order 1) is superior than "Buy this bar at close" (Order 2)?
Or..... this is my guess:-
Order 2 will send the order 1 second quicker: it send the order at 59 second, before the balose, in order to try to capture the close of the current bar, while Order 1 send the order at 00 when the bar completes. Am I right??
If the above is not right, in what sense does Order 2 superior than Order 1? ... it should have, otherwise, there is no need to have two type of orders.
4) Does it have the same understanding for both IOG disabled or enabled?
5) I know that the difference of the above two orders in Portfolio Backtester - Order 2 uses bar close while Order Order 1 uses next bar open for calculation. It makes sense to me.
6) BTY, what type of order of the above or others can be used as MOC (market on close) order?
Can Strategy "SetExitonClose" can be use for real trading (haven't test it)? ......MOC order. Or it just can be used for backtesting~!