A fill-or-kill order, often abbreviated FOK, instructs a market to fill the entire requested quantity immediately or cancel the order. It prevents a trader from receiving only a partial position when full execution is required.
The order can reduce partial-fill risk but may fail in a thin or fast-moving market. An automated strategy should handle cancellation explicitly and verify market depth, timing and price limits before attempting another action.
ELI5
A fill-or-kill order tells a market to complete the entire requested trade immediately at acceptable prices or cancel all of it. The trader does not accept a smaller partial position.
For example, a bot that needs 1,000 contracts together can send a fill-or-kill order and receive either all 1,000 or none. Thin markets may cancel these orders often, so the strategy must handle the result without assuming a trade happened.
