Strategy Name: Trading Chaos Strategy

Support: Commodity Futures, Digital Currency, Digital Currency Futures

Cycle: Daily

  • Main chart:
    Y line, formula: Y ^^ SMA (REF (HL, N3), N4, 1);
    YRG maximum, formula: MAX_YRG^^ MAX (MAX (Y, R), G);
    YRG minimum, formula: MIN_YRG^^^ MIN (MIN (Y, R), G);
    TOP_FRACTAL, formula: TOP_FRACTAL^^^ VALUEWHEN (H >= MAX_YRG, TOP);
    BOTTOM_FRACTAL, formula: BOTTOM_FRACTAL^^^ VALUEWHEN (L<=MIN_YRG, BOTTOM);
  • Secondary chart:
    none
(*backtest
start: 2018-11-13 00:00:00
end: 2018-12-13 00:00:00
period: 1h
exchanges: [{"eid":"Huobi","currency":"BTC_USDT","balance":10000,"stocks":3}]
*)

N3:=N1+N2;
N4:=N2+N3;

HL:=(H+L)/2;

Y^^SMA(REF(HL,N3),N4,1);
R:=SMA(REF(HL,N2),N3,1);
G:=SMA(REF(HL,N1),N2,1);

TOP_N:=BARSLAST(REF(H,2)=HHV(H,5))+2;
BOTTOM_N:=BARSLAST(REF(L,2)=LLV(L,5))+2;

TOP:=REF(H,TOP_N);
BOTTOM:=REF(L,BOTTOM_N);

MAX_YRG^^MAX(MAX(Y,R),G); 
MIN_YRG^^MIN(MIN(Y,R),G); 

TOP_FRACTAL^^VALUEWHEN(H>=MAX_YRG,TOP);
BOTTOM_FRACTAL^^VALUEWHEN(L<=MIN_YRG,BOTTOM);

BKVOL=0 AND C>=TOP_FRACTAL AND TOP_FRACTAL>MAX_YRG,BPK;
SKVOL=0 AND C<=BOTTOM_FRACTAL AND BOTTOM_FRACTAL<MIN_YRG,SPK;

C<Y,SP(BKVOL);
C>Y,BP(SKVOL);

Backtest on FMZ Quant to know more

Source Code: https://www.fmz.com/strategy/129077

Leave a Reply

Your email address will not be published. Required fields are marked *