Insight Data Issue 03 | FMZ Quant & OKX: How Can Ordinary People Master Quantitative Trading?
Author: OKX
In the cryptocurrency market, data has always been an important basis for trading decisions. How to sift through the complex data and uncover valuable information to optimize trading strategies has been a hot topic in the market. To this end, OKX has specially planned the "Insight Data" column and collaborated with mainstream data platforms such as AICoin and Coinglass, as well as relevant institutions, starting from common user needs, hoping to explore a more systematic data methodology for market reference and learning.
In this issue of "Insight Data," the OKX strategy team delves into the concept of quantitative trading together with the FMZ quantitative institution and discusses in detail how ordinary people can get started with quantitative trading. We hope this is helpful to you.
OKX Strategy Team: The OKX strategy team consists of a group of experienced professionals dedicated to driving innovation in the global digital asset strategy field. The team brings together experts from various fields such as market analysis, risk management, and financial engineering, providing solid support for OKX's strategic development with deep professional knowledge and rich business experience. FMZ Quantitative Team: FMZ Quantitative is a company focused on providing professional solutions for cryptocurrency quantitative trading users. FMZ Quantitative not only offers users comprehensive quantitative trading functions such as strategy writing and backtesting, quantitative trading engines, algorithmic trading services, and data analysis tools, but also has an active developer community where users can communicate and share experiences.
1. What is Quantitative Trading?
OKX Strategy Team: Quantitative trading is essentially a way to use mathematical models and statistical methods to automatically execute trading strategies through programs. Unlike manual trading, which relies on personal decisions, quantitative trading analyzes the market using historical data, algorithms, and technical indicators to find trading opportunities and execute trades automatically. OKX's strategy robot provides powerful and flexible automated trading tools, supporting various strategies (such as grid, Martingale strategies, etc.), and can perform strategy backtesting and simulated trading to help users find the most suitable tools in different market environments.
FMZ Quantitative Team: Quantitative trading, also known as algorithmic trading, is not inherently mysterious. When users operate on an exchange's website or software, whether it is fetching market data, checking accounts, placing orders, etc., they are connected to the exchange's server through the corresponding API, allowing the server to return the data the user needs. The API can be loosely understood as accessing a specific web link to retrieve information, for example, opening https://www.okx.com/api/v5/public/funding-rate?instId=BTC-USDT-SWAP in a browser will yield:
{"code":"0","data":[{"fundingRate":"0.0001510608984383","fundingTime":"1717401600000","instId":"BTC-USDT-SWAP","instType":"SWAP","maxFun
Where "fundingRate":"0.0001510608984383" is the current funding rate for the BTC-USDT perpetual contract. By changing the instId=BTC-USDT-SWAP in the link to other cryptocurrencies, you can obtain the corresponding funding rate information. Similarly, by accessing the appropriate API link and filling in the suitable parameters, you can essentially complete the operations we perform on the website or app. If this entire process is controlled by a program to achieve our preset goals (trading or otherwise), this is also quantitative trading.
In summary, the information retrieval and trading decision-making that were once done by our brains can now be fully or partially delegated to a program.
2. Who is it suitable for?
OKX Strategy Team: Taking OKX as an example, our quantitative trading tools are suitable for users with different backgrounds/preferences, whether they are beginners or advanced users, they can quickly get started using the strategies.
- For beginner users (traders with little or no quantitative trading experience), we currently provide:
1) User-friendly interface and preset strategies, allowing users to choose from platform preset strategies such as grid strategies, dollar-cost averaging strategies, etc. These strategies typically do not require complex settings or deep market knowledge; users only need to select and configure a few parameters to get started, without the need for programming or deep technical knowledge.
2) Simulated trading and backtesting, to understand the potential performance of strategies under different parameter settings, reducing risks in real trading. These features help users accumulate experience before actually investing funds.
- For advanced users (traders with some quantitative trading experience or technical skills), OKX's strategy robot also offers highly customizable strategies, such as grid and Martingale strategies that provide rich advanced parameters, or signal strategies that can execute TradingView PineScript, suitable for users with programming and data analysis capabilities.
FMZ Quantitative Team: We often encounter roughly four types of users:
- Professional traders. As a professional trader, trading is fundamental, and one must master all advanced tools to assist themselves; thus, quantitative trading is almost essential for them. Professional traders often have mature and profitable strategies, and programming these strategies allows them to apply them to more exchanges and trading varieties, exponentially increasing trading efficiency.
- Programming enthusiasts. For individual traders with a programming background, quantitative trading tools provide an excellent opportunity to combine programming skills with the digital currency market. They can customize trading strategies and develop trading tools based on their needs, optimizing strategy effectiveness through backtesting. This saves a lot of time in the initial learning phase.
- Traders in need of effective strategies. Some traders may not yet have a stable trading strategy, and quantitative trading tools can also provide assistance. These tools typically include strategy libraries and strategy markets, allowing traders to test other open-source strategies and find strategies that suit them through data analysis and backtesting optimization methods.
- Ordinary traders with learning ability. Even ordinary traders without a programming background can benefit from the automation features provided by quantitative trading tools. By using ready-made quantitative trading platforms like FMZ Quantitative, they can easily set trading strategies and use backtesting features to evaluate strategy effectiveness, thereby improving trading efficiency and reducing human errors in actual operations.
3. What are the advantages and disadvantages compared to manual trading?
OKX Strategy Team: The advantages of quantitative trading lie in its more systematic and objective nature, executing trades through preset algorithms and rules, avoiding emotional interference in decision-making. The trading efficiency is also high, capable of processing large amounts of data and conducting high-frequency trading, capturing market opportunities 24/7 without interruption. Users can also test and optimize strategies using historical data, enhancing the reliability and testability of strategies.
However, quantitative trading is not perfect. Firstly, it has a certain level of complexity; some advanced strategies require professional statistical and financial knowledge, making the threshold relatively high. Secondly, quantitative trading may overly rely on historical data to optimize strategy parameters, while actual market performance may not meet expectations. Since market prices fluctuate according to the random walk hypothesis, past performance may not predict future profit potential, which is known as strategy overfitting. Finally, the performance of quantitative trading strategies may fluctuate under different market conditions, requiring constant adjustments and optimizations to adapt to market changes.
FMZ Quantitative Team: In fact, manual trading and quantitative trading are not opposing relationships. An excellent quantitative trader is often also a qualified manual trader. These two trading methods can complement each other, and combining them can yield greater advantages. Excellent quantitative traders need to have a deep understanding of the market. The market is complex and ever-changing; although quantitative trading relies on data and algorithms, the foundation of these data and algorithms is still a profound understanding of the market. Only by understanding the market's operating mechanisms, influencing factors, and the relationships between various assets can quantitative traders design effective trading strategies. Therefore, quantitative traders must possess solid market knowledge, which is often accumulated through manual trading.
Based on our experience, the advantages can be summarized in three points:
- Automated execution of strategies, avoiding manual intervention.
Sometimes the strategy itself can be profitable, but constant human intervention can lead to losses; programmatic trading can automate the execution of preset trading strategies without manual intervention. This means traders can set conditions for buying and selling, and the program will automatically trade when conditions are met, thus avoiding emotional fluctuations and human errors. The program executes continuously 24 hours a day, freeing traders from long hours of monitoring.
- It can meet the needs for low latency, high frequency, and complex calculations in trading.
Manual trading is limited by human reaction and calculation speed, which cannot compare to program execution; these needs can only be met by quantitative trading.
- Quantitative trading can utilize historical data to backtest and optimize trading strategies.
By simulating the performance of strategies in past markets, traders can assess the effectiveness of strategies. This method can help traders optimize strategies before actual trading, increasing the probability of profit. Many manual traders trade based on intuition, incurring high time and monetary costs in trial and error in real trading. In fact, most quantitative strategies are derived from data analysis.
Of course, quantitative trading is not without its flaws; it also has some disadvantages:
- High technical requirements:
Compared to manual trading, quantitative trading requires additional programming and data analysis skills, making the threshold relatively high. Newcomers to quantitative trading undoubtedly need to invest a lot of time learning, and there is no guarantee of returns on the investment.
- Higher costs:
The setup and maintenance costs of quantitative trading systems are high, especially for high-frequency trading, which requires substantial hardware and data resources. These fixed costs will incur regardless of whether the strategy is profitable or not.
- Market risks:
Although quantitative trading can reduce human errors, market risks still exist, and strategy failures can lead to significant losses. Moreover, quantitative strategies are written in advance and backtested based on historical data, which has certain limitations and may not keep pace with changes outside the market. Manual traders can quickly make comprehensive judgments based on various information in the market and are more sensitive to market changes.
4. How can beginner users get started?
OKX Strategy Team: Overall, quantitative trading presents certain challenges for beginners, but it is not impossible to get started. Here are some suggestions to help beginner users better grasp quantitative trading:
- Learn the basics: First, understand the basic principles of strategies and how different parameter settings affect strategy performance; this is the first step to success.
- Choose the right strategy robot: Based on your judgment of market conditions, select a suitable strategy robot. For example, in a sideways market, a grid strategy may be a good choice.
- Start with simple strategies: Begin with the most basic trading strategies, gradually learning and implementing them, and then gradually introduce more complex strategies.
- Focus on risk management: Learn to establish and execute effective risk management and stop-loss strategies.
FMZ Quantitative Team: Whenever algorithmic trading is mentioned, many people feel that the threshold is high and the technology is complex. In fact, learning algorithmic trading has become very simple now. Exchanges have integrated common strategies, and quantitative teams like FMZ Quantitative provide one-stop services. With the assistance of large language models like ChatGPT for programming, beginner users have realistic and feasible paths to get started or even master algorithmic trading. The only barrier is the willingness to take action. If you are a novice trader with many trading ideas, learning algorithmic trading will give you a significant advantage. Here are the steps we believe are suitable for cryptocurrency traders with no programming background:
- Familiarize yourself with basic quantitative strategies:
Understanding the strategy trading module of the OKX exchange will help you gain a preliminary understanding of strategy trading. For most traders, these features are sufficient. If you have more ideas to implement, you can continue to learn in depth.
- Learn programming languages:
We recommend learning JavaScript (JS) and Python; you only need to master the basics. While writing strategies, you can learn and practice simultaneously, and improvement will come quickly. The JS programming language is relatively simple, and there are many open-source strategies available on the FMZ platform, ranging from simple to complex. Python is the most commonly used language for data processing, and it is very convenient to conduct statistical analysis using Jupyter Notebook. During this time, you can also learn some data analysis; there are many relevant Python books and tutorials available, such as "Python for Data Analysis." Based on your learning foundation, studying for 4 hours a day will take about 1-2 weeks.
- Read basic quantitative trading books:
There are many related books available; you can search for them. You can read quickly to understand types of strategies, risk control, strategy evaluation, etc. Quantitative trading involves finance, mathematics, and programming, making the content very rich. Strategies that can truly be applied to the market will not be directly found in books. Reading relevant books, research reports, and papers is a long-term process.
- Learn the exchange's API documentation and related examples, and deploy some strategies in real trading:
We recommend starting with the FMZ Quantitative platform, as its rich documentation and examples greatly lower the barrier to real trading. This step requires mastering the basic strategy architecture and solving common problems, such as error handling, access frequency control, strategy fault tolerance, risk control, etc. Write some simple modules, such as price push notifications, iceberg orders, etc., to practice writing real trading strategies. Backtest some basic strategies, such as grid and balancing strategies. Join relevant groups to learn how to ask questions correctly and search for related posts.
- Validate strategies through backtesting and simulated trading, continuously improve, and eventually start real trading:
Skilled traders already have their own strategic ideas and can validate and refine their strategies through backtesting and simulated trading before starting real trading. Completing a full strategy and watching orders being automatically placed is an indescribable joy. If you don't have your own strategy yet, you can first complete backtesting and arbitrage of some open-source strategies, trading grid strategies for multiple pairs, etc., to practice real trading programming skills.
- Continuously read, think, communicate, analyze, backtest, and practice in real trading:
As the difficulty gradually increases and learning deepens, your abilities will continue to improve.
5. What are the precautions when using quantitative trading?
OKX Strategy Team:
In fact, we believe users need to pay attention to the following three points when using quantitative trading:
- Quantitative trading guarantees profit:
Many people believe that quantitative trading relies on complex algorithms and data analysis, so it must be able to generate stable profits. However, quantitative trading does not guarantee profits. Although quantitative strategies optimize trading decisions through data and algorithms, market uncertainties, errors in model assumptions, and strategy overfitting can all lead to losses. Quantitative trading still faces market risks and the risk of strategy failure. The key lies in selecting appropriate trading strategies in different market conditions and reasonably setting the parameters of the corresponding strategies.
- Quantitative trading is only suitable for large institutions and high-net-worth users:
Individual investors can also participate in quantitative trading using available quantitative trading platforms and open-source tools. For example, tools such as grid strategies, Martingale strategies, and signal strategies provided by OKX can all be used for free. Although high-frequency trading does require high capital and technical thresholds, the aforementioned types of strategies do not necessarily require large amounts of capital.
- Backtesting results represent future performance:
Backtesting is just one method of evaluating strategies, but it cannot guarantee future performance. Changes in market conditions, deviations from model assumptions, and strategy overfitting (excessive optimization based on historical data) can all lead to actual trading results falling short of expectations. Backtesting results need to be evaluated in conjunction with real market conditions and robust risk management to assess their reliability.
FMZ Quantitative Team: In fact, most people do not have a deep understanding of quantitative trading, which can lead to some misconceptions. We have summarized these common misconceptions and shared them with readers:
- Does quantitative trading guarantee profits?
Many traders turn to quantitative trading after losing in manual trading, hoping to quickly profit from it, viewing it as a lifeline. However, profitability depends more on the logic of the trading strategy rather than the tool itself. Even if an ideal automated trading strategy is developed, various unexpected issues may arise in actual trading, leading to suboptimal strategy performance. Therefore, algorithmic trading is not a guarantee of profit; it requires continuous optimization and adjustment of strategies.
- Does quantitative trading not make mistakes?
Although quantitative trading reduces errors from manual operations, it can also introduce other errors. For example, the leakage of API keys may lead to malicious operations on account funds. Additionally, bugs in the strategy or unhandled exceptions may result in erroneous trades, potentially leading to catastrophic consequences. To avoid these issues, traders need to implement strict security measures and conduct thorough testing and validation before deploying trading programs to ensure the robustness and reliability of the programs.
Conclusion
The above is the third issue of the "Insight Data" column launched by OKX, focusing on core issues such as how to get started with quantitative trading and precautions, hoping to help interested traders gain a more systematic understanding of quantitative trading and make informed trading decisions. In future articles, we will continue to explore more practical data usage/analysis methods to provide references for traders with different trading preferences.
Risk Warning and Disclaimer
This article is for reference only. The views expressed in this article are solely those of the author and do not represent the position of OKX. This article does not intend to provide (i) investment advice or recommendations; (ii) offers or solicitations to buy, sell, or hold digital assets; (iii) financial, accounting, legal, or tax advice. Holding digital assets (including stablecoins and NFTs) involves high risks and may fluctuate significantly. You should carefully consider whether trading or holding digital assets is suitable for you based on your financial situation. Please consult your legal/tax/investment professionals regarding your specific circumstances. You are responsible for understanding and complying with applicable local laws and regulations.