Basics of orders
Basics of orders
When we go to financial markets, we don't interact directly with other participants as
we would do in real life at the local food marketplace. Instead we only talk to the "Exchange". "Exchange" is a robot that will take our orders then execute them
at the most advantageous price for us.
We go to a concert ticket marketplace. This marketplace has an Exchange.
If we tell the Exchange: "Hey Exchange, buy me one ticket immediately", Exchange will buy a ticket for us at the cheapest price available.
Great! But this has some consequences we need to investigate because sometimes Exchange does not behave the way we think it should.
Let's dig in...
Understanding Exchange behavior: What we think is not what we get
Let's assume we want to speculate on the price of concert tickets.
We will buy 1 ticket and try to make a profit out of it.
We'll use 3 orders:
- A buy order : To buy our ticket
- A Take-Profit order (TP) : To sell our ticket at a profit
- A Stop-Loss order (SL) : To sell our ticket at a loss
Exchange gives us the current order book.
We tell Exchange "Hey Exchange, I'll buy a ticket when price is at 13".
Exchange answers: Awesome I bought your ticket! I got a nice price for you of 12, thanks to me you saved 1!
WHAT?! What just happened?
Exchange bought immediately, that's not what we asked for.
Here's the problem, Exchange is a robot and by design it only understands requests in this form:
- "Buy at X"
- "Sell at Y"
then it tries to give us the best deal possible.
When Exchange receives our order: "I'll buy a ticket when price is at 13",
Exchange understands: "Buy at 13".
It then checks the order book for the chepeast price possible,in our case 12. 12 is cheaper than 13 so Exchange buys the ticket. It actually gives us a better deal, but it's not what we asked for.
Let's continue.
Now that we have our ticket, we tell Exchange
- "Hey Exchange, I want to sell my ticket for a profit when price reaches 15"
- Exchange: "Sell ticket at 15. Checking order book... There's no-one willing to buy your ticket at 15 or more, I'll put your order in the order book.
Yes! We got what we wanted.
Now that we understand how Exchange behaves, guess what will happen when we send this order:
- "Hey Exchange, we want to sell our ticket at a loss if price goes down to 8"
- Exchange: "Sell ticket for 8. There is someone willing to give you 10. 10 is better than 8. I sold your ticket immediately for 10, here's your money.
Is it possible to avoid this? Unfortunately no. We'll study deeper the Stop-Loss case but before that we need to understand the difference between a book order and a market order.
Book orders vs market orders
It may seem that plenty of order types exist but from an Exchange point of view there's only two types of orders:
- market orders
- book orders
Market orders are orders that the Exchange executes immediately.
Book orders are orders that the Exchange puts in the order book.
That's all.
If we look at the example above our orders are like this:
Our Order | what happened | Exchange order type |
---|---|---|
Buy Ticket | Bought immediately | market order |
Take-Profit(TP) | in the book | book order |
Stop-Loss (SL) | sold immediately | market order |
Book orders are guaranteed to be executed at the specific price we asked for.
Market orders are executed immediately at the best price available on the market.
The fees for book orders are generally cheaper than for market orders but we'll have to wait for someone to take the other side of our order (which may never happen).
order type | fees | price guaranteed? | speed of execution |
---|---|---|---|
Book order | low | yes | when we are matched with somebody (may never happen or only partially) |
Market order | high | no | instant |
Understanding how Exchange works allows us to know in advance if our order will be executed as a market order or a book order with the benefits and drawbacks of each of this type of orders.
The Stop-Loss weakness : It's always a market order
It's never a good surprise to lose more money than we intend to.
As such, we would like our Stop-Loss to be a book order, to get price guarantee and control when and how much we will lose.
Unfortunately that's not possible by design. Let's prove it.
If we go back to our example, we would like to send a book order to sell our ticket at 8.
As soon as Exchange receives our order it will, by design, match us with the best possible deal, which is the person that is willing to pay 10.
Conclusion: A Stop-Loss cannot be a book order, it will always be a market order.
Ok, but in real life if we want to close our position at a loss, starting from a specific price, how do we do?
In practice we have 2 options :
Option 1: we wait for the bid price to go down to 8 then we send a market order to Exchange.
That works but we are stuck in front of our computer and must not miss the right moment. It's not very convenient.
Option 2: We tell our trading software (not the exchange), that when price reaches 8, it must send a market order to Exchange to sell. Our trading software knows the limitations of Exchange and is able to wait for the right moment to send the order.
We have to be careful with Option 2 though. Some trading software can only send the Stop-Loss order to Exchange if the software is opened on our computer. If we close the trading software window, the Stop-Loss will never be sent to Exchange (Ouch!). This is a software by software scenario so it has to be checked for each trading software.
When planning our trades, we must always consider that our planned loss is actually a "minimum loss", our real loss is likely to be higher than that, sometimes much higher.
Why? because since our order is a market order, we don't control the price at which our order will be executed.
Imagine this scenario : Price goes down to 8. we send our order to sell immediately. Unfortunately someone else also sends the same order but is faster than us.
See what happens:
we sold at 7 instead of 8, we lost 1 more than planned. And this is a lucky scenario, sometimes it can be much worse than that...
Conclusion
It's crucial to understand how Exchange works to know in advance if we're going to create a market order or a book order:
Here's what to remember:
An exchange only understands requests in the form:
- "Buy/Sell at X"
- "Buy/Sell at market price"
Then it gives us the best deal possible as a market order.
If not possible, it will create a book order.
As a consequence:
- it's impossible to have a buy book order above the ask
- it's impossible to have a sell book order below the bid
- A Take-Profit is always a book order
- A Stop-Loss is always a market order: loss is always at or greater than what we planned (!DANGER)
When possible prefer book orders to have price guarantee and lower fees.