Dual Thrust (MyLanguage version)

Trend OKEX MyLanguage
Created on: 2018-12-04 16:50:42 Modified on: 2019-08-20 10:47:50
Copy: 125 Number of hits: 4555
avatar of 阿基米德的浴缸 阿基米德的浴缸
0
Follow
18
Followers
  • Fundamental: 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 one and multiply it by the value of k. The result is called the trigger value. At the opening of the next day, record the opening price, then buy immediately when the price exceeds (opening price + trigger value), or sell short when the price is lower than (opening price - trigger value). This system is a reversal system with no separate stop loss. In other words, the reverse signal is also the closing signal.

Dual Thrust (MyLanguage version)
Dual Thrust (MyLanguage version)
Dual Thrust (MyLanguage version)

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

  • Secondary chart: none

Strategy source code
(*backtest
start: 2018-01-01 00:00:00
end: 2018-02-28 00:00:00
period: 1d
exchanges: [{"eid":"Futures_OKCoin","currency":"BTC_USD"}]
args: [["ContractType","this_week",126961]]
*)

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;