Quote from def:
Here is IB's implementation. Other brokers may treat them differently.
Summary of NYSE rules for entering/canceling/modifying market-on-close (MOC) and limit-at-the close (LOC) orders
All MOC/LOC orders must be received at NYSE by 3:40 pm unless entered to offset a published imbalance.
After 3:40 pm, you may only enter MOC/LOC orders on the contra side of the last imbalance published, regardless of size.
Example: If the 3:50 P.M. published imbalance reverses the prior published imbalance, only orders that offset the 3:50 imbalance publication will be accepted.
Exception: On expiration days, you cannot enter MOC/LOC orders after 3:40 PM to establish or liquidate positions related to a strategy involving derivative instruments, even if these orders would offset a published imbalance.
New York Stock Exchange (NYSE) rules also prohibit the cancellation or reduction in size of any market-on-close (MOC) or limit-at-the-close (LOC) order after 3:40 P.M. Eastern Time.