SF38丨Asymmetric Supertrend Line + Adaptive Quick Exit

 Committed to quantitative strategy development, high-quality community, trading ideas sharing and other related content

Hi, my name is Le Chiffre.

What I bring to you today is the seventh content of the super trend line series. This series has been in the series for more than half a year since April 2021. It has continuously changed from the super trend line algorithm of entering the market, the flexibility of the appearance, and self-adaptation. Version, a variety of different entry and exit logic, can not be incomplete.

Before introducing SF38, let's make a summary of all previous versions in history. Also today's SF series strategy article is the last article in 2021. The super trend line series is as follows:

       SF29 - "Magic Modified Adaptive Moving Average + Long-Short Asymmetric Combination"

       SF26 - "Pivot Point Trend Strategy"

       SF33 - "Super Trend Line Series 3"

       SF35 - "Variable Exponential Dynamic Average + Adaptive Appearance"

       SF36 - "Tracking + Directional Double Departure"

       SF37 - "The Role of Next-Generation ATRs in Super Trendlines"

  

 Except for SF37, the trend lines of all the above versions are super trend lines constructed based on ATR, that is, real volatility. SF37 is a new generation of ATR calculation algorithm that we use. Today, I name this new generation of ATR "STR". The Chinese translation name can be called "entity fluctuation range", "squirrel fluctuation range" or "super fluctuation range" (for details of the algorithm logic, please refer to the article SF37).

In the two research articles " Quantitative Research丨Long and Short are Originally Different, Wake Up " and " Quantitative Research丨Asymmetry between Long and Short ", I once again deeply realized that in addition to the cycle and parameters, it is not the same for long and short. In addition to symmetry, the thinking logic of the strategy has not been iterated and modified asymmetrically.

The entry and exit of this issue will use the long-short asymmetric algorithm to judge the reversal of the long-short super trend line. The time factor and three different asymmetric algorithms are also tested and verified.

1. How to construct asymmetric logic and the time factor

In the article titled "Quantitative Research丨The long and short positions are different, wake up", we studied the rising and falling speed of all the long and short varieties in the black series, as shown in the following figure:

The speed of the thread falling is greater than the speed of rising.

The speed of iron ore falling is greater than the speed of rising.

We can simply see from the thread and iron ore that after the supply-side reform in 2016, the rate of decline of the thread has been greater than the rate of increase. Therefore, it appears that the cumulative number of the cumulative value of the falling speed is continuously greater than the cumulative number of the rising speed. However, this situation is another scene for iron ore. Iron ore has only shown the same characteristics as rebar since August 2020. Before, the rate of increase was much greater than the rate of decline.

Starting from this logic, we try to make two logical judgments on the side of fast rising and fast falling:

First, the fast-rising and fast-falling attributes are combined with the fast reversal speed and the algorithm with small fluctuations in algorithm calculation, so as to quickly enter the rhythm of the reversal market.

Second, fast ups and downs generally tend to be short-lived. Through filtering logic, the rhythm of these fast ups and downs is avoided. to avoid these transactions.

To sum up , in fact, to put it bluntly, it is whether we should act faster, or use a logic to filter out and try not to act. In theory, a quicker shot can catch a lot of small bands, but the error rate will also increase. vice versa.

The experimental logic is as follows:

1. We use the "STR" method in the thread air, because the STR algorithm discards the gap between the K lines, and the overall fluctuation is no different from ATR. For details, please refer to the SF37 series of articles, or "alternative community" (heterogeneous). CTA) titled "Quantitative Research on Heterogeneous Communities 3丨-Characterization of Volatility".

2. We use the ATR calculation of the inter-day cycle and filter by the volatility of the larger cycle frequency.

The above two logics are used in the thread air, and the test results show that the performance of the first one is far worse than the second one. As shown below:

The first

the second

Through backtesting, we can see that in the thread world, the overall falling speed is faster than the rising speed, but from a trend point of view, frequent declines and faster speeds increase the number of errors, while the sensitivity logic instead encourages increase in this wrong way.

In contrast to the second method, we have reduced false openings through stricter filtering. Only do markets that fall quickly and last for a long time.

Among them, here we use the inter-day cycle ATR as the logic in the first step logic of constructing the super trend line, instead of using the STR logic in the bulls, as shown in the following figure:      

2. Visualization

Let's take a concrete look at the effects of different algorithms with different long and short market conditions, as shown in the following figure:

short

long first segment

long second segment

From the perspective of constructing different long-short structures with different algorithms, in the long-term structure, there have been several short-turn situations from 2021-7-15 to 2021-9-23, and we did not see the short position in the first picture. A bearish turnaround occurs. This is actually the effect we originally wanted to achieve, or the most basic effect of our research. Long and short should not use the same reverse logic to judge entry and exit.

Similarly, this time, we removed the value of the daily opening price, and instead used 9:00 a.m. as the daily opening price. From the final results of the backtest and the strategy logic, the benchmark at 9:00 a.m. is still better than a night-time benchmark. 9 o'clock on the plate is accurate. We will not demonstrate it in detail here.

3. Performance

combination

LPG

AP

i

Ss

J

Mandarin-coke-long

Mandarin-Coke-short

4. Appearance

Because in SF37, in order to make up for the slow appearance of the adaptive Krange appearance mode, I added the logical judgment of the er efficiency coefficient to speed up the appearance at the right time, but the integration of two parameters was added virtually, which not only increased the time for parameter optimization , it also reduces the stability of the model to varying degrees. For some newbies, or people with conservative ideas, this is a more tangled and uncomfortable point.

In SF38, the author incorporates the logic of Kaufman's adaptive moving average into the process of adaptive appearance. This solution belongs to the combination of SF35 and SF37, which not only maintains the self-adaptation, but also reduces the number of parameters. The appearance consists of 3 parameters. reduced to 1. As shown below:

For details, please refer to the VIP community source code. If you don't understand, I will answer it live next week.

In addition, a live broadcast message will be added. After the "heterogeneous community" vote, the 2021 "heterogeneous community" live broadcast strategy explanation and answer will be from 2021-12-27 to 2021-12-31 The last week of this year Start. The specific time is tentatively scheduled to start from 19:00-21:00 in the evening of 2021-12-31.

At that time, I will take out several classic strategies of the LM series and explain them step by step, as well as how to think about the strategy background and how to complete the code. Here, you can not only get the source code, but also get continuous and iterative ideas.

Finally, as 2021 is coming to an end and 2022 is approaching, I wish you all the best of luck in the new year, good health, and a happy family.

Due to the differences between platforms, the backtest performance is subject to the TBQ version

This strategy is only used for learning and communication, and investors are personally responsible for the profit and loss of real trading.

Guess you like

Origin blog.csdn.net/m0_56236921/article/details/123727043