SF23 | Unpretentious Dual Thrust strategy maintains positive expected returns over the long term

 

  The official account is dedicated to sharing quantitative strategies, training videos, Python, programmatic trading and other related content

1. Introduction to Dual Thrust Strategy

Dual Thrust, developed by Michael Chalek in the 1980s, was once named one of the most profitable strategies by FutureTrust magazine. The Dual Thrust system strategy is very simple and the thinking is concise, but as the so-called road is simple, this strategy is suitable for multiple types of markets such as stocks, futures, and foreign exchange. stable income.

Dual Thrust is a typical range breakout strategy, which uses today's opening price plus or minus a certain percentage of the price amplitude (Range) within N cycles to determine the upper and lower rails;

Dual Thrust considers the asymmetric amplitude for the trigger conditions of long and short positions. The reference Range for long and short positions can choose different periods, and can also be determined by parameters K1 and K2.

The specific calculation process is as follows:

The highest price HH of High on N day, the lowest price LC of Close on N day;

The highest price of N-day Close is HC, and the lowest price of N-day Low is LL;

Range = Max(HH-LC,HC-LL)

上轨(upperLine )= Open + K1*Range

下轨(lowerLine )= Open + K2*Range

(1) When the price breaks above the upper rail, if there is a short position at that time, close the position first, and then open a long position; if there is no position, open a long position directly;

(2) When the price breaks below the lower track, if you hold a long position at that time, Zexian Pingchuan will open a short position; if there is no position, open a short position directly;

2. Improvement of CTA strategy

The default Dual Thrust strategy is a closing and liquidation trading model. This model does not perform well in domestic commodities, so it is still necessary to seize the general trend. Let's improve the Dual Thrust strategy and see how it turns out.

Trend judgment

The Dual Thrust strategy itself does not have the function of trend judgment, but only calculates the intraday range. In order for it to judge the direction and catch the main trend, we need to write a trend judgment code:

condRHL=HL<>HL[1];  If(condRHL)  {
   
       R_HL=HL[1];    X=X+1;    sumAG=sumAG+HL[1];    If(X>2)    {
   
         HLAverage=sumAG/X;      sumAG=0;      X=0;    }  }

The red line in the figure is our trend line, which is long above HLVerage and short below;

Then add trailing take profit and stop loss.

No, it's that simple.

Let's take a look at the performance:

Thread:

Coke:

iron ore:

PP:

Methanol:

Thermal coal:

Apple:

Other Platform_Thread:

MC:

Mandarin 8:

Provide source code:

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