Showing posts with label algorithmic trading. Show all posts
Showing posts with label algorithmic trading. Show all posts

Tuesday, November 6, 2012

A cautionary tale for quants and HFT designers

This blog has always been an advocate of using human intelligence as oversight over quantitative investment systems. In particular, I have been concerned about the takeover of trading the HFT robots.

On this day that America decides who gets to have his finger on the nuclear button for next four years, consider this story (from Business Insider) about how close we came to disaster in 1995:
In the 67 years since the detonation of the world's first nuclear weapon there is only one time the so-called nuclear briefcases were broken out and opened up. On January 25, 1995 they not only opened, they nearly launched Russia's nuclear arsenal at the United States.
As the story goes, the Soviets mis-interpreted the launch of a Norwegian test rocket as an ICBM attack:
When Norwegian Kolbjørn Adolfsen gave the nod to send a Black Brant rocket from the Andøya Rocket Range off the northwest coast of Norway to study the aurora borealis, he wasn't concerned at all.

Sure the Brant is a large, four-stage rocket that would fly to 930 miles above the earth near Russia, but he'd contacted the proper Kremlin authorities and hadn't given the flight a second thought.

What Adolfsen didn't know when he left the rocket base shortly after the missile was launched, is that the Brant's radar signature looks just like a U.S. sub-launched Trident missile.
Uh-oh...
The radar operators at Russia's Olenegorsk early warning station promptly reported the incoming missile to their superiors, but not a soul on duty within the military had been notified of Adolfsen's plans.

The officers at Olenegork believed it could be the first leg of a U.S. nuclear attack.

Four years after the Berlin Wall came down and Russia was in the throes of change, stable systems had been demolished and replacements had yet to fall into place. One thing that had gotten only more developed since 1991, however, was the Kremlin's mistrust of the United States.

So as the Brant streaked its way near Russian airspace, military officers had to decide if this was an electro-magnetic pulse attack that would disable their radar and allow for a full on American attack, and what they should do about it.

The matter was decided when the Brant separated, dropped one of its engines, and fired up another. The radar signature now looked so much like a multiple re-entry vehicle (MRV), a missile carrying multiple nuclear warheads, that military officers no longer had any doubt.
Time was getting short to respond:

There were now five minutes during which the missile's trajectory would be un-tracked by Russian radar, and when it could strike Moscow; a slice of time that was devoted to deciding whether to launch a counterattack.
Fortunately, the Soviets didn't have a hair trigger launch on warning policy, but actually had adults in charge:
Boris Yeltsin was alerted, and immediately given the Cheget, the "nuclear briefcase" that connects senior officials while they decide whether or not to launch Russia's nuclear weapons. Nuclear submarine commanders were ordered to full battle alert and told to stand by.

Apparently Yeltsin doubted the U.S. would launch a surreptitious attack and within five minutes, Russian radar came back confirming the missile was heading harmlessly out to sea.
Now consider what might have happened if algorithms were in charge? The missile signature looked like it was carrying a multiple warhead. What if the algos had decided that it was a hostile launch. What would it have done?

This a cautionary tale for HFT algo designers, who claim that their systems have numerous safeguards. Safeguards can and do fail. We found how an unexpected perturbation during the flash crash created enormous systemic problems. Fortunately, the only thing that people lost during the flash crash was money.

If algos had been in charge of the Soviet defense system in 1995, we all could have lost our lives.



Cam Hui is a portfolio manager at Qwest Investment Fund Management Ltd. ("Qwest"). This article is prepared by Mr. Hui as an outside business activity. As such, Qwest does not review or approve materials presented herein. The opinions and any recommendations expressed in this blog are those of the author and do not reflect the opinions or recommendations of Qwest.

None of the information or opinions expressed in this blog constitutes a solicitation for the purchase or sale of any security or other instrument. Nothing in this article constitutes investment advice and any recommendations that may be contained herein have not been based upon a consideration of the investment objectives, financial situation or particular needs of any specific recipient. Any purchase or sale activity in any securities or other instrument should be based upon your own analysis and conclusions. Past performance is not indicative of future results. Either Qwest or Mr. Hui may hold or control long or short positions in the securities or instruments mentioned.

Wednesday, February 2, 2011

HFT and system stability

I spend a lot of time thinking about risks to my models and forecasts. In my readings, one of the risks that doesn't seem to get mentioned very much is the instability from high frequency trading (HFT) algorithms. For the newbies, see this video for a primer on HFT.


The evolution of HFT
Long ago, before trading algos dominated stock exchange volume, trading was a relatively simple matter. Buyers and sellers met on the stock exchange floor in a price discovery process. Eventually trades got done and prices reflected the supply and demand dynamics of real buyers and sellers. Brokers acted as agents and got paid a commission for acting as an agent.

Then broker-dealers came along. Jeremy Grantham complained that:

The problem of asymmetrical information is compounded by the confusion between the roles of agent and counterparty. I grew up in a world where stocks and other financial instruments were traded by the client with a high degree of trust in the agent. Millions of dollars traded on a word, without a tape recording. Somewhere along the way, without any formal announcement of the change, the “client” in a trade mutated into a “counterparty” who could be exploited. Steadily along the way, the agents’ behavior became more concerned with the return on their own trading capital than with the well-being of their clients. One of my nastiest shocks in 45 years was the realization one day in 1985 that we had been ripped off by our then favorite broker on one of the early program trades we were doing. We had supposed we had developed a trusting relationship. We had certainly done many incentive trades that were successful from our point of view. Perhaps, with hindsight, our strong incentives might have merely motivated them to rip off some other client.
Brokers stopped viewing clients as clients and began to view them as trading adversaries. Somewhere along the way, the quants took over and market making became more automated. Today we have a proliferation of HFT algorithms on the virtual floor of the exchange.

But what happens when a good idea becomes widely adopted and becomes the market? That's what seems to be happening with HFT algos trading the market. Paul Wilmott wrote that his inbox is now stuffed with announcements about HFT and HFT conference - which is an ominous sign.

With HFT, it's an arms race. You need to be faster and have more information than the next guy. As part of that evolution, we have algos that adjust order flow for latency and we even have a hedge fund that scrapes data from Twitter to trade the market as part of that evolution.


Algos gone wild?
Here is my nagging worry: What happens if too many HFT algos start to dive on the same information source? Would that create an informational and price cascade? We know how quickly computers can generate orders, were similarly (momentum) oriented algos tried to trade on the same data and started to stampede, how long would it move the market before intelligent adults stepped in to shut the whole thing down?

Felix Salman pointed to a comment from Michael Kearns of the University of Pennsylvania, who believes that these systems are unpredictable and possibly unstable under certain circumstances [emphasis added]:

There’s a growing understanding and belief on Wall St, especially intraday, that there’s a strong game-theoretic aspect to the market: the performance of a given strategy depends on what other strategies are trading in the market at the same time. My payoff is a function of what I do and what the other players in the game do.

The concepts of strategic interaction are important. Game theory is hard to understand even in simple cases. And now strategies are adaptive, so it’s especially difficult. I’m not frightened by it, but it’s a legitimate concern. People who build good machine learning algos have a fair amount of knowledge about what they’re doing, but they’re still adaptive. It’s natural to have the model retrain itself each night based on each day’s data. Humans might not know what incremental modifications today’s data introduced in this adaptive process. If everybody’s doing this, you can easily imagine various effects. That could be a bad thing from a stability standpoint in the markets.

Our financial markets have become a largely automated adaptive dynamical system, with feedback. Furthermore, a dynamical adaptive system with feedback is challenging ordinarily, but this one is also strategic. A flight controller is dynamical, but not strategic. Add an adversarial environment, and there’s no science I’m aware of that’s up to the task of understanding the potential implications of that system.
In addition, we know that hackers can introduce latency into HFT systems, which cause instability. What happens in a fast moving market? Is the instability "stable" or would it create wild price oscillations?

Before anyone flames me to tell me how implausible such a scenario is, recall how dynamic delta-hedging/portfolio insurance strategies contributed to the downside volatility in the Crash of 1987.

Tuesday, August 12, 2008

Algo trading – too much of a good thing?

Back in the Olden Times when I started watching the markets, 30-40 million shares on the NYSE were considered to be big volume days. Institutional execution was done in the upstairs market by brokerage block traders calling around their accounts: “we have 100,000 XYZ for sale, do you have any interest?”

That has all changed.

Today, there are automated trading bots, or algos (short for algorithm), everywhere. It began with algos trading VWAP (volume weighted average price) orders. With the advent of day trading automation inevitably followed and today you can find specialized trading bots on the internet and even floor brokers are now using algos (see report). There are even some blogs, such as Skill Analytics and Zen Trader to name a few, devoted to this topic.


Flying on autopilot is not always a good thing
With so much automation around, some “reality check” questions come to mind:

  • Is anyone doing a reality check on these algorithms?
  • Can someone game these algos?
For example, there are brokers offering VWAP algos and guaranteed VWAP trading for individual investors for very low cost. Given the widespread adoption of these algos, don’t you think that someone could write a pattern recognition program to watch for a VWAP algo buying or selling a stock? This information is worth something to someone. As a trader once told me, portfolio insurance program trading (that exacerbated the Crash of 1987) was a huge boon to him because you knew that once the portfolio insurer had started the trading program he had more orders behind it.

If you must use algos and go on autopilot, do it intelligently. As I wrote in a previous post:

Mrs. Humble Student of the Markets, who is a pilot, calls it “raising your head up from the instrument panel and looking out the cockpit window once in a while”.