Preface
Why should I take this course?
What do you gain from taking this course? First of all, this course is based on JavaScript and Python programming languages. Language is only a technology. Finally, we should apply this technology into an industry. Quantitative trading is an emerging industry, which is currently in a rapid development stage and has a large demand for talents.
Through the systematic learning of this course, you can have a deeper understanding of the field of quantitative trading. If you are a student preparing to enter the field of quantitative trading, it will also help you. If you are a stock or futures investment enthusiast, then quantitative trading can assist your subjective trading. By developing trading strategies, you can gain profits in the financial market, and also broaden the channels and platforms for your investment and financial management.
Before that, let me talk about my personal trading experience. I am not a finance major, I studied statistics. At first, I began to trade stocks subjectively in my school days. Later, I became a quantitative trading practitioner of domestic private equity funds, mainly engaged in strategy research and strategy development.
I have been trading in this circle for more than ten years, and have developed various types of strategies. My investment philosophy is: risk control is above all else and focuses on absolute returns. The topic of our topic is: from quantitative trading to asset management - CTA strategy development for absolute return.
1. Futures CTA strategy money-making logic
1.1 Understanding Futures CTA
Someone may ask what CTA is? What exactly is the CTA? CTA is called commodity trading advisors in foreign countries and investment manager in China. The traditional CTA is to collect the funds of the majority of investors, then entrust them to professional investment institutions, and finally invest in stock index futures, commodity futures, and treasury bond futures through trading advisers (namely CTA).
But in fact, with the continuous development and expansion of the global futures market, the concept of CTA is also expanding, and its scope is far beyond traditional futures. It can invest not only in the futures market, but also in the interest rate market, the stock market, the foreign exchange market and the option market. As long as there is a certain amount of historical data for this variety, it can develop corresponding CTA strategies based on these historical data.
As early as the 1980s, the electronic trading technology was not mature. At that time, most traders judged the future trend of commodity futures by drawing technical indicators manually, such as William index, KDJ, RSI, MACD, CCI, etc. Later, traders set up a special CTA fund to help customers manage assets. It was not until the popularization of electronic trading in the 1980s that the real CTA fund began to appear.
Changes in CTA fund management size
In billions of dollars
Let's look at the chart above. Especially with the rise of quantitative trading, the scale of global CTA funds has increased from US $130.6 billion in 2005 to more than US $300 billion in 2015. CTA strategy has also become one of the mainstream investment strategies of global hedge funds.
Rising alongside the size is the performance of CTA funds. Let's look at the Barclays CTA index in the chart below. The Barclay CTA index is a representative industry benchmark for global commodity trading advisers. From the end of 1979 to the end of 2016, the cumulative return of the Barclay CTA Fund Index was up to 28.95 times, the annualized return was 9.59%, the Sharp ratio was 0.37, and the maximum withdrawal was 15.66%.
Because in the asset allocation portfolio, the CTA strategy usually maintains very low correlation with other strategies. As shown in the red circle below, during the global stock bear market from 2000 to 2002 and the global subprime crisis in 2008, the Barclay CTA fund index not only did not fall but also achieved positive returns. When the stock market and bond market were in crisis, CTA could provide strong returns. In addition, we can see that the profit level of the Barclay Commodity CTA Index since 1980 has been stronger than the S&P 500, and the withdrawal is also much lower than the S&P 500.
The development of CTA in China has only been in the past ten years, but the momentum is very strong. This is mostly due to the relatively open trading environment of domestic commodity futures, the low threshold of trading funds, the use of margin system to trade in both long and short positions, the low transaction costs, the more advanced technical structure of the exchange compared with stocks, and the easier system trading.
Since 2010, CTA funds have mainly existed in the form of private funds. With the gradual opening of the investment scope of the fund special account in domestic policies, CTA funds began to exist in the form of fund special account. Its more transparent and open operation mode has also become a necessary tool for more investors to allocate assets.
CTA strategies are also more suitable for individual traders than other trading strategies in terms of ease of entry, capital threshold, execution of trading strategies, and API connectivity. Domestic futures contracts are very small. For example, corn or soybean meal can be traded for thousands of yuan, and there is almost no capital threshold. In addition, because some CTA strategies come from traditional technical analysis, it is relatively easy compared with other strategies.
The design process of CTA strategy is also relatively simple. First, the historical data is processed initially, and then input into the quantitative model. The quantitative model includes the trading strategy formed by mathematical modeling, programming design and other tools, and the trading signal is generated by calculating and analyzing these data. Of course, in actual development, it is not as simple as the above chart. Here we just give you an overall concept.
1.2 Type of futures CTA strategy
From the perspective of trading strategy, CTA strategy is also diversified: it can be a trend strategy or an arbitrage strategy; It can be a large-period medium and long-term strategy, or an intraday short term strategy; The strategy logic can be based on technical analysis or fundamental analysis; It can be a subjective transaction or system transaction.
CTA strategy has different classification methods. According to the transaction method, it can be divided into subjective transaction and system transaction. The development of foreign CTA strategy is relatively advanced, and the CTA strategy of system transaction has been close to 100%. According to the analysis method, it can be divided into basic analysis and technical analysis. According to the source of income, it can be divided into trend trading and oscillatory trading.
In general, the CTA strategy accounts for about 70% of the total trading market, the trend strategy accounts for about 25%, and the counter trend or trend reversal strategy accounts for about 5%. Among them, the trend strategy with the largest proportion can be divided into high-frequency trading, intra-day trading, short- and medium-term trading, and medium- and long-term trading according to the position period.
High-frequency market making strategy
At present, there are two mainstream high-frequency trading strategies on the market: one is high-frequency market making strategy, the other is high-frequency arbitrage strategy. Market making strategy is to provide liquidity in the trading market. That is to say, in the trading market with a market maker, if someone wants to trade, the market maker must ensure that his order can be traded. If there is insufficient liquidity in the market and the order cannot be traded, the market maker must buy or sell the counterparty's order.
High-frequency arbitrage strategy
High frequency arbitrage refers to trading two highly correlated stocks or ETF and ETF portfolio. According to the calculation method of ETF, the expected price of an ETF can be calculated in the same way. The ETF index price may subtract the ETF expected price to get a price difference. Usually, the price difference will run in a price channel. If the price difference breaks through the upper and lower channels, you can trade the price difference, wait for the return of the price difference, and earn income from it.
Intraday strategy
In the literal sense, as long as there is no position overnight, it can be called intra-day trading strategy. Due to the short holding period of intraday trading, it is usually impossible to make profits immediately after entering the market, and then leave the market quickly. Therefore, this trading mode bears low market risk. However, because the market changes rapidly in a short period of time, the intra-day strategy usually has higher requirements for traders.
Medium and long-term strategy
In theory, the longer the holding period is, the greater the strategic capacity and the lower the risk-return ratio will be. Especially in institutional transactions, because of the limited capacity of short-term strategies, large funds cannot enter and exit the market in a short period of time, more long-term strategies will be allocated. Generally, the position period is several days and months, or even longer.
CTA strategy data
Generally speaking, the CTA strategy is studied with minute, hour and daily data, which include: opening price, highest price, lowest price, closing price, trading volume, etc; Only a few CTA strategies will use Tick data, such as buy price, sell price, buy volume, sell volume and other in-depth data in L2 data.
As for the basic idea of CTA strategy, the first thing we think of is based on traditional technical indicators, because there are many public reference materials in this area, and the logic is usually simple, most of which are based on statistical principles. For example, we are familiar with various technical indicators: MA, SMA, EMA, MACD, KDJ, RSI, BOLL, W&R, DMI, ATR, SAR, BIAS, OBV, etc.
There are also some classic trading models on the market, which can also be used for reference and improved, including: multiple moving average combination, DualThrust, R-Breaker, Turtle trading method, grid trading method, etc.
All of these are trading strategies based on traditional technical analysis. The process is to extract factors or trading conditions with probability advantages according to historical data and correct trading concepts, and assume that the market will still have such laws in the future. Finally, the trading strategy is realized by code and fully automatic trading. Open positions, stop profits, stop losses, increase positions, reduce positions, etc., which generally do not require manual intervention. In fact, it is a strategy of buying the winners by using the positive autocorrelation coefficient of the price time series.
The biggest advantage of CTA strategy is that no matter whether the current market is rising or falling, it can obtain absolute returns, especially when the market is rapidly changing, or the market trend is obviously smooth, the advantage of the strategy is obvious, in short, if there is a trend, there is a gain. However, if the market is in a volatile situation or the trend is not obvious, the strategy may buy at a high point and sell at a low point, and stop the loss back and forth.
To be continued...