Peter Forsyth is a computer scientist who has developed an algorithm that shows online brokerages are likely not handling investors’ buy and sell orders in the best way possible.

"My recent research shows that the standard algorithm used by brokerages is not the best method.  It's actually sub-optimal by quite a large margin," says Forsyth, a professor in Waterloo’s Cheriton School of Computer Science.

Peter Forsyth

Forsyth works in the emerging area of computational finance, an applied branch of computer science that deals with matters of finance. Forsyth says, “When I tell people at a party that I work in computational finance, they all want to know some stock tips.  That's not how it works."

Getting to the largest possible gain for a given amount of risk

Stock prices follow a random process, which means that stock prices are inherently unpredictable. "Nobody can tell you what the stock market is going to do tomorrow," says Forsyth.

So, the best that can be done is to make sure that your investments are "efficient", that is, get the largest possible expected gain, for a given amount of risk.

That’s where his recent research on algorithms and what is known as “optimal trade execution” comes in. It’s something that everyone with an online brokerage account likely uses.

The risk of buying quick versus buying slow

"When you place an order to buy, say 1000 shares, you will probably see that the order was filled using a series of buy orders, say 100 shares each,” explains Forsyth. “Each of these smaller orders was filled at slightly different prices."

The idea here is that if you place an order to buy a large block of shares on the market all at once, you will drive the price up temporarily.  In order to minimize the price impact, it is better to break up the order into smaller lots.  However, now you are exposed to the risk that the stock price can randomly move higher.

Forsyth says: "The idea is to determine the optimal trade-off between the cost of buying quickly versus the risk of buying slowly" and his new algorithm is much more efficient than the one typically used by brokerages.

Forsyth points out that five of his former Waterloo PhD students work

on optimal trade execution at Morgan Stanley.  "And they

all drive much more expensive cars than me."