网友求助:
各位大侠,
RSV:=(C-LLV(L,4))/(HHV(H,4)-LLV(L,4))*100;
K:=LLV(L,4)+SMA(RSV,4,1)/100*(HHV(H,4)-LLV(L,4));
D:=SMA(K,3,1);
H2:=VALUEWHEN(C>=d and d>ref(D,1),D);
L2:=VALUEWHEN(C<=d and d<ref(D,1),K);
K1:=IF(C>H2,-3,IF(C<L2,1,0));
K2:=VALUEWHEN(K1<>0,K1);
G:=IF(K2>0,H2,L2);
CROSS(C,G);
解答如下:
RSV:=(C-LLV(L,4))/(HHV(H,4)-LLV(L,4))*100;
K:=LLV(L,4)+SMA(RSV,4,1)/100*(HHV(H,4)-LLV(L,4));
D:=SMA(K,3,1);
H2:=ref(d,BARSLAST(C>=d and d>ref(D,1)));
L2:=ref(k,BARSLAST(C<=d and d<ref(D,1)));
K1:=IF(C>H2,-3,IF(C<L2,1,0));
K2:=ref(k1,BARSLAST(K1<>0));
G:=IF(K2>0,H2,L2);
CROSS(C,G);