Read to learn how AI and machine learning are used in cryptocurrency trading and how AI can make your trading more profitable. At Trading Strategy, we have an extensive history of using AI in trading and want to share more on the background of key concepts and benefits.
The history of finance and AI
The use of machine learning methods and AI is nothing new to finance. Statistical mathematics has been the foundation of quantitative finance and hedge funds since the 70s. Pandas, the most popular data science library in software development, was originally written by hedge fund researchers. In fact, it's more accurate to say that finance has been a driving force behind data science advancements, rather than claiming that AI is only now disrupting finance. The AI component has simply become more visible and consumer-accessible in recent years.
All artificial intelligence is just an expansion of statistical mathematics. The line between statistical analysis, machine learning and AI is blurred – often, it is just about the size of the matrix calculation.
Fundamental, technical, and forms of trading
The concept of (directional) trading is that you bet the price of an asset to go in a certain direction and then take a position based on this prediction. Your trading is profitable as long as most of your bets are correct. Most people lose money in trading, usually due to a lack of discipline and aggressive risk-taking, so even a poor trading algorithm can often beat most humans.
Some common methods applied in trading – or quantitative finance as it is called in its wider scope – include
- Technical analysis: Predict the movement of asset prices based on time series of historical price and volume data. Prices follow certain patterns due to the market microstructure, human behaviour and timing issues. Most technical indicator-based trading captures some of these concepts in trading algorithms.
- Fundamental analysis: Predict the movement of asset prices based on the assessment that the market overprices or underprices them relative to the strength of underlying factors. These factors may include innovation, changing demand, cash flow, team composition, market position, and growth potential.
Some other concepts related to algorithmic trading are
- Directional: You hold assets because you believe their price will go up, e.g. by holding Bitcoin, using it as collateral or lending it to others.
- Portfolio construction: manage a basket of assets with directional bets
- Discrete trading: fully enter or exit a position when something happens, e.g. technical indicators reach a certain threshold
- Continuous trading: portfolio construction with continuous buying and selling assets when the technical indicators roll forward
- Market making: Earn fees by providing liquidity (Uniswap) or funding leverage positions (GMX, Aave)
- Delta neutral: Construct market-making positions that should not be exposed to changes in the price of an asset by hedging your position – all your profits come from the market-making fees
- Credit markets: instead of participating in more complex trades, you safely provide USD credit to trades on venues (Aave), or buy US treasury notes (Ondo)
What makes cryptocurrency trading special?
Cryptocurrency markets are very momentum-driven. There are few fundamentals, so to speak. Most cryptocurrency price actions happen because people believe something. A large gap often exists between the belief and the underlying fundamental becoming reality. There are no balance sheets to analyse: any impact on the real economy is minuscule today but speculatively extremely large in the future.
The potentially tradeable asset universe is massive: millions of tokens, most of which are machine-generated scams that never see active trading. The liquid tradeable asset universe is only a fraction of this, a couple of thousand tokens max.
Why does AI often fail cryptocurrency trading?
Often, there is not enough trading history for quantitative analysis to have any statistical significance. This makes cryptocurrency a different beast to understand compared to the more established and fundamentally-driven stock, bond, and FX markets. The market microstructure is also young and changes frequently (Bitcoin ETF, token launches shifting from ICO fair funding to VC fund raises, etc.). Consequently, even when data is available, it's challenging to reliably extrapolate from it due to the rapidly evolving nature of the market.
Because there isn't enough history to make any conclusion that would be statistically significant, it is often better to base your trading algorithm on an idea or a story you can tell: something that should work based on the understanding of market dynamics, instead of trying to prove how it works based on market data.
Different AI methods in algorithmic trading
Here are some popular AI methodologies and how they are applied to trading. Trading Strategy documentation has a dedicated section about learning how to use AI and machine learning in trading, consisting of books, courses and research papers.
ChatGPT and other LLMs
Large Language Models like ChatGPT often summarise text content and form an opinion. Because cryptocurrency trading has few fundamentals, there is not much to automatically summarise, and LLMs are next to useless in cryptocurrency trading compared to time-series models.
LLMs can help to write Python code for a trading algorithm. You still need a lot of domain expertise in software development, as LLMs can only help you with basic questions but cannot design the algorithm for you.
ChatGPT itself can only generate junk trading algorithms.
Sentiment analysis
In sentiment analysis, a large number of public messages and posts are analysed to form an opinion about whether these messages are positively or negatively discussing assets. It is then assumed that the positive discussion will cause the asset price to go up because people want to buy assets they like. Sometimes even the volume of messages provides sufficient signal indicating the asset price is about to move.
Popular cryptocurrency sentiment analysis services include e.g. TrendsSpotter.ai and Santiment.
Reinforcement learning
Reinforcement learning is a type of machine learning in which an agent learns to make decisions by interacting with an environment. The agent receives feedback in the form of rewards or penalties for its actions, allowing it to improve its decision-making over time. This approach enables the agent to learn optimal strategies for achieving goals in complex, dynamic environments without explicitly programming every possible scenario.
Reinforcement learning is often used to train on time-series data to predict the future price and success of buy/sell trades.
A popular Python framework for reinforcement learning in algorithmic trading is FinRL.
Optimising trading strategies
Machine learning can be used to optimise existing otherwise hand-crafted strategies.
- A strategy developer (quant) writes a trading strategy that decides trades based on tuneable parameters.
- Then, an optimiser searches the parameter space, also called dimensions, search space or hyperspace, for optimal parameters.
- Popular optimisers are Gaussian Process (GP) and Gradient Boosted Regression Trees (GBRT)
- You can tune your strategy differently by optimising for a different goal: CAGR (absolute profit), Sharpe and Sortino ratios
- Optimisers are an alternative for often slower grid search which does an exhaustive parameter search.
How does Trading Strategy use AI?
At Trading Strategy, we provide a holistic approach to machine-driven trading, not limited to algorithm development.
At Trading Strategy, we use smart contracts, vaults and oracles to provide an experience distinct from centralised exchanges and traditional hedge fund models.
- Self-custodial protocol ensures greater transparency and greatly reduced risk of fraud with the deposited funds.
- Unlike discretionary trading where fund managers make decisions, our algorithms execute all trades automatically, while providing visibility to users about the timing and rationale of each decision.
- All trading happens on decentralised exchanges.
This approach to trading eliminates counterparty risks, making it safer and more accessible to a wider audience.
When developing strategies for the Trading Strategy platform, developers can leverage a wide range of contemporary AI methods, including
- Reinforcement learning with model libraries like FinRL
- Integrating sentiment analysis into the strategies
- Using AI-based optimisers as a faster alternative to grid search
Try it and learn more
Our first set of open strategies, which anyone can use, is live. As discussed, automated strategies are likely to outperform humans, and you can try them out to see if this holds.
If you are a software developer or a quant, we have an incentive program for you to deploy your strategies on our protocol.
Otherwise, you can contact us with any questions in the Trading Strategy Discord.