The resource loading... loading...

Implementation of Dual Thrust trading algorithm by using Mylanguage on FMZ Quant platform

Author: FMZ~Lydia, Created: 2022-12-16 13:54:12, Updated: 2023-09-20 10:48:50

img

Implementation of Dual Thrust trading algorithm by using Mylanguage on FMZ Quant platform

1. Introduction to Dual Trust trading strategy

The dual trust trading algorithm is a famous strategy developed by Michael Chalek. It is usually used in futures, foreign exchange and stock markets. The concept of Dual Thrust is similar to a typical breakthrough system, which adopts dual thrust historical prices to construct an updated backtracking period - making it more stable in any given period theoretically.

2. Implementation of Dual Trust trading strategy

In this article, we will introduce the strategy briefly and show how to implement this algorithm by using Mylanguage on the FMZ Quant platform. After extracting the historical price of the selected transaction object, this range is calculated based on the closing price, the highest price and the lowest price in the last N days. When the market moves a certain range from the opening price, the opening operation is performed. We tested the strategy in two market states: trend market and range shock market. The results show that this momentum trading system works better in the trend market, but it will trigger some false buying and selling signals in the volatile market. In the interval market, we can adjust the parameters to obtain better returns.

  • Basic formula: At the close of the day, two values are calculated: the highest price - the closing price, and the closing price - the lowest price. Then take the larger value and multiply by the value of k. The result is called the trigger value.

At the opening of the next day, record the opening price, and then buy immediately when the price exceeds (opening price+trigger value), or sell short when the price is lower than (opening price - trigger value).

The system is a reverse system without a separate stop loss. In other words, the reverse signal is also a closing position signal.

  • Main chart:
Upper track: formula: UPTRACK^^O + KSRG;
Lower track: formula: DOWNTRACK^^O-KXRG;
  • Secondary chart: null

img img

Mylanguage code:

HH:=HV(H,N);
HC:=HV(C,N);
LL:=LV(L,N);
LC:=LV(C,N);

RG:=MAX(HH-LC,HC-LL);
UPTRACK^^O+KS*RG;
DOWNTRACK^^O-KX*RG;


C>UPTRACK,BPK;
C<DOWNTRACK,SPK;

For strategy source code, please refer to: https://www.fmz.com/strategy/128884


Related

More