Financial market data sets present complex challenges for AI and Deep Learning, so how could they possibly work in cryptocurrency markets?
Inthe spring of 2010, James Tyler, a doctor of mathematics from the University of Cambridge, was studying the behavior of some of his automated trading algorithms from a nondescript office on Wall Street, with increasing alarm.
Tyler had been running simulations of market events to judge the response time of his algorithmic trading programs and was starting to grow concerned that under certain market conditions, the algorithms could flag false signals leading to a feedback loop that would have unintended and catastrophic effects for the fund he worked at.
The high frequency trading (HFT) fund that Tyler worked at was one of a plethora of HFT funds clustered around the New York Stock Exchange (NYSE) in Wall Street, to gain nanosecond advantages by reducing the time required for trading orders to travel through high speed fiber-optic cables to the NYSE.
Tyler was his HFT fund’s chief risk officer and it was his job to monitor the algorithms which fed off market data in order to execute high speed trades, scalping basis points on every trade to deliver profits to the fund’s investors.
But in the spring of 2010, Tyler had discovered a co-dependency between what ostensibly looked like uncorrelated algorithms, one that had the potential to create a self-perpetuating feedback loop of market signals that would flood the markets with a rush of sell orders, despite there being otherwise no fundamental reasons to sell a particular security.
And because many of the algorithms which Tyler worked with relied on what traders refer to as “technical” indicators — objective market data such as price, volume and trade size — under certain market “triggers” many of the fund’s automated trading programs would simply execute sell orders in quick succession, which is what they were designed to do, to protect the fund’s portfolio.
In other words, if an algorithm “discovered” that a sell order was being made, it would then automatically place a “sell” order as well, but this consequent “sell” order would also trigger another algorithm to place another “sell” order and so on and so forth, until the programs imploded the market.
And despite HFT strategies assuring regulators that the odds of such an event ever occurring were close to zero, that is precisely what happened in the spring of 2010 — the Flash Crash.
On May 6, 2010, on a particularly pleasant and sunny New York afternoon, the S&P500, Dow Jones Industrial Average (DJIA)and the Nasdaq Composite collapsed and rebounded over 36 heart attack-inducing minutes beginning from 2.32 pm.
The DJIA had its second biggest intraday point drop (from opening) in its history, plunging almost 1,000 points (about 9%) within minutes before rebounding very rapidly to make up most of the losses.
While the actual cause of the Flash Crash is still debated and debatable to this very day, the U.S. Department of Justice (DOJ) pinned most of the blame on Navinder Singh Sarao, a 36-year-old small-time trader who worked from his parents’ modest stucco house in suburban west London.
According to the Commodity Futures Trading Commission (CFTC) investigation, Sarao “was at least significantly responsible for the order imbalances” in the derivatives market which affected stock markets and exacerbated the Flash Crash.
Sarao began his alleged market manipulation as far back as 2009 with commercially available trading software, modifying the code “so he could rapidly place and cancel orders automatically.”
According to the DOJ indictment, Sarao had placed orders amounting to some “US$200 million worth of bets that the market would fall,” replacing or modifying them some 19,000 times before they were ultimately cancelled.
Some of the practices which Sarao employed at the time were perfectly legal, including spoofing (entering and quickly canceling large buy or sell orders on an exchange to create false impressions of market conditions), layering (similar to spoofing, layering is a HFT strategy where a trader makes and then cancels orders that they never intended to have executed in the hopes of influencing price) and front running (dealing on advance, non-public information knowing that the information will affect the price of a security) — strategies which have since been banned.
But Sarao’s orders were by no means large.
In a market which trades trillions of dollars a day, US$200 million is barely enough to move the needle.
Some analysts suggest that the real reason for the Flash Crash was erroneous signals, picked up by algorithmic trading programs, which automatically scanned the market and then acted autonomously on such signals.
Which is why there was a flurry of sell orders, causing the market to crash, followed by signals that the market had been oversold, causing a flurry of buy orders to bring the market back to its original equilibrium.
And the lessons from the financial markets in 2010 (as well as a subsequent flash crash in 2015), may also provide some lessons for what happened with Bitcoin prices last week.
Beginning the year, Bitcoin had been trading within a relatively tight band (tight by Bitcoin standards), bouncing between US$3,000 and US$4,000.
When Bitcoin did break out above US$4,000 towards the end of February, that rally was short lived as automated trading in the cryptocurrency markets quickly brought Bitcoin back down below US$4,000 about 24 hours later.
During the entire period, the volume of Bitcoin traded was relatively consistent — consisting primarily of market-making bots and other algorithmic trading programs that kept Bitcoin volumes more or less within a zone of equilibrium.
Things changed dramatically however towards the end of April.
Bitcoin trading volumes more than doubled across all cryptocurrency exchanges — this increased flurry of activity changed the trading band for Bitcoin, between US$4,000 and US$5,500 — a level that stayed consistent until late April.
It was roughly around this time, when court documents dated April 24, 2019, revealed that the New York Attorney General was building a case against Bitfinex, for misusing funds belonging to Tether to cover over losses of some US$850 million at the cryptocurrency exchange.
The news of potential malfeasance at Bitfinex, far from putting a damper on Bitcoin prices actually put a shot in the arm of the world’s biggest cryptocurrency by market cap, pushing Bitcoin well beyond US$6,000 in the following weeks.
On the back of a significant increase in volume, automated trading programs went into action, feeding off market signals and pushing Bitcoin even higher.
The signals of increased trading volume from both automated trading programs as well as human traders led to more automated trading programs being activated and by mid-May, trading in Bitcoin was 8 times the amount it had been in January.
Because of the feedback loop created, automated trading programs, buoyed by human traders then proceeded to push Bitcoin even further, all the way up beyond US$7,000, a level not seen since the middle of 2018.
As Bitcoin started to test the US$8,000 level, that was sufficient signal for automated trading programs to start exiting their Bitcoin positions and almost overnight, Bitcoin plummeted back to the US$7,000 level on the back of heavy volume.
As volume started to stabilize, Bitcoin once again settled into a trading band, between US$8,000 towards the end of May.
But in the last few days of May, Bitcoin, having tested the US$8,000 barrier on several occasions in the previous weeks, powered through to push well beyond US$8,000, leading some to claim that the “crypto winter” was finally over.
But celebrating the spring thaw for Bitcoin may have been premature, as automated trading would once again keep Bitcoin within a band of between US$8,000 and US$9,000, never actually touching the US$9,000 level and never ever breaching it.
These signals were sufficient to rattle automated trading programs which then proceeded to sell-down Bitcoin collapsing it through the US$8,000 level towards the first week of June, a level where it continues to hover within a band of between US$7,500 and US$8,000.
Unlike financial markets, cryptocurrency markets run 24/7 and because there are few human traders capable of that level of performance and concentration, a large part of cryptocurrency trading is performed by automated trading programs.
Unlike financial markets though, HFT is not possible on any of the major cryptocurrency exchanges — with rates deliberately limited so as not to crash the exchange itself.
However, on decentralized exchanges (as well as some centralized exchanges), many of the behaviors prohibited in the financial markets are not only evident, but prevalent.
Behaviors like front running, spoofing and layering are all commonplace on cryptocurrency exchanges.
Such manipulation in cryptocurrency markets where the bulk of the trading is already so highly automated means that the quality of the data which automated trading programs consume and act in response to is extremely prone to feedback loops.
But unlike in the financial markets, these feedback loops take longer to manifest because of the lack of HFT.
So while cryptocurrency markets may not exhibit the flash crash susceptibility that regulated financial markets are at risk of experiencing, cryptocurrency markets are still susceptible to the erroneous, self-perpetuating feedback loops that define automated market behavior.
Trading bots detect increased volume which activate new trading programs which detect increased volume and so on and so forth.
Because we’ve become so used to artificial intelligence or AI auto-populating search fields for us, recommending us books to buy or clothes to wear, reading our faces and (eventually) driving our cars, we’ve come to expect a lot from the technology.
But if there’s one arena which AI has yet to conquer, it’s the financial markets.
Thus far, a computerized stock picker or investment robot has yet to consistently outsmart the financial markets, but it’s not for lack of trying.
In the mid-80s, a concerted push was made by some of the brightest technical minds, to scientifically model markets, as opposed to say, find a cure for cancer.
Many of these efforts to create the ultimate trading robot absorbed some of the top graduates in fields such as math, computer science and even rocket propulsion.
Secretive hedge funds like Renaissance Technologies, D.E. Shaw and PDT Partners plied the trade, carving out extraordinary returns in the latter half of the 20th century.
And part of the reason that many of these “robo” hedge funds with their “black boxes” were able to deliver extraordinary returns was the state of computing technology at the time.
During a period when computers were relatively slow (by today’s standards) and information did not travel as quickly or as freely, the early algorithmic trading outfits were better able to find, preserve and exploit profitable trading strategies for longer periods than today.
But as computers evolved and with the advent of the internet, once profitable strategies which regularly delivered in excess of 30% annualized returns were no longer able to perform to their previous levels.
Top flight quant funds such as James Simon’s Renaissance Technologies tweaked their algorithms and to be sure, Simon’s trading strategies were never purely algorithmically driven anyway, with a fair measure of human oversight and discretion initiating and leading trades.
And as it turns out, investing is not like trying to predict your next Amazon purchase.
Ciamac Moallemi, a professor at Columbia Business School and a principal at Bourbaki LLC sums it up best,
“It’s one of the most difficult problems in applied machine learning.”
For the same reasons that self-driving cars have a tendency to end up in car crashes, AI-driven investing also has a tendency to result in flash crashes.
There are simply too many variables and unknown unknowns as well as unknowable unknowns in the financial markets, for AI in its current state of development to deal with.
In quantspeak, data of the sort that AI has to deal with in the financial markets is “non-stationary.”
An example of stationary data might be the distance of say, your driveway from your door. Short of an earthquake or remodel, that distance is likely to remain constant and if a machine is fed hundreds of pictures of your driveway and your door, it will in all probability be able to identify your home.
But financial markets are charged with data that can change dramatically in unprecedented and unforeseeable ways — for instance when Russia defaulted on its sovereign debt in the 90s.
Not so with cryptocurrencies.
As an unconstrained asset, with limited correlation to other assets, the data sets that need to be considered when it comes to trading cryptocurrencies are far fewer — many of which are speculative and many of which are co-dependent, resulting in far more predictable patterns then say in the financial markets.
Stocks on the other hand move all the time and not always for any discernible reason, with most market moves what economists term “noise” trading.
Returning to the analogy of your door and your driveway, imagine if a computer was instead trying to identify your home based on pictures of your home taken both day and night and in varying lighting conditions.
Most of the data in those pictures would be “noise” and worse, the light in some of those pictures at least could lead to “false positives,” which could induce the computer to mistake someone else’s home for yours.
And as data sets go, historical stock price data is not particularly voluminous, meaning that what may appear to be a significant data point may actually be insignificant if a larger amount of data were available — sort of the way jagged peaks and troughs on a chart tend to smooth out with more data over a longer period of time.
To illustrate this difficulty, say you’re trying to predict how stocks will perform over a one-year horizon. Because there’s only reliable stock information from 1900 onward, there are only 118 non-overlapping one-year periods usable for examination purposes.
In contrast, Facebook, which has a virtually endless supply of data with which to work with, processes no fewer than 350 million pictures a day.
And unlike examining financial data (which can be manipulated or misrepresented), examining photos is a lot easier for computers because simple tricks such as rotating the images or adjusting contrast can increase the amount of data available with which to make assessments — financial data unfortunately, can’t be digitally enhanced by AI.
Obvious signals, say buying stocks on the first day of every month, are of limited value and even if they worked in the past are probably more a product of coincidence, than reflective of any predictive skill.
And even if it wasn’t just luck that discovered these “obvious signals,” thanks to the relative transparency with which financial markets trade with, such advantages will be quickly discovered and any profits, traded away.
So instead of trying to find “obvious signals,” many analysts have turned to divining the subtle — ones that predict the future price with only 51% certainty.
While that may not sound like a lot of confidence, consider that in casinos, a 51% advantage is the average house advantage for most table (card) games such as Blackjack and Baccarat and more than sufficient to ensure that over the long run, the house always wins.
The same goes for hedge funds deploying such strategies.
By taking a large number of very small bets with a small advantage such as 51% and juicing those bets with leverage, mangers can make outsize returns in relation to the actual size of the funds invested.
In cryptocurrency markets, a 51% advantage is not only possible, it’s relatively pedestrian.
Because there are far fewer signals to monitor and because the “noise” is far easier to identify and isolate, trading advantages can be far larger than 51%.
And unlike financial markets where there are minimum order sizes and minimum brokerage fees regardless of the size of the trade, cryptocurrency markets generally work on a percentage of every trade, regardless of the size of the trade.
What this means is that even cryptocurrency traders who trade relatively small amounts can still yield alpha as if he or she were a large-sized hedge fund, availing themselves of trade fees of a few basis points regardless of the trade size.
Not so in the financial markets, which is why many mangers look to improve returns by reducing transaction costs. Because, as mentioned, in financial markets each transaction regardless of size attracts a minimum cost.
The other way that managers can cut costs is to reduce slippage, which is the actual cost paid for buying a specific security, as opposed to the target price.
Say for instance the price of a share of General Motors is US$100, but only 100 shares are available at that price and if you wanted to buy 1,000 shares of GM, you’d need to bid up the price, which may result in the average cost of your shares being US$105 or even more — a 5% premium on your target price.
The thing about slippage is that it’s difficult to predict the actual price or cost of a security without transacting in the market.
For instance, even if the sell queue seems to be laden with sellers, a sudden move, for instance buying a large amount of a till then illiquid stock, might make sellers think that they can fetch a better price for their stock or automated trading programs might immediately withdraw their sell orders, forcing the price to surge upwards, despite there being no significant reason for prices to rise other than the withdrawal of liquidity.
The same market behavior is observable in cryptocurrency markets.
Take Bitcoin for instance.
Depending on which cryptocurrency exchange you intend to buy your Bitcoin from and how much Bitcoin you buy, you could be the market for Bitcoin, with your moves affecting the overall price of Bitcoin.
Which is why when investor are seeking to acquire large amounts of Bitcoin, they tend to spread their purchases across a variety of cryptocurrency exchanges, with many also using over-the-counter or OTC transactions that are off-market and do not affect the price of Bitcoin in the open market.
And while many use CoinMarketCap (a website) to determine the price of Bitcoin, it is far from authoritative, using a closely guarded algorithm to determine the blended price of Bitcoin from various undisclosed sources — hardly the stuff of transparency.
But fortunately, computers can be taught to anticipate transaction costs and this helps traders in two ways.
First, if an algorithm can effectively predict the likely slippage based on the order size and historical liquidity, the edge required for a trading signal could come down from say 51% to 50.5%, meaning more trades can be made, yielding more opportunities for profit.
And more trades also means, according to the law of large numbers, better chances at achieving target odds.
The second way reducing slippage helps is that more profit can be squeezed from existing opportunities.
Say for instance a widely known model identifies Bitcoin as 1% undervalued.
Without understanding transaction costs, a trader might purchase only 100 Bitcoins, lest it risk too much slippage and push the price of Bitcoin above the 1% spread that it’s looking to capture.
But another trader armed with an algorithm that can predict the transaction cost with perhaps an 80% probability might know that 500 Bitcoins could be purchased without pushing the price of Bitcoin beyond 1%.
The trader who is able to effectively predict and price transaction cost could boost their returns by 500% — a huge advantage in any market and significantly affecting long-run returns.
In order to squeeze transaction costs further, some quant managers build their own high-frequency trading operations, in which they can act as market makers, making profits by matching buyers and sellers.
In the cryptocurrency markets, market makers (of which my firm is but one of many) also employ market making algorithms that provide constant liquidity for cryptocurrency exchanges and match buyers and sellers.
Running these market making operations does not just contribute to bottom lines, it also provides deep insight into market behavior.
It’s a bit like having your own people on the floor of the New York Stock Exchange as opposed to using a brokerage.
The level of intimacy of interaction and immediacy of information is unparalleled.
Some quant managers who struggle with market data are finding other kinds of information to mine instead of just what the market tells them.
Whether it’s commodities traders using satellite photos of feed lots or social media feeds, alternative data may provide some help especially where the classical data is either cumbersome or unreliable.
To that end, many cryptocurrency traders monitor Twitter, Medium, Telegram and Reddit to mine information about potential cryptocurrency movements to gain an edge in their trading.
But as such data becomes easier and easier to find, the advantage that such data provides typically suffers from a lack of longevity.
Rob Arnott of Research Affiliates and Campbell Harvey, a professor at the Fuqua School of Business, North Carolina — two of the best known experts in quant investing — have warned investor against using machine learning to derive investment strategies from data sets that lack sufficient depth.
Arnott and Harvey have even proposed a checklist for applying deep learning techniques, with a specific focus on the depth of specific data sets, because the alternative Arnott suggests, is akin to driving a Ferrari on a dirt track.
But even if specific catering for thin data sets is made, there are still considerable risks when applying alternative data sources towards deep learning.
Because even a minor bias in a data set has the potential to be picked up by a trading model, leading to extraordinary returns, future decisions made by such trading models may be based on a series of false positives or confirmation bias — the algorithms see more of what your they’ve been trained to notice.
For example, if in your mind you’ve decided to buy a red Ferrari, you may suddenly find yourself seeing the car you want to buy everywhere you go, when in fact, the statistical likelihood is that the instances of the car appearing is exactly the same as it was before, you simply have started taking notice of it.
So the combination of new data and powerful data mining tools is a potentially dangerous mix — because deep learning tools can very easily and inadvertently be designed with existing biases — leading to conclusions or predictions based on patchy or misconstrued data.
Because of the complexity of data and the amount of “noise” in both cryptocurrency and financial markets, there is tremendous merit in keeping models as simple as possible.
According to Nick Patterson, a former researcher who spent a decade at Renaissance Technologies,
“One tool that Renaissance uses is linear regression, which a high school student could understand.”
Granted not just any high school student would get linear regression — probably the ones doing AP Calc would —the technique is simply a way to find the relationship between two variables.
While linear regression may be difficult to determine between the dollar and say Bitcoin, it is interestingly enough, a lot easier to determine within cryptocurrencies themselves, in particular between Ethereum and Bitcoin.
But in the financial markets, linear regression gets more tricky.
Because of the non-stationary nature of data sets in financial markets, even where linear regression is “discovered,” it may be based on a set of false positives or quickly evolve into a different relationship.
Which is why AI still struggles with pattern determination and predictive models in financial markets — there are simply too many moving parts.
Although hedge funds continue to pour resources into creating the Skynet (a fictional artificial neural network-based conscious group mind and artificial general intelligence system from the Terminator movies) of trading, finding new market signals is still very much a human endeavor.
Some of the top quant funds still employ hundreds of Ph.D.s in subjects such as mathematics, computer science and even rocket propulsion.
The fundamental core of discerning patterns in a highly random universe is still very much akin to rocket science.
To build the Skynet of investing, one that perhaps won’t threaten to destroy the financial world in its wake, will require researchers to crack the code of causation.
Because correlation does not imply causation, such an autonomous investing system would for example, not only need to detect that a rise in a particular stock is accompanied by a rise in interest rates, it would also need to come up with a good reason for it.
For now at least, humans still have an advantage over machines at this sort of critical thinking and analysis, but AI is starting to make inroads.
Deep learning in particular has driven recent advances in AI such as image recognition and speech translation, two notoriously complex data sets.
And though deep learning’s use in finance is limited, that hasn’t stopped researchers from trying to use it.
Zachary Lipton, a professor at Carnegie Mellon University, co-authored a paper with John Alberg of Euclidean Technologies, an investment management firm, attempting to demonstrate one possible approach to addressing the “noise” problem inherent in financial market data sets — track company fundamentals like revenue or profit margins that ultimately drive company returns instead of stock prices.
But even Lipton and Alberg’s approach has its limitations.
First, it assumes that the quality of the data is impeccable. Given the variety and complexity of valuation models and accounting standards, the quality of inputs in financial markets varies greatly.
Second, because financial markets are constantly adaptive and data sets are generally not deep nor long enough, enduring trends are barely discernible if they exist at all.
Speaking to the Financial Times, Andrew Lapthorne, head of quantitative equity research at Société Générale, an investment bank, cautions,
“The machine has no idea in 2007 that a financial crisis is on the way when it is building its model in 2006.”
Simply put, while computers may be able to discern patterns based on what has happened, they’re generally not as good as predicting what may happen — things like the invention of the internet, the evolution of mobile computing and self-driving cars — these are predictions that AI generally struggles with as they require absorbing a large amount of highly generalized data to divine trends — in other words, critical, “out-of-the-box” thinking.
One of the reasons why AI and deep learning struggle so much in the financial markets is because two of the most unpredictable human emotions of greed and fear are made manifest in this highly competitive arena.
And financial markets determine so much of what it means to be human — everything we do is directly or indirectly dictated by the financial markets — that the factors which influence market prices are as varied as the humans that are influenced by them.
The amount we pay on our mortgages, how much our food costs, whether we drive to work or walk, everything routes back to the financial markets, making predictive models that much more difficult when left purely to automatons.
But because cryptocurrency markets (for now) have limited influence in actual daily life, the factors involved are far fewer and more determinate.
Because most of cryptocurrency trading is autonomously and algorithmically driven, patterns are more easily discernible and human trading behavior often sticks out in stark contrast to established market behavior.
This means that if relatively small advantages, in the region of 51% to 55% are sought out in the cryptocurrency markets, they can almost be guaranteed.
The issue of course is not the opportunity to profit — it’s the magnitude of such profits.
Currently, cryptocurrencies simply do not have the volume and liquidity necessary for autonomous trading strategies to be deployed in large quantums.
Percentage returns for algorithmic cryptocurrency trading may be significant, but beyond certain volumes, especially when assets under management start approaching the hundreds of millions of dollars, traders need to get far more creative and circumspect in deploying funds as the opportunities are far fewer at larger order sizes.
For now at least, AI and machine learning are still some ways away from consistently beating the financial markets, but with a bit of tweaking they may be a lot closer to beating the cryptocurrency markets.
And while the prospect of searching for phantom signals that eventually disappear could dissuade some people from working in finance or cryptocurrency trading — the lure of solving tough problems coupled with the potential to make some serious money means that there will always be more than enough people who will try.
Patrick is an innovative entrepreneur and a lawyer passionate about cryptocurrencies and the business world. He is the CEO of Novum Global Technologies, a cryptocurrency quantitative trading firm. He understands the business concerns of founders and business people helping them to utilise the legal framework to structure their companies to take advantage of emerging technologies such as the blockchain in order to reach greater heights. His passion for travel, marketing and brand building has led him across careers and continents. He read law at the National University of Singapore and graduated with Honors in the Upper Division and joined one of Singapore’s top law firms, Allen & Gledhill where he was called to the Singapore Bar as an Advocate & Solicitor in 2005. He created Purer Skin, a skincare and inner beauty company which melds the traditional wisdom of ancient Asian ingredients such as Bird's Nest with modern technology. In 2010, his partner and himself successfully raised $589,000 from the National Research Foundation of Singapore under the Prime Minister’s Office. He has played a key role in the growth of Purer Skin from 11 retail points in Singapore to over 755 retail points in Singapore and 2 overseas in less than a year. He taught himself graphic design, coding, website design and video editing to create the Purer Skin brand and finished his training at a leading Digital Media Company.