等级: 新手上路
- 注册:
- 2024-10-26
- 曾用名:
|
老师能否把下面的指标改为一个量化交易系统?
H1:=IFELSE(H<REF(H,1)&&REF(H,1)<REF(H,2),REF(H,2),0);
L1:=IFELSE(L>REF(L,1)&&REF(L,1)>REF(L,2),REF(L,2),0);
H2:=VALUEWHEN(H1>0,H1);
L2:=VALUEWHEN(L1>0,L1);
K1:=IFELSE(CLOSE>H2,-3,IFELSE(CLOSE<L2,1,0));
K2:=VALUEWHEN(K1<>0,K1);
G:=IFELSE(K2=1,H2,L2);
G1:=VALUEWHEN(ISLASTBAR,G);
DRAWNUMBER(L>0,G1,G1,0,COLORCYAN);
W1:=K2;
W2:=OPEN-CLOSE;
HT:=IFELSE(OPEN>CLOSE,OPEN,CLOSE);
LT:=IFELSE(OPEN<CLOSE,OPEN,CLOSE);
DRAWLINE(W1=1,HIGH,W1=1,HT,COLORBLUE);
DRAWLINE(W1=1,LOW,W1=1,LT,COLORBLUE);
DRAWLINE(W1=-3,HIGH,W1=-3,HT,COLORMAGENTA);
DRAWLINE(W1=-3,LOW,W1=-3,LT,COLORMAGENTA);
STICKLINE(W1>0,OPEN,CLOSE,COLORBLUE,1);
STICKLINE(W1<=0,OPEN,CLOSE,COLORMAGENTA,1);
STICKLINE(W2>0&&W1<=0,OPEN,CLOSE,COLORMAGENTA,0);
STICKLINE(W2>0&&W1>0,OPEN,CLOSE,COLORBLUE,0);
DRAWLINE(W1=1&&REF(W1,1)=1,G,W1=1&&REF(W1,1)=1,REF(G,1),COLORGREEN),DOT;
DRAWLINE(W1=-3&&REF(W1,1)=-3,G,W1=-3&&REF(W1,1)=-3,REF(G,1),COLORYELLOW),DOT;
|
|