Breaking it into Units: The Trade

It is convenient to think of trading algorithms in terms of trades.

A trading algorithm makes multiple trades. Each trade begins with the purchase or sale of a security, continues as long as the security is held or more of the security is bought/sold, and ends when one reverses all the initial and subsequent purchases/sales in the trade, thereby ending up in a flat position. It can be thought of as a round trip with a duration; at the beginning one opens a position by buying (going long) or selling (going short) the security, then holds on to it for a while, and finally closes the position by completing the last trade required to get back to the state of holding nothing (a closed or flat position). Before and after the trade there is no risk, as the algorithm neither owns nor owes anything. After the trade, there is no risk since the position is closed.

Formally, the duration of the trade is defined as the amount of time from opening the position to closing the position.  All the excitement takes place throughout the duration of the trade, as the prices of the various securities change.   Most brokers provide a real-time display showing the current value of any open positions, so you can typically see a live update of the amount of money you are making or losing on a particular trade.

 A trading algorithm prescribes in detail, for each trade,

As mentioned before, trading algorithms should be able to use all current and past market information in making these decisions.

 Next: High-Frequency Trading            Back to Index