Let’s start with drafting a prototype of a general order ticket – something that is sent to a trading venue.
Normally, orders are sent either as FIX messages (see Lesson 4, Trading Application – What’s Inside?) or in JSON format according to the venue’s specifications. As we also noted in Lesson 4, every venue has its own data and ordering interfaces, but the core properties of an order always remain the same.
Actually, the list of these properties is quite logical. Let’s prepare an empty form and fill in its fields one by one.
First, each order should go out with an ID. Otherwise, how do we or the trading venue refer to it? If we trade live, then the trading venue will generate an order ID that we receive, but if we run a backtest and want to modify orders that had been sent earlier, we need an internally generated order ID. Anyway, number one in our order form is Order ID:

Figure 10.1 – The first attribute of an order is Order ID
Next, we need to let the venue know which market we want to trade in. As always, please keep in mind that every trading venue has its own specification. For example, EURUSD can be sent as EURUSD, EUR/USD, eur-usd, and so on. So, check the venue’s documentation before actually sending orders. Let’s add the second record to the order ticket – Instrument ID:

Figure 10.2 – Instrument ID added
We also need to specify the amount we want to trade or the trading size. The trading size can be specified in lots (again, refer to the venue’s documentation regarding how much one lot is) or just in money.
For example, with LMAX, an order to buy 1 lot of EUR USD would mean buying 1,000 euros and selling the respective amount of the US dollars, and with Interactive Brokers, an order to sell 100,000 USD JPY would mean actually selling 100,000 USD and buying the respective amount of the Japanese yen. Be careful when specifying the order size! Now, our order ticket consists of three records:

Figure 10.3 – Trading size specified in the order
And of course, we should specify the side of the trade: whether we want to buy or sell. Some venues just use BUY and SELL specifiers, while others suggest using BID and ASK to denote the side, so as you can see, the advice to consult the venue’s documentation is the only stable thing in algo trading. All in all, now we have four records in the order ticket:

Figure 10.4 – Specifying the side of the trade
Are we ready to go? Seems so, but not really. The trading venue expects a few other parameters of our trade to be specified: we should say how we want the order to be executed, at which price, and when. The first of these three extra parameters is called the order type, and we normally distinguish between market orders, limit orders, and stop orders. There are also so-called compound or conditional orders, which essentially are combinations of these basic three order types, but they are not supported by all venues. So we will consider in detail only the three main types of orders.
Leave a Reply