This article mainly discusses quantitative trading systems. As for subjective trading, it is not included in the discussion because market sentiment and patterns are difficult to quantify, and therefore difficult to systematize and automate.

What is a system?

The trading system, like the transportation system, engineering system, and legal system in reality, helps us live better in an uncertain world by establishing a series of rules. The trading system accompanies you in the battles of various secondary markets and is your most important amulet for survival. It protects your positions and allows them to shuttle continuously in the matching engine of the exchange, and eventually the capital curve fluctuates upward.

The system can be imperfect, because any "system" actually running in the real world is the result of various trade-offs and choices, and it is impossible to be flawless. Don't get lost in the illusion of pursuing perfection. But the system must be complete. Complete here means that everything is there, and there are no blind spots. It is anti-fragile and cannot be taken away by any fluctuation.

I believe that a complete trading system must have seven basic elements, namely: target, target market, position leverage or fund management, and then the four basic operations of trading logic: entry and exit profit and loss. The first three items are generally selected by traders through comprehensive experience, and then backtested to confirm whether they are reasonable and effective, and finally quantified the various parameters of the trading logic. Finally, the real-time code will automatically execute according to the rules based on the various parameters obtained by quantitative backtesting.

The following explains them one by one.

1. Subject matter:

First, you need to select the underlying asset you intend to trade.

This can be any target that is convenient to trade. Of course, you can also trade multiple targets at the same time, depending on the specific strategy.

The five major public speculative markets in the world today: stocks (stock indexes), bond markets, commodity futures, foreign exchange, and the newly introduced digital currencies (in fact, there are various betting sites, such as the World Cup, you know, but they are relatively niche, with small trading volumes, and the bosses are not very ethical and run away at any time).

Because the goal is to establish a quantitative trading system, it is best to have an exchange or brokerage firm that provides historical data and API products, which will facilitate quantitative backtesting and programmed automatic execution.

As for how to choose, it mainly depends on what kind of volatility you like, or the counterparty.

The easiest thing is probably digital currency, because the volatility is really big, and people in the market are very easy to fomo and emotional, so there are often more sustained trends. In fact, it is not easy to control Bitcoin, because you don’t know if there is suddenly one or several big whales in a corner of the world who are ready to buy (sell), and you may hit the market randomly.

The most difficult ones should be commodities such as crude oil, because there are games such as geopolitics, rather than simple capital games in the trading market, and it is even more difficult to find traces on the K-line.

In principle, try to choose a market where your opponent is weak. Otherwise, if you are the weakest player at the table, the final result is predictable. Trading is a zero-sum game after all, and one person's profit can only be another person's loss. Choosing a target is like choosing a table.

2. Market conditions:

This is what kind of market your trading strategy is mainly trying to catch. This market can also mean cycles. The shock of a large cycle may be the trend of a small cycle.

First of all, don’t expect to make money in any market conditions or fluctuations. A system must focus on one point only, otherwise it will basically not work well and it’s easy to lose sight of one thing while focusing on another.

In addition, the market can also refer to things like mean reversion or trend following, or arbitrage, high-frequency market making, etc. It can refer to hedging of a single target or multiple targets, or cross-sectional regression or trend.

If you want multiple market conditions, you need multiple systems, or form a system, just like a private equity fund, but this is a team-based operation with division of labor.

In principle, it is a mistake for the system to make money when it shouldn't. If your system's goals are wrong, the final result will be the opposite.

3. Position:

This is how much money you plan to allocate to this system, especially if you have multiple trading systems. For those trading targets that use the margin model, how much leverage do you plan to use.

There is also fund management. In short, it is a question of how much position to use.

Beginners like to ask you what points and indicators you use to enter the market. Those with a little experience will at most ask you how to exit the market and how to set take-profit and stop-loss. Only those who have experienced the beatings of the market will focus on capital management.

Fund management is equivalent to adding a dimension to the trading logic of the system. It is no longer a simple entry and exit dimension, but there is a difference in the amount of funds in each entry and exit, which is similar to rising to a two-dimensional space. In this way, the strategy can play more tricks. Indicators are ultimately convergent, because they are all various mathematical transformations of quantity and price, probably just the lag is not quite the same, and finally play a certain filtering role.

Fund management is the advanced way of playing.

4. Entry:

That is, when to enter the market and in what direction. I mainly do trend tracking. I personally think that the entry signal is not that important, at least not as important as the exit logic, because the future is unpredictable, and no matter what you do, it will not be much better than randomly flipping a coin, and the accuracy improvement is limited. However, as an automated transaction, it must also be regularized.

If you enter the market multiple times separately, it is actually adding positions. Adding positions is equivalent to integrating multiple strategies together to play the role of diversifying positions.

When following the trend, people usually add to their positions when they make a profit, but it is rare to see them adding to their positions when they make a loss.

After adding positions, the winning rate of the general trading system will decrease, but the profit and loss ratio will increase. It depends on your respective choices.

If you add positions, backtesting will be more troublesome. Not only is the code more complicated, but it is also difficult to compare various strategy changes. Because the positions and leverage are different due to different ways of adding positions, comparing their returns and drawdowns is not so intuitive and concise (of course, Calmar ratio is an option), which makes parameter selection difficult.

5. Appearance:

Exit here refers to exiting the market according to the trading strategy signal. For example, when holding a long position, a short signal appears. However, this mode of always holding a position (either long or short) generally has a larger retracement, so it is generally combined with active profit-taking, so that the profit will be less lost, but a certain retracement must be borne to catch a larger trend, otherwise it will be easily shaken out and miss the big trend.

Someone has done a backtest, that is, entering the market with random signals, but as long as the exit is in line with the trading logic, that is, "cut losses and let profits run", then a trading system with positive expected value can be established. Therefore, don't be easily shaken out of the market, and using floating profit withdrawal to catch the big trend is almost the most cost-effective transaction.

There are two more ways to exit. It can be seen that exiting is much more important and critical than entering.

6. Take Profit:

The stop profit here mainly refers to various active stop profits. For example, various fixed stop profits, floating stop profits, and trailing stop profits. Personally, I think that as long as the floating profit is sufficient, that is, a certain profit-loss ratio is reached, you can stop a part of the profit without thinking, so that the capital curve trend is smoother, and you don’t have to let all the profits run to the end.

But don't do the so-called half-close or part-close as soon as you start to make a profit to lock in the profit. I have observed that many teachers who lead orders like to do this because it seems to have a high winning rate, it goes with human nature, and the user experience is good.

But the truth is, if you run away as soon as you make a little profit, or if you leave too early, and if the profit does not exceed a certain profit-loss ratio, your funds will be equivalent to losing money all the time, because when you are eating meat, you run away as soon as you get a bite, but when you are beaten, you will not miss a single blow, and you will stand up to the stop loss every time. Even if you make money in the end, it is the other part of the funds that did not run away in advance that are carrying the burden for all positions.

Therefore, locking in profits too early will greatly affect your efficiency in making money with the entire position.

When taking profit, you must ensure a sufficient profit-loss ratio, rather than just looking at the winning rate.

7. Stop Loss:

Stop loss is a must for a trading system. Generally speaking, once a trading system adds a tight stop loss, its performance will probably decline a lot, that is, the profit will decrease, and the drawdown may also increase at the same time, and the backtest data will not look good. Therefore, some traders who have not suffered losses, do not design a stop loss in the system, and just wait for the reverse signal to come out before exiting the market. It is very likely that they will suffer a big loss at once, which will hit their funds and confidence hard and make them unable to recover.

There are two types of stop loss. One is a fixed ratio stop loss, which means that if the price goes against the trend by 8 or 10 points, the order will be automatically exited at the market price as long as the price hits that point. This is the best because it is the most controllable, and at most there will be some additional slippage. Others, such as using the mark price, may be more difficult to trigger the stop loss, but once it is triggered, it may have gone against the trend by 15 points, resulting in a greater loss. The main problem is that it may exceed expectations too much.

There are also problems like using several times of ATR to stop loss. This kind of problem is also not easy to control, because in extreme cases, ATR may become very large, especially in large cycles, so it is possible to lose a lot at one time, and in fact, you should have left the market long ago.

For a fully automated trading system, stop loss must be considered very carefully, but stop profit can be a little more casual.

Another way is to use the closing price of the K-line. This stop-loss method may be more stable and tempting based on the backtest, but it is also uncontrollable, because obviously a K-line may change significantly under extreme circumstances, and the amplitude may be something you have never seen in all historical K-lines. Otherwise, how can it be called a black swan?

at last

Having a complete trading system is just the beginning of a long journey, and it does not guarantee that you can sit back and relax and start making money. Because the future is uncertain, every strategy will have its disadvantageous period.

Even if we start to make money, when the system continues to lose money and the capital curve keeps retreating, we will still be afraid. We don't know whether the trading model we designed has problems that the backtest has not found, whether there are some unknown changes in the market style, the strategy is "ineffective", and whether the legendary "main force" and "banker" are doing some unknown things.

Everything will turn into a fog, challenging your most basic trading cognition.

In fact, there are many people who can build their own trading systems in the market, but few can survive the adverse period. Under the impact of the retracement trend for several months, most people begin to dominate their brains with fear, start to hesitate and doubt, start to intervene in the system, and even give up their own principles. In the end, the system is changed beyond recognition.

Therefore, what will ultimately test you is your cognition and your determination to execute this trading system, and whether you can overcome the greed and fear along the way.

Finally, if you want to learn more about how to build a trading system, I recommend "The Turtle Trading Rules", which shows a complete trading system without reservation and dissects it very thoroughly. This is a must-read for quantitative trading. Don't be disgusted by the fact that it has been around for decades. Classics never go out of style.