Alpha Novae

A Blog Post

Did Your FX Algorithms Learn the Lessons from the CHF Storm?

Nicolas Vitale

Nicolas Vitale

This is a copy of an article written by Nicolas Vitale, director of Alpha Novae, for Finance Magnates and originally appearing here part I and part II.

The storm created by the removal of the CHF peg floor by the SNB on the 15th of January changed the industry. Did your Fx algorithms learn the lesson?

Everyone agrees, that in the FX industry, there was a before and an after the 15th of January 2015. Following a surprise move from the SNB, the CHF crashed in a few minutes and provoked some irreversible damage among both sell and buy-side actors.

Some of these impacts were obvious and direct, such as the direct financial loss hitting major sell-side and buy side players. Some other came right after such as the Prime Broker credit lines tightening.

The reasons for this disaster are numerous and I will not detail them all. A lot of people already gave their point of view on this, but it’s worth noticing that they seem to have a common root. Contrary to equities, FX was supposed to be relatively safe from crashes, more particularly the flash crash ones. For example, if I quote one of the conclusion of the BIS report on High-frequency trading in the foreign exchange market:

“ […]the different nature, structure and size of the FX market may make a flash crash-type event less likely in FX than in equities.”

Liquidity was never meant to be a problem on major currency pairs. This provoked over-leverage across the board, especially on the supposed “safe” pegs having very low volatility.

Thinking that forex was safer, when it comes to flash crashes, than equities was definitely a mistake. Indeed, during the famous May 6 2010 flash crash, the fall was of “only” 9% on US indices. This is quite pale in comparison with the 40% drop on the EURCHF!

But let’s focus here on the important consequences and take-aways from this event in relation of your FX algorithms.

Beware of “run away” algorithms

To me, if there is only one important thing to remember from this event – it is the potential danger of the basic “run away” algorithms.  What do we call a basic “run away” algorithm? In case of X, Y, Z reasons (here especially volatility, daily variation, lack of liquidity, …), do everything you can to flat your exposition and stop trading. Flat all and unplug! No smart hedging involved here.

Many have built such a logic to protect their account, but during a flash crash, such as the one of the 15th of January, it makes everything worse…

Acting in the middle of a panicking crowd with a basic reflex can maybe save you in a real life situation… But following the crowd rarely works in trading. And it is easy to understand why.

Look at the below diagram showing the available EURCHF price during the event. First stage, prices are crashing and liquidity dries out. Second stage liquidity is totally gone or so, with a spread up to 5000 pips! Someone quote at 0.5, hence a crash of 60%. Liquidity providers review the situation. Third stage liquidity comes back and a more reasonable pricing too. Prices revert and close most of the gap to finally stabilise around 1.05.

EURCHF volatility and liquidity during the crash

EURCHF volatility and liquidity during the crash

EURCHF volatility and liquidity during the crash

EURCHF volatility and liquidity during the crash, Source: FXCM

This 3 stages scenario is reproduced by most flash crashes and it actually became their signature. Prices revert to a reasonable level once operators take time to think about the real life underlying. So do act either very early on stage 1, or on stage 3. But, above all, do not act like too much traders in the end of stage 1, or even worse, during phase 2.

If you do not already look at liquidity in addition the basic prices, you should really start doing it as it will help you to analyse where you are in the 3 stages. And this can now be done even at the retail level… So no excuse here. In this case you however just have to hope that your broker will not force you out at the worst time…

This common flash crash scenario is the reason why the SEC asked the US stock exchanges to implement circuit-breakers. When an exaggerated movement happens, for example a movement of 10% or more in a 5 minutes windows, the market will be frozen the time it takes for traders to analyze the situation and to propose a more reasonable pricing. While such circuit-breakers can be “easy” to implement and very efficient on a centralised markets such as the US equities, it is of course difficult to implement on (spot) Forex which is an OTC market. Your broker will however likely have such a system that should protect you, or them… In theory.

So without mandatory or documented circuit-breakers to protect you at the source, make sure you at least implement one which will require a human trader analysis before taking any serious action such as a catastrophic flat all in the middle of the storm!

Spike Filtering

Many trading systems have incorrectly interpreted the CHF event, especially the important price gaps perceived either during the crash, or later, once trading activity resumed after a more or less long period of closed markets.

For example, when the data feeds were reactivated, the first quotations were significantly different from the last ones known by the systems. The event looked like a perfect price “spike”, i.e. a technical glitch with a non tradable price, which trading systems are taught to ignore.

Indeed, most trading systems incorporate some sort of “anti-spike” filter whose job is to protect the integrity of the data feed which is at the source of the trading decisions. A spike not filtered would quite often trigger orders at a non tradable price.

As you can guess, the trouble added by these anti-spike filters on top of the general panic, did not help.

An anti-spike system is much more difficult to design than how it seems… Let’s say you just filter based on a maximum percentage of variation of the rate, which we will call Y. If Y is too low, you will lose all volatile and fast movements, such as the flash crashes, the news such as NFP, etc. This can be dramatic. And if your Y is too high, you will potentially not filter the spikes… The very goal of such a filter.

You will probably end up moving up and down Y as the market evolves, and you will always experience issues. So the one price variation solution is not good enough.

To improve it, you may want to look at different and non-correlated data feeds. The good news is that with forex we have plenty of such feeds – interbank ones, different ECNs, futures quoted on exchanges, etc.

In addition to the price feed, it could also be useful to add liquidity to the logic of your filter. Indeed, price gaps with high volatility associated to market liquidity drying up, will unlikely be a technical glitch to be filtered out.

But firstly, check if you (and your data provider) are using an anti-spike filter. And if you are using one, review how it works!

But in any case, make sure that you at least have a documented and understandable way of manually disabling it, in order to quickly manually restart the algorithms if need be.

Exception Handling

To generalize a bit from the spike filtering issue, the whole exception handling logic (spike, rejects, markets interruption, spread explosion, etc) from algos has been put heavily under pressure. Developers and traders will have to review this together. We have witnessed that traders often push this on to the developers as it is generally perceived as technical issues handling.
But on this particular day, we had proof that the market could really behave like a bugged one…

Liquidity Fragmentation

This is not about the handling of the event itself, but about one of its consequences. The liquidity environment and credit access have really changed since the SNB event. Some established prime brokers or liquidity providers have stopped or reduced their business while the risk appetite has dramatically been reduced.

It entailed an explosion of smaller market players acting as PoP or liquidity providers. So in case you are in the liquidity aggregation business, the cost of connectivity investment is increasing in order to connect to more players and to manage the growing complexity of the market. Time to review the “build vs buy” decision you have made about connectivity management.

Be Passive!

With appetite for risk being restrained across the liquidity providers, the liquidity has diminished and logically the spreads have increased on many pairs. This makes it more expensive to trade “aggressively”, i.e. by crossing the spread with market orders.

The consequence is that it has become increasingly interesting to trade “passively” in order to save (or earn depending on how you see things) on the spread cost factor, by getting executed, at least for a portion of the order, inside the bid/ask spread.

Whether you develop yourselves, your execution algorithms or use third-party or banks ones (see my previous article on this topic, “Why Buy-Side Should Take Control of FX Algorithms”), think about your execution tactics, and ask yourself if adding some passivity in your algorithms could help.

Stay Away from Pegs or Heavily Controlled Currencies

Finally, this is not really about algorithmic trading, but it is particularly important for algo traders as many have been naturally inclined to make this mistake.

Only if you really (I mean really) know what you are doing here, and the risks associated with it, stay away from pegged or heavily controlled currencies. “Easy” money always comes with greater and unpredictable risk. It’s probably not worth it. And if the CHF crisis was not enough to make you change your mind, think again about what we witnessed lately on the Chinese yuan pairs!

Share on LinkedInTweet about this on TwitterShare on Facebook