(Set theory:)
The order type is the abstraction of an order (a total order; I shall use just "order" in this writeup, as this how it's normally encountered). Let (A,<) and (B,«) be two ordered sets. We say they have the same order type if there exists an order preserving mapping from A to B:

• f: A→B, and f is one to one and onto B;
• For any x,y∈A, if x<y then f(x)«f(y).

Note how this extends the notion of cardinality from the category Sets to the category Ordered Sets. In particular, if (A,<) and (B,«) have the same order type then A and B have the same cardinality.

Cantor talked about the concept of "order type" -- all sets of a given order type, but in fact this cannot be presented as a set in modern set theory. However, we do have a class corresponding to an order type. More commonly, if we are given representatives of an order type we can use them to make statements about that order type. Such a statement is well defined if the particular choice of representatives make no difference to the truth of the statement.

Finite sets of a given cardinality have only one order type -- that exemplified by {1,2,...,n}. Thus, notions of cardinality and order type coincide in the finite case. The infinite case is more interesting. For example, N={1,2,3,...} (the set of natural numbers) and Z={...,-1,0,1,2,...} (the set of integers) are both countable sets -- they have the same cardinality -- but their order types are different. For instance, N has a first member, while Z has none. Q (the set of rationals) is also countable, but its order type is dense -- again, different from N and Z. An easy exercise is to show that the set Q∩(0,1) (rationals between 0 and 1) has the same order type as all of Q.

### Operations on order types

• We can add order types. If (A,<) and (B,«) are disjoint representatives of two order types, we define their sum as the order → on the union A∪B which places elements of A before elements of B: x→y iff either x∈A and y∈B, or x,y∈A and x<y, or x,y∈B and x«y.
• By using the lexicographic order, we can multiply two order types.
• We can define some, but not all, infinite multiples of order types. If we have ordered sets (Aα,<α)α∈I then we can compute an ordered infinite product if the index set I is well ordered. But usually it won't be, so we cannot compute this product in general.
Unlike for cardinals, the operations on order types are not commutative. For instance, we can add a set of one element before or after a set with the order type ω of the natural numbers. Adding before (and calling the single element "0", for convenience), we have a set with the order type 1+ω of {0,1,2,...}; this has the order type ω of the natural numbers (define f(x)=x+1 to see this). Thus 1+ω=ω. However, when adding after, we get the order type of a set {1,2,3,...,x}, which has a last element. Thus ω+1≠1+ω=ω.

On the other hand, addition of order types is associative. This is a common situation in mathematics. It probably shows that despite intuitive expectations to the contrary, associativity is more fundamental and important than commutativity. Go figure.

### Problems

We don't have a good concept of comparability of order types (we cannot say "which is larger"). We could try to say one order type is smaller than another if an order type can be added to the first to get the second. Unfortunately, the sum of two copies of the order type of Q is the order type of Q (e.g., note that the rationals <sqrt(2) and the rationals >sqrt(2) both have the order type of Q). And ω and ω* (the order type of {...,-3,-2,-1,0}) remain incomparable. This definition just doesn't have the properties we'd like.

We cannot define ordered infinite products. We cannot give a decent idea of powers of order types. We cannot do any of the things we'd like to do on "numbers".

So order types don't take the place of transfinite "numbers". Instead, Cantor limited himself to order types of well ordered sets. These have much nicer properties. They are the basis for the "ordinal numbers".

Of course, definitions of arithmetic operations on ordinals are easier. But we need to show that they coincide with the wider definitions -- given above -- for arithmetic operations on order types.

Order types remain a useful tool in the mathematician's arsenal. Many (most) interesting orders aren't well ordered. But being able to add and multiply them, even to the limited extent afforded by order types, can be useful.

### Introduction

So, you want to buy stock. You have an account with a broker, put cash in it, and know what stock you want to buy. You start fidgeting with the buy button, and are confronted with an option that is new to you: the order type. Maybe the names are spelled out, maybe they are just an abbreviation. What now?

In this write-up, I will attempt to list some of the more common and more often-used order types. Not all order types are available on all exchanges or on all products, and there also are a few that are not included in this write-up.

### Market order

The infamous market order is a buy or sell order that buys or sells a number of shares at market, namely at the best offer or bid, respectively. There is no price limit (well, on some exchanges, you can't push a stock more than a certain percentage, say 10%, because then it will be pushed in auction). As such, you don't know what price you are going to pay. If you see for instance a \$10 offer, and put in a market order, and the offer disappears while you are typing, you may buy it at a higher price - any higher price.

It is commonly held that using market orders is stupid. Under normal circumstances, I tend to agree. You'd almost literally be willing to put Bill Gates' money on the table for one share. This is patently ridiculous. There are three cases in which it might be useful to put in a market order:

• In an extremely liquid stock. Then, there is so much volume in the book that you will trade at a decent price
• In an auction. On some exchanges, a market order gets priority in an auction over any type of order. Use with extreme caution.
• It might be cheaper. Although, one slip-up is likely to wipe out all your savings and then a lot more. As such, only do this in liquid stocks or auctions.

In order to have a market order, you need to specify a volume only. A price is not relevant. Note that if your order is large, different parts of it might trade at different prices.

### Limit order

The limit order is an order to buy or sell shares at a specified price. When this order is placed in the book, it is first checked whether it matches. This means that if it is a buy order, it will trade against all offers that have a lower price than the limit, and that if it is a sell order, it will trade against all bids with a higher price. The remainder of the order will remain in the book.

Limit orders are probably the order type one wants to use during normal trading. You can specify the price and volume, and hence know exactly how much cash is at worst involved in the transaction. With a limit order, it is possible to for instance put a bid at a higher level than the best bid in the market, but lower than the offer. Then, the next seller might trade with you, allowing you to buy at a better price than if you would have just lifted the offer.

There are, however, various sub-types of the limit order. I'll mention the most common ones below.

##### Day order
This is a limit order of which the portion that has not matched is automatically canceled at the end of the trading day. This is perhaps the most useful type; overnight, many things can happen, so you might want to set it at a different price tomorrow.
##### Good till date (GTD)

A good till date order is an order that is automatically canceled if it is not filled before a certain date. This is useful if you for instance want to put in an order at \$10 for a share that is trading at \$11. If the price now drops to \$10, your order has been in the book for a long time, and as such has time priority. Because you are probably the first person at \$10 (actually, in practice, it would be smarter to pick a less conspicuous level, such as \$10.02), you will be the first to trade at that level. The disadvantage of this order type is that you need to keep good track of your old order.

##### Good till cancel (GTC)
A good till cancel order remains in the book until it is executed. There are some limits - under certain circumstances, the exchange may clear such orders. Otherwise, it will indeed remain there pretty much forever, making it a more extreme form of the good till date. Be sure to periodically check your good till cancels, also because under certain circumstances, they are removed.

##### Immediate or cancel (IOC)
An immediate or cancel order is an order that is sent to the market, executed as far as is possible, and then canceled. It does not remain in the book. As such, sending this order at a price that would not match (lower than the best offer for a buy or higher than the best bid for a sell) is probably silly. This can be useful if you do not want to "push" the market by putting a large order in the book.
##### Fill or kill (FOK)
This order has to be executed entirely, or it is not executed at all. Useful if you want to be sure that you get all the shares you wanted.
##### All or nothing (AON)
A bit like the fill or kill, but this one stays in the book until it is executed.

In summary, a limit order requires a volume and a price, and maybe a time a which it cancels, depending on order type. Unless you want to do something special, a day order is likely the most obvious choice.

#### Stop orders

Stop orders are a kind of "proto-order": they only become orders when a certain condition is met, in general that a stock trades at a certain price. Consider, for instance, the classic stop-loss order. If the stock trades at or below a certain price, the stop price, a market order is sent on your behalf. The net effect is that you do a blind sell when the stock price hits a certain level. And yes, a nice stack of these can trigger a stock market crash.

Another variation on this theme is the stop-limit order. In this case, a limit sell order is generated when the market trades at the stop price. As such, one is not guaranteed execution, but one is guaranteed that if the order executes, it does so at a reasonable price.

There are many more variations on this theme, also including buy orders (buy when the stock trades at a certain level), etc. While these strategies are interesting, they do have the flaw that they might trigger at a moment you actually would not have wanted them to trigger. Furthermore, while they are recommended as a "protection" to limit losses, there is no guarantee this will work if a stock truly plummets instantaneously, as the order triggers after the plummet.

Depending on the order type, a stop-loss order requires a stop price, a volume, and possibly a limit price.

#### Iceberg order

An iceberg order is an order in which only a fraction of the volume is visible - just like an iceberg. It consists of a limit order for a certain volume, that, when filled, produces another limit order for the same volume, until a certain total volume is done. The advantage of this is that you don't "show your hand", the disadvantage is that you have to go back to the end of the queue every time you trade.

Only few exchanges offer this order type, which requires a total volume, a shown volume, and a limit price. Many institutional investors use software to machine-gun orders in the market in a fashion just like an iceberg; as such even though an exchange might not support it officially, you can expect to see this pattern there.

### Summary

I've attempted to give a short and non-exhaustive summary of the most common order types available. Always be sure to check the details of your exchange before deciding what order type to place. Although I'm not planning to give formal advice, you might want to take a look at the normal limit order; buying something for a given price is a pretty natural way of trading.

Disclaimer: This is meant for entertainment purposes, it is not investment advice. Do not consider the words of random anonymous strangers on the Internet investment advice; rather, research it yourself.

### Sources:

• http://en.wikipedia.org/wiki/Order_(exchange)
• http://nl.wikipedia.org/wiki/Limietorder