SF35丨Variable Exponential Dynamic Average + Adaptive Appearance

 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 variable index dynamic average of super trend line series 4 + adaptive exit CTA medium and short cycle strategy. This article focuses on the deep logic of the strategy, especially the appearance.

Detailed entry logic

Variable Index Dynamic Average, English name "Variable Index Dynamic Average", referred to as "VIDYA". The indicator was published by Tushar Chande in "Stocks & Commodities" magazine in March 1992.

This indicator is similar to the exponential moving average, but based on price volatility, the smoothing weight can be automatically adjusted. The algorithm here is similar to the Kaufman adaptive moving average. However, in the first version, the standard deviation was used as the volatility index, and Chande modified VIDYA in October 1995 to use the Chande Momentum Oscillator (CMO) as the volatility index.     

As a moving average, VIDYA smoothes the market noise and makes the market trend clearer. In order to achieve this goal, the indicator uses a certain period of price average to filter the market noise. During the calculation process, some other values ​​(weights) Added to the average price, such as exponential average, smoothed average, all weights are involved. However, in the calculation process of VIDYA indicator, the weight of the price of each cycle will increase as the market volatility increases.

Next, I will introduce to you, the CMO that you often see online, but the VIDYA that you do not often see.

The code screenshot is shown in the following figure:     

The indicator calculation takes into account the data of the rising cycle and the falling cycle, similar to the basic calculation of entry in SF21. This out return value is the CMO that we all often see. The CMO itself is also used as an adaptive weight change in the second edition of Chande, which also extends to today's VIDYA.

In the subsequent algorithm processing of the super trend line, we adopt the same super trend line construction principle as SF29 and SF14, as shown in the following figure:

       VIDYA Super Trend Line + Coke

       VIDYA Super Trend Line + LPG

Detailed explanation of appearance logic

For exit logic, we have developed a completely different exit method from the past. This is the biggest core highlight of this strategy - adaptive exit logic. In the SF20 strategy, I once secretly sighed that I could always come up with such an adaptive exit tracking logic based on trading volume and deeply admired it. Since then, I have been silently collecting and reproducing the system logic and code of the exit. But basically they are inseparable from the categories of tracking, chandeliers, and targets. The problem is that it is not novel, imperfect, and the homogeneity of departure.

In the process of making new highs in the past few months, I kept thinking → testing → summarizing, and then reflecting → testing → summarizing. Finally came up with an adaptive departure logic. The logic is actually very simple: according to the fluctuation range of the K-line and the ER efficiency coefficient, adaptive trailing, take-profit and stop-loss exits are carried out.

The specific logic is shown in the following figure:

The logic of the exit consists of 2 parts. The first part is shown on the figure: the tracking line is calculated according to the difference between two adjacent or similar N and K lines, so that we can achieve adaptive tracking, and not because of A large rise loses profits due to the slow tracking of the trailing line. But there is also a problem, that is, due to the extremely low signal-to-noise ratio of financial market data, 3 steps, 2 steps back, or even 3 steps back is a common occurrence. Therefore, we need a transition to smooth the noise of the K-line, so we use the second part of this exit strategy, the artifact we often use - the ER efficiency coefficient.

That is to say, the exit strategy consists of two parts of logic :

1: K-line adaptive amplitude is calculated from adjacent data

2: The ER efficiency coefficient is calculated from X K-lines in the latest cycle

Therefore, the above adaptation considers the present, but it is too spurious and noisy, and also considers the data that is not too far in the past for smoothing.      

Judging from the above crude oil market chart (yellow line is the trailing take profit and stop loss line), when the market price rises slowly, the tracking is also slow, but when the market price rises rapidly, the tracking line also accelerates rapidly, thus protecting profits.

Wenhua appeared (because the addition of LINETHICK in the following statement, and the change of any thickness and color standards such as colorgreen will link the closing lines of different strokes together, so here I did not bold and change the color, just adjusted the background color to intercept a certain line at a close distance. One stroke so that the mobile terminal can see it more clearly.)

Supplement: The logic of Mandarin is outside the BAR. According to the logic of TB, it is the logic of appearing in the BAR. Here you can change the reference settings by yourself.

Please see the performance chart of single variety and combination below: (Due to the differences between platforms, the performance is subject to the TB version)

TB iron ore empty

TB iron ore more

Mandarin iron ore empty

Mandarin iron ore

LPG

SC

2017-present, multi-variety combination

vnpy

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/123655933