Sumber daya yang dimuat... Pemuatan...

Strategi saluran berdasarkan ATR

Penulis:Mandi Archimedes, Tanggal: 2018-11-30 09:19:56
Tag:Baiklah.ATRMyLanguage

  • Nama strategi: Strategi saluran berdasarkan indeks volatilitas ATR

  • Ide strategi: Strategi adaptif saluran, berhenti tetap + berhenti terapung

  • Siklus data: Multi-siklus

    img
    img

  • Bagan utama: Gambar UBAND, rumus: UBAND ^^ MAC + MATR; Gambar DBAND, rumus: DBAND ^^ MAC-MATR;

  • Bagan sekunder: Tidak ada


(*backtest
start: 2018-06-01 00:00:00
end: 2018-07-01 00:00:00
period: 1h
exchanges: [{"eid":"Futures_OKCoin","currency":"BTC_USD"}]
args: [["TradeAmount",10,126961],["ContractType","this_week",126961]]
*)

TR1:=MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
ATR:=MA(TR1,N);
MAC:=MA(C,N);
UBAND^^MAC+M*ATR;
DBAND^^MAC-M*ATR;
H>=HHV(H,N),BPK;
L<=LLV(L,N),SPK;
(H>=HHV(H,M*N) OR C<=UBAND) AND BKHIGH>=BKPRICE*(1+M*SLOSS*0.01),SP;
(L<=LLV(L,M*N) OR C>=DBAND) AND SKLOW<=SKPRICE*(1-M*SLOSS*0.01),BP;
// 止损
// stop loss
C>=SKPRICE*(1+SLOSS*0.01),BP;
C<=BKPRICE*(1-SLOSS*0.01),SP;
AUTOFILTER;

Berkaitan

Lebih banyak